| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
#include <aws/http/http.h> |
| 7 |
#include <aws/testing/aws_test_harness.h> |
| 8 |
|
| 9 |
static int s_test_http_error_code_is_retryable(struct aws_allocator *allocator, void *ctx) { |
| 10 |
(void)allocator; |
| 11 |
(void)ctx; |
| 12 |
|
| 13 |
int error_code = 0; |
| 14 |
ASSERT_FALSE(aws_http_error_code_is_retryable(error_code)); |
| 15 |
|
| 16 |
{ |
| 17 |
error_code = AWS_ERROR_HTTP_CONNECTION_CLOSED; |
| 18 |
ASSERT_TRUE(aws_http_error_code_is_retryable(error_code)); |
| 19 |
} |
| 20 |
{ |
| 21 |
error_code = AWS_ERROR_HTTP_SERVER_CLOSED; |
| 22 |
ASSERT_TRUE(aws_http_error_code_is_retryable(error_code)); |
| 23 |
} |
| 24 |
|
| 25 |
error_code = AWS_ERROR_SUCCESS; |
| 26 |
ASSERT_FALSE(aws_http_error_code_is_retryable(error_code)); |
| 27 |
|
| 28 |
return AWS_OP_SUCCESS; |
| 29 |
} |
| 30 |
|
| 31 |
AWS_TEST_CASE(test_http_error_code_is_retryable, s_test_http_error_code_is_retryable); |