Defines | Functions | Variables
unit_test.c File Reference
#include "../mongoose.c"
Include dependency graph for unit_test.c:

Go to the source code of this file.

Defines

#define ASSERT(expr)
#define BOUNDARY   "--xyz"
#define CRLF   "\r\n"
#define DISP   "Content-Disposition: form/data; "
#define FAIL(str, line)
#define HTTP_PORT   "45772"
#define LISTENING_ADDR   "127.0.0.1:" HTTP_PORT
#define MONGOOSE_POST_SIZE_LIMIT   999
#define NS_ENABLE_IPV6
#define NS_ENABLE_SSL
#define RUN_TEST(test)

Functions

static int evh1 (struct mg_connection *conn, enum mg_event ev)
static int evh2 (struct mg_connection *conn, enum mg_event ev)
int __cdecl main (void)
static char * read_file (const char *path, int *size)
static const char * run_all_tests (void)
static const char * test_base64_encode (void)
static const char * test_get_var (void)
static const char * test_match_prefix (void)
static const char * test_mg_parse_header (void)
static const char * test_mg_set_option (void)
static const char * test_next_option (void)
static const char * test_parse_http_message ()
static const char * test_parse_multipart (void)
static const char * test_remove_double_dots ()
static const char * test_rewrites (void)
static const char * test_server (void)
static const char * test_should_keep_alive (void)
static const char * test_to64 (void)
static const char * test_url_decode (void)
static const char * test_url_encode (void)

Variables

static int static_num_tests = 0

Define Documentation

#define ASSERT (   expr)
Value:
do {             \
  static_num_tests++;               \
  if (!(expr)) FAIL(#expr, __LINE__); \
} while (0)

Definition at line 19 of file unit_test.c.

#define BOUNDARY   "--xyz"

Definition at line 420 of file unit_test.c.

#define CRLF   "\r\n"

Definition at line 419 of file unit_test.c.

#define DISP   "Content-Disposition: form/data; "

Definition at line 418 of file unit_test.c.

#define FAIL (   str,
  line 
)
Value:
do {                    \
  printf("Fail on line %d: [%s]\n", line, str); \
  return str;                                   \
} while (0)

Definition at line 14 of file unit_test.c.

#define HTTP_PORT   "45772"

Definition at line 27 of file unit_test.c.

#define LISTENING_ADDR   "127.0.0.1:" HTTP_PORT

Definition at line 28 of file unit_test.c.

#define MONGOOSE_POST_SIZE_LIMIT   999

Definition at line 9 of file unit_test.c.

#define NS_ENABLE_IPV6

Definition at line 6 of file unit_test.c.

#define NS_ENABLE_SSL

Definition at line 7 of file unit_test.c.

#define RUN_TEST (   test)
Value:
do { const char *msg = test(); \
  if (msg) return msg; } while (0)

Definition at line 24 of file unit_test.c.


Function Documentation

static int evh1 ( struct mg_connection conn,
enum mg_event  ev 
) [static]

Definition at line 357 of file unit_test.c.

static int evh2 ( struct mg_connection conn,
enum mg_event  ev 
) [static]

Definition at line 453 of file unit_test.c.

int __cdecl main ( void  )

Definition at line 529 of file unit_test.c.

static char* read_file ( const char *  path,
int *  size 
) [static]

Definition at line 80 of file unit_test.c.

static const char* run_all_tests ( void  ) [static]

Definition at line 510 of file unit_test.c.

static const char* test_base64_encode ( void  ) [static]

Definition at line 297 of file unit_test.c.

static const char* test_get_var ( void  ) [static]

Definition at line 225 of file unit_test.c.

static const char* test_match_prefix ( void  ) [static]

Definition at line 168 of file unit_test.c.

static const char* test_mg_parse_header ( void  ) [static]

Definition at line 311 of file unit_test.c.

static const char* test_mg_set_option ( void  ) [static]

Definition at line 481 of file unit_test.c.

static const char* test_next_option ( void  ) [static]

Definition at line 341 of file unit_test.c.

static const char* test_parse_http_message ( ) [static]

Definition at line 93 of file unit_test.c.

static const char* test_parse_multipart ( void  ) [static]

Definition at line 421 of file unit_test.c.

static const char* test_remove_double_dots ( ) [static]

Definition at line 200 of file unit_test.c.

static const char* test_rewrites ( void  ) [static]

Definition at line 489 of file unit_test.c.

static const char* test_server ( void  ) [static]

Definition at line 394 of file unit_test.c.

static const char* test_should_keep_alive ( void  ) [static]

Definition at line 145 of file unit_test.c.

static const char* test_to64 ( void  ) [static]

Definition at line 288 of file unit_test.c.

static const char* test_url_decode ( void  ) [static]

Definition at line 252 of file unit_test.c.

static const char* test_url_encode ( void  ) [static]

Definition at line 277 of file unit_test.c.


Variable Documentation

int static_num_tests = 0 [static]

Definition at line 30 of file unit_test.c.



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