MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / test_parse_url

Function test_parse_url

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

Source from the content-addressed store, hash-verified

2990}
2991
2992void
2993test_parse_url (void)
2994{
2995 struct http_parser_url u;
2996 const struct url_test *test;
2997 unsigned int i;
2998 int rv;
2999
3000 for (i = 0; i < (sizeof(url_tests) / sizeof(url_tests[0])); i++) {
3001 test = &url_tests[i];
3002 memset(&u, 0, sizeof(u));
3003
3004 rv = http_parser_parse_url(test->url,
3005 strlen(test->url),
3006 test->is_connect,
3007 &u);
3008
3009 if (test->rv == 0) {
3010 if (rv != 0) {
3011 printf("\n*** http_parser_parse_url(\"%s\") \"%s\" test failed, "
3012 "unexpected rv %d ***\n\n", test->url, test->name, rv);
3013 abort();
3014 }
3015
3016 if (memcmp(&u, &test->u, sizeof(u)) != 0) {
3017 printf("\n*** http_parser_parse_url(\"%s\") \"%s\" failed ***\n",
3018 test->url, test->name);
3019
3020 printf("target http_parser_url:\n");
3021 dump_url(test->url, &test->u);
3022 printf("result http_parser_url:\n");
3023 dump_url(test->url, &u);
3024
3025 abort();
3026 }
3027 } else {
3028 /* test->rv != 0 */
3029 if (rv == 0) {
3030 printf("\n*** http_parser_parse_url(\"%s\") \"%s\" test failed, "
3031 "unexpected rv %d ***\n\n", test->url, test->name, rv);
3032 abort();
3033 }
3034 }
3035 }
3036}
3037
3038void
3039test_method_str (void)

Callers 1

mainFunction · 0.85

Calls 2

http_parser_parse_urlFunction · 0.85
dump_urlFunction · 0.70

Tested by

no test coverage detected