MCPcopy Create free account
hub / github.com/MrKepzie/Natron / test_message_count_body

Function test_message_count_body

libs/qhttpserver/http-parser/test.c:3105–3139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3103}
3104
3105void
3106test_message_count_body (const struct message *message)
3107{
3108 parser_init(message->type);
3109
3110 size_t read;
3111 size_t l = strlen(message->raw);
3112 size_t i, toread;
3113 size_t chunk = 4024;
3114
3115 for (i = 0; i < l; i+= chunk) {
3116 toread = MIN(l-i, chunk);
3117 read = parse_count_body(message->raw + i, toread);
3118 if (read != toread) {
3119 print_error(message->raw, read);
3120 abort();
3121 }
3122 }
3123
3124
3125 read = parse_count_body(NULL, 0);
3126 if (read != 0) {
3127 print_error(message->raw, read);
3128 abort();
3129 }
3130
3131 if (num_messages != 1) {
3132 printf("\n*** num_messages != 1 after testing '%s' ***\n\n", message->name);
3133 abort();
3134 }
3135
3136 if(!message_eq(0, message)) abort();
3137
3138 parser_free();
3139}
3140
3141void
3142test_simple (const char *buf, enum http_errno err_expected)

Callers 1

mainFunction · 0.85

Calls 5

parser_initFunction · 0.85
parse_count_bodyFunction · 0.85
print_errorFunction · 0.85
message_eqFunction · 0.85
parser_freeFunction · 0.85

Tested by

no test coverage detected