-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathtest_http.c
More file actions
31 lines (24 loc) · 891 Bytes
/
test_http.c
File metadata and controls
31 lines (24 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/http/http.h>
#include <aws/testing/aws_test_harness.h>
static int s_test_http_error_code_is_retryable(struct aws_allocator *allocator, void *ctx) {
(void)allocator;
(void)ctx;
int error_code = 0;
ASSERT_FALSE(aws_http_error_code_is_retryable(error_code));
{
error_code = AWS_ERROR_HTTP_CONNECTION_CLOSED;
ASSERT_TRUE(aws_http_error_code_is_retryable(error_code));
}
{
error_code = AWS_ERROR_HTTP_SERVER_CLOSED;
ASSERT_TRUE(aws_http_error_code_is_retryable(error_code));
}
error_code = AWS_ERROR_SUCCESS;
ASSERT_FALSE(aws_http_error_code_is_retryable(error_code));
return AWS_OP_SUCCESS;
}
AWS_TEST_CASE(test_http_error_code_is_retryable, s_test_http_error_code_is_retryable);