Defines | Functions | Variables
test.h File Reference
#include "curl_setup.h"
#include <curl/curl.h>
#include "curl_printf.h"
Include dependency graph for test.h:

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 Documentation

#define abort_on_test_timeout ( )    chk_test_timedout((__FILE__), (__LINE__))

Definition at line 404 of file test.h.

#define chk_easy_init (   A,
  Y,
 
)
Value:
do { \
  exe_easy_init((A), (Y), (Z));   \
  if(res)                         \
    goto test_cleanup;            \
} WHILE_FALSE

Definition at line 139 of file test.h.

#define chk_easy_setopt (   A,
  B,
  C,
  Y,
 
)
Value:
do { \
  exe_easy_setopt((A), (B), (C), (Y), (Z)); \
  if(res)                                   \
    goto test_cleanup;                      \
} WHILE_FALSE

Definition at line 184 of file test.h.

#define chk_global_init (   A,
  Y,
 
)
Value:
do { \
    exe_global_init((A), (Y), (Z));   \
    if(res)                           \
      return res;                     \
  } WHILE_FALSE

Definition at line 422 of file test.h.

#define chk_multi_add_handle (   A,
  B,
  Y,
 
)
Value:
do { \
  exe_multi_add_handle((A), (B), (Y), (Z));   \
  if(res)                                     \
    goto test_cleanup;                        \
} WHILE_FALSE

Definition at line 232 of file test.h.

#define chk_multi_fdset (   A,
  B,
  C,
  D,
  E,
  Y,
 
)
Value:
do {       \
    exe_multi_fdset((A), (B), (C), (D), (E), (Y), (Z)); \
    if(res)                                             \
      goto test_cleanup;                                \
  } WHILE_FALSE

Definition at line 317 of file test.h.

#define chk_multi_init (   A,
  Y,
 
)
Value:
do { \
  exe_multi_init((A), (Y), (Z));   \
  if(res)                          \
    goto test_cleanup;             \
} WHILE_FALSE

Definition at line 160 of file test.h.

#define chk_multi_perform (   A,
  B,
  Y,
 
)
Value:
do { \
  exe_multi_perform((A), (B), (Y), (Z));   \
  if(res)                                  \
    goto test_cleanup;                     \
} WHILE_FALSE

Definition at line 287 of file test.h.

#define chk_multi_remove_handle (   A,
  B,
  Y,
 
)
Value:
do { \
  exe_multi_remove_handle((A), (B), (Y), (Z));   \
  if(res)                                        \
    goto test_cleanup;                           \
} WHILE_FALSE

Definition at line 256 of file test.h.

#define chk_multi_setopt (   A,
  B,
  C,
  Y,
 
)
Value:
do {     \
  exe_multi_setopt((A), (B), (C), (Y), (Z)); \
  if(res)                                    \
    goto test_cleanup;                       \
} WHILE_FALSE

Definition at line 208 of file test.h.

#define chk_multi_timeout (   A,
  B,
  Y,
 
)
Value:
do { \
    exe_multi_timeout((A), (B), (Y), (Z)); \
    if(res)                                \
      goto test_cleanup;                   \
  } WHILE_FALSE

Definition at line 347 of file test.h.

#define chk_select_test (   A,
  B,
  C,
  D,
  E,
  Y,
 
)
Value:
do {       \
    exe_select_test((A), (B), (C), (D), (E), (Y), (Z)); \
    if(res)                                             \
      goto test_cleanup;                                \
  } WHILE_FALSE

Definition at line 372 of file test.h.

#define chk_test_timedout (   Y,
 
)
Value:
do { \
    exe_test_timedout(Y, Z);         \
    if(res)                          \
      goto test_cleanup;             \
  } WHILE_FALSE

Definition at line 398 of file test.h.

#define CURL_NO_OLDIES

Definition at line 30 of file test.h.

#define easy_init (   A)    chk_easy_init((A), (__FILE__), (__LINE__))

Definition at line 145 of file test.h.

#define easy_setopt (   A,
  B,
 
)    chk_easy_setopt((A), (B), (C), (__FILE__), (__LINE__))

Definition at line 190 of file test.h.

#define exe_easy_init (   A,
  Y,
 
)
Value:
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

Definition at line 129 of file test.h.

#define exe_easy_setopt (   A,
  B,
  C,
  Y,
 
)
Value:
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

Definition at line 171 of file test.h.

#define exe_global_init (   A,
  Y,
 
)
Value:
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

Definition at line 409 of file test.h.

#define exe_multi_add_handle (   A,
  B,
  Y,
 
)
Value:
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

Definition at line 219 of file test.h.

#define exe_multi_fdset (   A,
  B,
  C,
  D,
  E,
  Y,
 
)
Value:
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

Definition at line 298 of file test.h.

#define exe_multi_init (   A,
  Y,
 
)
Value:
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

Definition at line 150 of file test.h.

#define exe_multi_perform (   A,
  B,
  Y,
 
)
Value:
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

Definition at line 268 of file test.h.

#define exe_multi_remove_handle (   A,
  B,
  Y,
 
)
Value:
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

Definition at line 243 of file test.h.

#define exe_multi_setopt (   A,
  B,
  C,
  Y,
 
)
Value:
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

Definition at line 195 of file test.h.

#define exe_multi_timeout (   A,
  B,
  Y,
 
)
Value:
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

Definition at line 328 of file test.h.

#define exe_select_test (   A,
  B,
  C,
  D,
  E,
  Y,
 
)
Value:
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

Definition at line 358 of file test.h.

#define exe_test_timedout (   Y,
 
)
Value:
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

Definition at line 387 of file test.h.

#define global_init (   A)    chk_global_init((A), (__FILE__), (__LINE__))

Definition at line 431 of file test.h.

#define multi_add_handle (   A,
 
)    chk_multi_add_handle((A), (B), (__FILE__), (__LINE__))

Definition at line 238 of file test.h.

#define multi_fdset (   A,
  B,
  C,
  D,
 
)    chk_multi_fdset((A), (B), (C), (D), (E), (__FILE__), (__LINE__))

Definition at line 323 of file test.h.

#define multi_init (   A)    chk_multi_init((A), (__FILE__), (__LINE__))

Definition at line 166 of file test.h.

#define multi_perform (   A,
 
)    chk_multi_perform((A), (B), (__FILE__), (__LINE__))

Definition at line 293 of file test.h.

#define multi_remove_handle (   A,
 
)    chk_multi_remove_handle((A), (B), (__FILE__), (__LINE__))

Definition at line 263 of file test.h.

#define multi_setopt (   A,
  B,
 
)    chk_multi_setopt((A), (B), (C), (__FILE__), (__LINE__))

Definition at line 214 of file test.h.

#define multi_timeout (   A,
 
)    chk_multi_timeout((A), (B), (__FILE__), (__LINE__))

Definition at line 353 of file test.h.

#define res_easy_init (   A)    exe_easy_init((A), (__FILE__), (__LINE__))

Definition at line 136 of file test.h.

#define res_easy_setopt (   A,
  B,
 
)    exe_easy_setopt((A), (B), (C), (__FILE__), (__LINE__))

Definition at line 181 of file test.h.

#define res_global_init (   A)    exe_global_init((A), (__FILE__), (__LINE__))

Definition at line 419 of file test.h.

#define res_multi_add_handle (   A,
 
)    exe_multi_add_handle((A), (B), (__FILE__), (__LINE__))

Definition at line 229 of file test.h.

#define res_multi_fdset (   A,
  B,
  C,
  D,
 
)    exe_multi_fdset((A), (B), (C), (D), (E), (__FILE__), (__LINE__))

Definition at line 314 of file test.h.

#define res_multi_init (   A)    exe_multi_init((A), (__FILE__), (__LINE__))

Definition at line 157 of file test.h.

#define res_multi_perform (   A,
 
)    exe_multi_perform((A), (B), (__FILE__), (__LINE__))

Definition at line 284 of file test.h.

#define res_multi_remove_handle (   A,
 
)    exe_multi_remove_handle((A), (B), (__FILE__), (__LINE__))

Definition at line 253 of file test.h.

#define res_multi_setopt (   A,
  B,
 
)    exe_multi_setopt((A), (B), (C), (__FILE__), (__LINE__))

Definition at line 205 of file test.h.

#define res_multi_timeout (   A,
 
)    exe_multi_timeout((A), (B), (__FILE__), (__LINE__))

Definition at line 344 of file test.h.

#define res_select_test (   A,
  B,
  C,
  D,
 
)    exe_select_test((A), (B), (C), (D), (E), (__FILE__), (__LINE__))

Definition at line 369 of file test.h.

#define res_test_timedout ( )    exe_test_timedout((__FILE__), (__LINE__))

Definition at line 395 of file test.h.

#define select_test (   A,
  B,
  C,
  D,
 
)    chk_select_test((A), (B), (C), (D), (E), (__FILE__), (__LINE__))

Definition at line 378 of file test.h.

#define start_test_timing ( )
Value:
do { \
  tv_test_start = tutil_tvnow(); \
} WHILE_FALSE

Definition at line 383 of file test.h.

#define TEST_ERR_BAD_TIMEOUT   115

Definition at line 96 of file test.h.

#define TEST_ERR_EASY_INIT   124

Definition at line 87 of file test.h.

#define TEST_ERR_FAILURE   119

Definition at line 92 of file test.h.

#define TEST_ERR_FOPEN   117

Definition at line 94 of file test.h.

#define TEST_ERR_FSTAT   116

Definition at line 95 of file test.h.

#define TEST_ERR_MAJOR_BAD   126

Definition at line 85 of file test.h.

#define TEST_ERR_MULTI_INIT   123

Definition at line 88 of file test.h.

#define TEST_ERR_NUM_HANDLES   122

Definition at line 89 of file test.h.

#define TEST_ERR_RUNS_FOREVER   125

Definition at line 86 of file test.h.

#define TEST_ERR_SELECT   121

Definition at line 90 of file test.h.

#define TEST_ERR_SUCCESS   120

Definition at line 91 of file test.h.

#define TEST_ERR_USAGE   118

Definition at line 93 of file test.h.

#define test_multi_setopt (   A,
  B,
 
)    if((res = curl_multi_setopt((A), (B), (C))) != CURLE_OK) goto test_cleanup

Definition at line 50 of file test.h.

#define test_setopt (   A,
  B,
 
)    if((res = curl_easy_setopt((A), (B), (C))) != CURLE_OK) goto test_cleanup

Definition at line 47 of file test.h.


Function Documentation

char* hexdump ( unsigned char *  buffer,
size_t  len 
)

Definition at line 119 of file first.c.

int select_wrapper ( int  nfds,
fd_set *  rd,
fd_set *  wr,
fd_set *  exc,
struct timeval tv 
)

Definition at line 45 of file first.c.

int test ( char *  URL)

Definition at line 30 of file lib1500.c.

void wait_ms ( int  ms)

Definition at line 66 of file first.c.


Variable Documentation

char* libtest_arg2

Definition at line 75 of file first.c.

char* libtest_arg3

Definition at line 76 of file first.c.

int test_argc

Definition at line 77 of file first.c.

char** test_argv

Definition at line 78 of file first.c.

Definition at line 80 of file first.c.



rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:09