Go to the source code of this file.
Defines | |
#define | abort_on_test_timeout() chk_test_timedout((__FILE__), (__LINE__)) |
#define | chk_easy_init(A, Y, Z) |
#define | chk_easy_setopt(A, B, C, Y, Z) |
#define | chk_global_init(A, Y, Z) |
#define | chk_multi_add_handle(A, B, Y, Z) |
#define | chk_multi_fdset(A, B, C, D, E, Y, Z) |
#define | chk_multi_init(A, Y, Z) |
#define | chk_multi_perform(A, B, Y, Z) |
#define | chk_multi_remove_handle(A, B, Y, Z) |
#define | chk_multi_setopt(A, B, C, Y, Z) |
#define | chk_multi_timeout(A, B, Y, Z) |
#define | chk_select_test(A, B, C, D, E, Y, Z) |
#define | chk_test_timedout(Y, Z) |
#define | CURL_NO_OLDIES |
#define | easy_init(A) chk_easy_init((A), (__FILE__), (__LINE__)) |
#define | easy_setopt(A, B, C) chk_easy_setopt((A), (B), (C), (__FILE__), (__LINE__)) |
#define | exe_easy_init(A, Y, Z) |
#define | exe_easy_setopt(A, B, C, Y, Z) |
#define | exe_global_init(A, Y, Z) |
#define | exe_multi_add_handle(A, B, Y, Z) |
#define | exe_multi_fdset(A, B, C, D, E, Y, Z) |
#define | exe_multi_init(A, Y, Z) |
#define | exe_multi_perform(A, B, Y, Z) |
#define | exe_multi_remove_handle(A, B, Y, Z) |
#define | exe_multi_setopt(A, B, C, Y, Z) |
#define | exe_multi_timeout(A, B, Y, Z) |
#define | exe_select_test(A, B, C, D, E, Y, Z) |
#define | exe_test_timedout(Y, Z) |
#define | global_init(A) chk_global_init((A), (__FILE__), (__LINE__)) |
#define | multi_add_handle(A, B) chk_multi_add_handle((A), (B), (__FILE__), (__LINE__)) |
#define | multi_fdset(A, B, C, D, E) chk_multi_fdset((A), (B), (C), (D), (E), (__FILE__), (__LINE__)) |
#define | multi_init(A) chk_multi_init((A), (__FILE__), (__LINE__)) |
#define | multi_perform(A, B) chk_multi_perform((A), (B), (__FILE__), (__LINE__)) |
#define | multi_remove_handle(A, B) chk_multi_remove_handle((A), (B), (__FILE__), (__LINE__)) |
#define | multi_setopt(A, B, C) chk_multi_setopt((A), (B), (C), (__FILE__), (__LINE__)) |
#define | multi_timeout(A, B) chk_multi_timeout((A), (B), (__FILE__), (__LINE__)) |
#define | res_easy_init(A) exe_easy_init((A), (__FILE__), (__LINE__)) |
#define | res_easy_setopt(A, B, C) exe_easy_setopt((A), (B), (C), (__FILE__), (__LINE__)) |
#define | res_global_init(A) exe_global_init((A), (__FILE__), (__LINE__)) |
#define | res_multi_add_handle(A, B) exe_multi_add_handle((A), (B), (__FILE__), (__LINE__)) |
#define | res_multi_fdset(A, B, C, D, E) exe_multi_fdset((A), (B), (C), (D), (E), (__FILE__), (__LINE__)) |
#define | res_multi_init(A) exe_multi_init((A), (__FILE__), (__LINE__)) |
#define | res_multi_perform(A, B) exe_multi_perform((A), (B), (__FILE__), (__LINE__)) |
#define | res_multi_remove_handle(A, B) exe_multi_remove_handle((A), (B), (__FILE__), (__LINE__)) |
#define | res_multi_setopt(A, B, C) exe_multi_setopt((A), (B), (C), (__FILE__), (__LINE__)) |
#define | res_multi_timeout(A, B) exe_multi_timeout((A), (B), (__FILE__), (__LINE__)) |
#define | res_select_test(A, B, C, D, E) exe_select_test((A), (B), (C), (D), (E), (__FILE__), (__LINE__)) |
#define | res_test_timedout() exe_test_timedout((__FILE__), (__LINE__)) |
#define | select_test(A, B, C, D, E) chk_select_test((A), (B), (C), (D), (E), (__FILE__), (__LINE__)) |
#define | start_test_timing() |
#define | TEST_ERR_BAD_TIMEOUT 115 |
#define | TEST_ERR_EASY_INIT 124 |
#define | TEST_ERR_FAILURE 119 |
#define | TEST_ERR_FOPEN 117 |
#define | TEST_ERR_FSTAT 116 |
#define | TEST_ERR_MAJOR_BAD 126 |
#define | TEST_ERR_MULTI_INIT 123 |
#define | TEST_ERR_NUM_HANDLES 122 |
#define | TEST_ERR_RUNS_FOREVER 125 |
#define | TEST_ERR_SELECT 121 |
#define | TEST_ERR_SUCCESS 120 |
#define | TEST_ERR_USAGE 118 |
#define | test_multi_setopt(A, B, C) if((res = curl_multi_setopt((A), (B), (C))) != CURLE_OK) goto test_cleanup |
#define | test_setopt(A, B, C) if((res = curl_easy_setopt((A), (B), (C))) != CURLE_OK) goto test_cleanup |
Functions | |
char * | hexdump (unsigned char *buffer, size_t len) |
int | select_wrapper (int nfds, fd_set *rd, fd_set *wr, fd_set *exc, struct timeval *tv) |
int | test (char *URL) |
void | wait_ms (int ms) |
Variables | |
char * | libtest_arg2 |
char * | libtest_arg3 |
int | test_argc |
char ** | test_argv |
struct timeval | tv_test_start |
#define abort_on_test_timeout | ( | ) | chk_test_timedout((__FILE__), (__LINE__)) |
#define chk_easy_init | ( | A, | |
Y, | |||
Z | |||
) |
do { \ exe_easy_init((A), (Y), (Z)); \ if(res) \ goto test_cleanup; \ } WHILE_FALSE
#define chk_easy_setopt | ( | A, | |
B, | |||
C, | |||
Y, | |||
Z | |||
) |
do { \ exe_easy_setopt((A), (B), (C), (Y), (Z)); \ if(res) \ goto test_cleanup; \ } WHILE_FALSE
#define chk_global_init | ( | A, | |
Y, | |||
Z | |||
) |
do { \ exe_global_init((A), (Y), (Z)); \ if(res) \ return res; \ } WHILE_FALSE
#define chk_multi_add_handle | ( | A, | |
B, | |||
Y, | |||
Z | |||
) |
do { \ exe_multi_add_handle((A), (B), (Y), (Z)); \ if(res) \ goto test_cleanup; \ } WHILE_FALSE
#define chk_multi_fdset | ( | A, | |
B, | |||
C, | |||
D, | |||
E, | |||
Y, | |||
Z | |||
) |
do { \ exe_multi_fdset((A), (B), (C), (D), (E), (Y), (Z)); \ if(res) \ goto test_cleanup; \ } WHILE_FALSE
#define chk_multi_init | ( | A, | |
Y, | |||
Z | |||
) |
do { \ exe_multi_init((A), (Y), (Z)); \ if(res) \ goto test_cleanup; \ } WHILE_FALSE
#define chk_multi_perform | ( | A, | |
B, | |||
Y, | |||
Z | |||
) |
do { \ exe_multi_perform((A), (B), (Y), (Z)); \ if(res) \ goto test_cleanup; \ } WHILE_FALSE
#define chk_multi_remove_handle | ( | A, | |
B, | |||
Y, | |||
Z | |||
) |
do { \ exe_multi_remove_handle((A), (B), (Y), (Z)); \ if(res) \ goto test_cleanup; \ } WHILE_FALSE
#define chk_multi_setopt | ( | A, | |
B, | |||
C, | |||
Y, | |||
Z | |||
) |
do { \ exe_multi_setopt((A), (B), (C), (Y), (Z)); \ if(res) \ goto test_cleanup; \ } WHILE_FALSE
#define chk_multi_timeout | ( | A, | |
B, | |||
Y, | |||
Z | |||
) |
do { \ exe_multi_timeout((A), (B), (Y), (Z)); \ if(res) \ goto test_cleanup; \ } WHILE_FALSE
#define chk_select_test | ( | A, | |
B, | |||
C, | |||
D, | |||
E, | |||
Y, | |||
Z | |||
) |
do { \ exe_select_test((A), (B), (C), (D), (E), (Y), (Z)); \ if(res) \ goto test_cleanup; \ } WHILE_FALSE
#define chk_test_timedout | ( | Y, | |
Z | |||
) |
do { \ exe_test_timedout(Y, Z); \ if(res) \ goto test_cleanup; \ } WHILE_FALSE
#define CURL_NO_OLDIES |
#define easy_init | ( | A | ) | chk_easy_init((A), (__FILE__), (__LINE__)) |
#define easy_setopt | ( | A, | |
B, | |||
C | |||
) | chk_easy_setopt((A), (B), (C), (__FILE__), (__LINE__)) |
#define exe_easy_init | ( | A, | |
Y, | |||
Z | |||
) |
do { \ if(((A) = curl_easy_init()) == NULL) { \ fprintf(stderr, "%s:%d curl_easy_init() failed\n", (Y), (Z)); \ res = TEST_ERR_EASY_INIT; \ } \ } WHILE_FALSE
#define exe_easy_setopt | ( | A, | |
B, | |||
C, | |||
Y, | |||
Z | |||
) |
do { \ CURLcode ec; \ if((ec = curl_easy_setopt((A), (B), (C))) != CURLE_OK) { \ fprintf(stderr, "%s:%d curl_easy_setopt() failed, " \ "with code %d (%s)\n", \ (Y), (Z), (int)ec, curl_easy_strerror(ec)); \ res = (int)ec; \ } \ } WHILE_FALSE
#define exe_global_init | ( | A, | |
Y, | |||
Z | |||
) |
do { \ CURLcode ec; \ if((ec = curl_global_init((A))) != CURLE_OK) { \ fprintf(stderr, "%s:%d curl_global_init() failed, " \ "with code %d (%s)\n", \ (Y), (Z), (int)ec, curl_easy_strerror(ec)); \ res = (int)ec; \ } \ } WHILE_FALSE
#define exe_multi_add_handle | ( | A, | |
B, | |||
Y, | |||
Z | |||
) |
do { \ CURLMcode ec; \ if((ec = curl_multi_add_handle((A), (B))) != CURLM_OK) { \ fprintf(stderr, "%s:%d curl_multi_add_handle() failed, " \ "with code %d (%s)\n", \ (Y), (Z), (int)ec, curl_multi_strerror(ec)); \ res = (int)ec; \ } \ } WHILE_FALSE
#define exe_multi_fdset | ( | A, | |
B, | |||
C, | |||
D, | |||
E, | |||
Y, | |||
Z | |||
) |
do { \ CURLMcode ec; \ if((ec = curl_multi_fdset((A), (B), (C), (D), (E))) != CURLM_OK) { \ fprintf(stderr, "%s:%d curl_multi_fdset() failed, " \ "with code %d (%s)\n", \ (Y), (Z), (int)ec, curl_multi_strerror(ec)); \ res = (int)ec; \ } \ else if(*((E)) < -1) { \ fprintf(stderr, "%s:%d curl_multi_fdset() succeeded, " \ "but returned invalid max_fd value (%d)\n", \ (Y), (Z), (int)*((E))); \ res = TEST_ERR_NUM_HANDLES; \ } \ } WHILE_FALSE
#define exe_multi_init | ( | A, | |
Y, | |||
Z | |||
) |
do { \ if(((A) = curl_multi_init()) == NULL) { \ fprintf(stderr, "%s:%d curl_multi_init() failed\n", (Y), (Z)); \ res = TEST_ERR_MULTI_INIT; \ } \ } WHILE_FALSE
#define exe_multi_perform | ( | A, | |
B, | |||
Y, | |||
Z | |||
) |
do { \ CURLMcode ec; \ if((ec = curl_multi_perform((A), (B))) != CURLM_OK) { \ fprintf(stderr, "%s:%d curl_multi_perform() failed, " \ "with code %d (%s)\n", \ (Y), (Z), (int)ec, curl_multi_strerror(ec)); \ res = (int)ec; \ } \ else if(*((B)) < 0) { \ fprintf(stderr, "%s:%d curl_multi_perform() succeeded, " \ "but returned invalid running_handles value (%d)\n", \ (Y), (Z), (int)*((B))); \ res = TEST_ERR_NUM_HANDLES; \ } \ } WHILE_FALSE
#define exe_multi_remove_handle | ( | A, | |
B, | |||
Y, | |||
Z | |||
) |
do { \ CURLMcode ec; \ if((ec = curl_multi_remove_handle((A), (B))) != CURLM_OK) { \ fprintf(stderr, "%s:%d curl_multi_remove_handle() failed, " \ "with code %d (%s)\n", \ (Y), (Z), (int)ec, curl_multi_strerror(ec)); \ res = (int)ec; \ } \ } WHILE_FALSE
#define exe_multi_setopt | ( | A, | |
B, | |||
C, | |||
Y, | |||
Z | |||
) |
do { \ CURLMcode ec; \ if((ec = curl_multi_setopt((A), (B), (C))) != CURLM_OK) { \ fprintf(stderr, "%s:%d curl_multi_setopt() failed, " \ "with code %d (%s)\n", \ (Y), (Z), (int)ec, curl_multi_strerror(ec)); \ res = (int)ec; \ } \ } WHILE_FALSE
#define exe_multi_timeout | ( | A, | |
B, | |||
Y, | |||
Z | |||
) |
do { \ CURLMcode ec; \ if((ec = curl_multi_timeout((A), (B))) != CURLM_OK) { \ fprintf(stderr, "%s:%d curl_multi_timeout() failed, " \ "with code %d (%s)\n", \ (Y), (Z), (int)ec, curl_multi_strerror(ec)); \ res = (int)ec; \ } \ else if(*((B)) < -1L) { \ fprintf(stderr, "%s:%d curl_multi_timeout() succeeded, " \ "but returned invalid timeout value (%ld)\n", \ (Y), (Z), (long)*((B))); \ res = TEST_ERR_BAD_TIMEOUT; \ } \ } WHILE_FALSE
#define exe_select_test | ( | A, | |
B, | |||
C, | |||
D, | |||
E, | |||
Y, | |||
Z | |||
) |
do { \ int ec; \ if(select_wrapper((A), (B), (C), (D), (E)) == -1) { \ ec = SOCKERRNO; \ fprintf(stderr, "%s:%d select() failed, with " \ "errno %d (%s)\n", \ (Y), (Z), ec, strerror(ec)); \ res = TEST_ERR_SELECT; \ } \ } WHILE_FALSE
#define exe_test_timedout | ( | Y, | |
Z | |||
) |
do { \ if(tutil_tvdiff(tutil_tvnow(), tv_test_start) > TEST_HANG_TIMEOUT) { \ fprintf(stderr, "%s:%d ABORTING TEST, since it seems " \ "that it would have run forever.\n", (Y), (Z)); \ res = TEST_ERR_RUNS_FOREVER; \ } \ } WHILE_FALSE
#define global_init | ( | A | ) | chk_global_init((A), (__FILE__), (__LINE__)) |
#define multi_add_handle | ( | A, | |
B | |||
) | chk_multi_add_handle((A), (B), (__FILE__), (__LINE__)) |
#define multi_fdset | ( | A, | |
B, | |||
C, | |||
D, | |||
E | |||
) | chk_multi_fdset((A), (B), (C), (D), (E), (__FILE__), (__LINE__)) |
#define multi_init | ( | A | ) | chk_multi_init((A), (__FILE__), (__LINE__)) |
#define multi_perform | ( | A, | |
B | |||
) | chk_multi_perform((A), (B), (__FILE__), (__LINE__)) |
#define multi_remove_handle | ( | A, | |
B | |||
) | chk_multi_remove_handle((A), (B), (__FILE__), (__LINE__)) |
#define multi_setopt | ( | A, | |
B, | |||
C | |||
) | chk_multi_setopt((A), (B), (C), (__FILE__), (__LINE__)) |
#define multi_timeout | ( | A, | |
B | |||
) | chk_multi_timeout((A), (B), (__FILE__), (__LINE__)) |
#define res_easy_init | ( | A | ) | exe_easy_init((A), (__FILE__), (__LINE__)) |
#define res_easy_setopt | ( | A, | |
B, | |||
C | |||
) | exe_easy_setopt((A), (B), (C), (__FILE__), (__LINE__)) |
#define res_global_init | ( | A | ) | exe_global_init((A), (__FILE__), (__LINE__)) |
#define res_multi_add_handle | ( | A, | |
B | |||
) | exe_multi_add_handle((A), (B), (__FILE__), (__LINE__)) |
#define res_multi_fdset | ( | A, | |
B, | |||
C, | |||
D, | |||
E | |||
) | exe_multi_fdset((A), (B), (C), (D), (E), (__FILE__), (__LINE__)) |
#define res_multi_init | ( | A | ) | exe_multi_init((A), (__FILE__), (__LINE__)) |
#define res_multi_perform | ( | A, | |
B | |||
) | exe_multi_perform((A), (B), (__FILE__), (__LINE__)) |
#define res_multi_remove_handle | ( | A, | |
B | |||
) | exe_multi_remove_handle((A), (B), (__FILE__), (__LINE__)) |
#define res_multi_setopt | ( | A, | |
B, | |||
C | |||
) | exe_multi_setopt((A), (B), (C), (__FILE__), (__LINE__)) |
#define res_multi_timeout | ( | A, | |
B | |||
) | exe_multi_timeout((A), (B), (__FILE__), (__LINE__)) |
#define res_select_test | ( | A, | |
B, | |||
C, | |||
D, | |||
E | |||
) | exe_select_test((A), (B), (C), (D), (E), (__FILE__), (__LINE__)) |
#define res_test_timedout | ( | ) | exe_test_timedout((__FILE__), (__LINE__)) |
#define select_test | ( | A, | |
B, | |||
C, | |||
D, | |||
E | |||
) | chk_select_test((A), (B), (C), (D), (E), (__FILE__), (__LINE__)) |
#define start_test_timing | ( | ) |
do { \ tv_test_start = tutil_tvnow(); \ } WHILE_FALSE
#define TEST_ERR_BAD_TIMEOUT 115 |
#define TEST_ERR_EASY_INIT 124 |
#define TEST_ERR_FAILURE 119 |
#define TEST_ERR_FOPEN 117 |
#define TEST_ERR_FSTAT 116 |
#define TEST_ERR_MAJOR_BAD 126 |
#define TEST_ERR_MULTI_INIT 123 |
#define TEST_ERR_NUM_HANDLES 122 |
#define TEST_ERR_RUNS_FOREVER 125 |
#define TEST_ERR_SELECT 121 |
#define TEST_ERR_SUCCESS 120 |
#define TEST_ERR_USAGE 118 |
#define test_multi_setopt | ( | A, | |
B, | |||
C | |||
) | if((res = curl_multi_setopt((A), (B), (C))) != CURLE_OK) goto test_cleanup |
#define test_setopt | ( | A, | |
B, | |||
C | |||
) | if((res = curl_easy_setopt((A), (B), (C))) != CURLE_OK) goto test_cleanup |
int select_wrapper | ( | int | nfds, |
fd_set * | rd, | ||
fd_set * | wr, | ||
fd_set * | exc, | ||
struct timeval * | tv | ||
) |
char* libtest_arg2 |
char* libtest_arg3 |
struct timeval tv_test_start |