BAD("://www.example.com/");
/* bad URIs: joining */
- uri = calloc(sizeof(struct evhttp_uri),1);
- uri->host = (char*)"www.example.com";
+ uri = evhttp_uri_new();
+ tt_want(0==evhttp_uri_set_host(uri, "www.example.com"));
tt_want(evhttp_uri_join(uri, url_tmp, sizeof(url_tmp)) != NULL);
/* not enough space: */
tt_want(evhttp_uri_join(uri, url_tmp, 3) == NULL);
/* host is set, but path doesn't start with "/": */
- uri->path = (char*)"hi_mom";
+ tt_want(0==evhttp_uri_set_path(uri, "hi_mom"));
tt_want(evhttp_uri_join(uri, url_tmp, sizeof(url_tmp)) == NULL);
tt_want(evhttp_uri_join(uri, NULL, sizeof(url_tmp))==NULL);
tt_want(evhttp_uri_join(uri, url_tmp, 0)==NULL);
- free(uri);
-
+ evhttp_uri_free(uri);
uri = evhttp_uri_parse("mailto:foo@bar");
tt_want(uri != NULL);
- tt_want(uri->host == NULL);
- tt_want(uri->userinfo == NULL);
- tt_want(uri->port == -1);
- tt_want(!strcmp(uri->scheme, "mailto"));
- tt_want(!strcmp(uri->path, "foo@bar"));
- tt_want(uri->query == NULL);
- tt_want(uri->fragment == NULL);
+ tt_want(evhttp_uri_get_host(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(!strcmp(evhttp_uri_get_scheme(uri), "mailto"));
+ tt_want(!strcmp(evhttp_uri_get_path(uri), "foo@bar"));
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
TT_URI("mailto:foo@bar");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("http://www.test.com/?q=t%33est");
- tt_want(strcmp(uri->scheme, "http") == 0);
- tt_want(strcmp(uri->host, "www.test.com") == 0);
- tt_want(strcmp(uri->path, "/") == 0);
- tt_want(strcmp(uri->query, "q=t%33est") == 0);
- tt_want(uri->userinfo == NULL);
- tt_want(uri->port == -1);
- tt_want(uri->fragment == NULL);
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "www.test.com") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=t%33est") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
TT_URI("http://www.test.com/?q=t%33est");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("http://%77ww.test.com");
- tt_want(strcmp(uri->scheme, "http") == 0);
- tt_want(strcmp(uri->host, "%77ww.test.com") == 0);
- tt_want(strcmp(uri->path, "") == 0);
- tt_want(uri->query == NULL);
- tt_want(uri->userinfo == NULL);
- tt_want(uri->port == -1);
- tt_want(uri->fragment == NULL);
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "%77ww.test.com") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
TT_URI("http://%77ww.test.com");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("http://www.test.com?q=test");
- tt_want(strcmp(uri->scheme, "http") == 0);
- tt_want(strcmp(uri->host, "www.test.com") == 0);
- tt_want(strcmp(uri->path, "") == 0);
- tt_want(strcmp(uri->query, "q=test") == 0);
- tt_want(uri->userinfo == NULL);
- tt_want(uri->port == -1);
- tt_want(uri->fragment == NULL);
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "www.test.com") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=test") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
TT_URI("http://www.test.com?q=test");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("http://www.test.com#fragment");
- tt_want(strcmp(uri->scheme, "http") == 0);
- tt_want(strcmp(uri->host, "www.test.com") == 0);
- tt_want(strcmp(uri->path, "") == 0);
- tt_want(uri->query == NULL);
- tt_want(uri->userinfo == NULL);
- tt_want(uri->port == -1);
- tt_want_str_op(uri->fragment, ==, "fragment");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "www.test.com") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want_str_op(evhttp_uri_get_fragment(uri), ==, "fragment");
TT_URI("http://www.test.com#fragment");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("http://8000/");
- tt_want(strcmp(uri->scheme, "http") == 0);
- tt_want(strcmp(uri->host, "8000") == 0);
- tt_want(strcmp(uri->path, "/") == 0);
- tt_want(uri->query == NULL);
- tt_want(uri->userinfo == NULL);
- tt_want(uri->port == -1);
- tt_want(uri->fragment == NULL);
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "8000") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
TT_URI("http://8000/");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("http://:8000/");
- tt_want(strcmp(uri->scheme, "http") == 0);
- tt_want(strcmp(uri->host, "") == 0);
- tt_want(strcmp(uri->path, "/") == 0);
- tt_want(uri->query == NULL);
- tt_want(uri->userinfo == NULL);
- tt_want(uri->port == 8000);
- tt_want(uri->fragment == NULL);
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == 8000);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
TT_URI("http://:8000/");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("http://www.test.com:/"); /* empty port */
- tt_want(strcmp(uri->scheme, "http") == 0);
- tt_want(strcmp(uri->host, "www.test.com") == 0);
- tt_want_str_op(uri->path, ==, "/");
- tt_want(uri->query == NULL);
- tt_want(uri->userinfo == NULL);
- tt_want(uri->port == -1);
- tt_want(uri->fragment == NULL);
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "www.test.com") == 0);
+ tt_want_str_op(evhttp_uri_get_path(uri), ==, "/");
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
TT_URI("http://www.test.com/");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("http://www.test.com:"); /* empty port 2 */
- tt_want(strcmp(uri->scheme, "http") == 0);
- tt_want(strcmp(uri->host, "www.test.com") == 0);
- tt_want(strcmp(uri->path, "") == 0);
- tt_want(uri->query == NULL);
- tt_want(uri->userinfo == NULL);
- tt_want(uri->port == -1);
- tt_want(uri->fragment == NULL);
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "www.test.com") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
TT_URI("http://www.test.com");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("ftp://www.test.com/?q=test");
- tt_want(strcmp(uri->scheme, "ftp") == 0);
- tt_want(strcmp(uri->host, "www.test.com") == 0);
- tt_want(strcmp(uri->path, "/") == 0);
- tt_want(strcmp(uri->query, "q=test") == 0);
- tt_want(uri->userinfo == NULL);
- tt_want(uri->port == -1);
- tt_want(uri->fragment == NULL);
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "ftp") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "www.test.com") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=test") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
TT_URI("ftp://www.test.com/?q=test");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("ftp://[::1]:999/?q=test");
- tt_want(strcmp(uri->scheme, "ftp") == 0);
- tt_want(strcmp(uri->host, "[::1]") == 0);
- tt_want(strcmp(uri->path, "/") == 0);
- tt_want(strcmp(uri->query, "q=test") == 0);
- tt_want(uri->userinfo == NULL);
- tt_want(uri->port == 999);
- tt_want(uri->fragment == NULL);
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "ftp") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "[::1]") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=test") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == 999);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
TT_URI("ftp://[::1]:999/?q=test");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("ftp://[ff00::127.0.0.1]/?q=test");
- tt_want(strcmp(uri->scheme, "ftp") == 0);
- tt_want(strcmp(uri->host, "[ff00::127.0.0.1]") == 0);
- tt_want(strcmp(uri->path, "/") == 0);
- tt_want(strcmp(uri->query, "q=test") == 0);
- tt_want(uri->userinfo == NULL);
- tt_want(uri->port == -1);
- tt_want(uri->fragment == NULL);
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "ftp") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "[ff00::127.0.0.1]") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=test") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
TT_URI("ftp://[ff00::127.0.0.1]/?q=test");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("ftp://[v99.not_(any:time)_soon]/?q=test");
- tt_want(strcmp(uri->scheme, "ftp") == 0);
- tt_want(strcmp(uri->host, "[v99.not_(any:time)_soon]") == 0);
- tt_want(strcmp(uri->path, "/") == 0);
- tt_want(strcmp(uri->query, "q=test") == 0);
- tt_want(uri->userinfo == NULL);
- tt_want(uri->port == -1);
- tt_want(uri->fragment == NULL);
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "ftp") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "[v99.not_(any:time)_soon]") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=test") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
TT_URI("ftp://[v99.not_(any:time)_soon]/?q=test");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("scheme://user:pass@foo.com:42/?q=test&s=some+thing#fragment");
- tt_want(strcmp(uri->scheme, "scheme") == 0);
- tt_want(strcmp(uri->userinfo, "user:pass") == 0);
- tt_want(strcmp(uri->host, "foo.com") == 0);
- tt_want(uri->port == 42);
- tt_want(strcmp(uri->path, "/") == 0);
- tt_want(strcmp(uri->query, "q=test&s=some+thing") == 0);
- tt_want(strcmp(uri->fragment, "fragment") == 0);
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "scheme") == 0);
+ tt_want(strcmp(evhttp_uri_get_userinfo(uri), "user:pass") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "foo.com") == 0);
+ tt_want(evhttp_uri_get_port(uri) == 42);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=test&s=some+thing") == 0);
+ tt_want(strcmp(evhttp_uri_get_fragment(uri), "fragment") == 0);
TT_URI("scheme://user:pass@foo.com:42/?q=test&s=some+thing#fragment");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("scheme://user@foo.com/#fragment");
- tt_want(strcmp(uri->scheme, "scheme") == 0);
- tt_want(strcmp(uri->userinfo, "user") == 0);
- tt_want(strcmp(uri->host, "foo.com") == 0);
- tt_want(uri->port == -1);
- tt_want(strcmp(uri->path, "/") == 0);
- tt_want(uri->query == NULL);
- tt_want(strcmp(uri->fragment, "fragment") == 0);
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "scheme") == 0);
+ tt_want(strcmp(evhttp_uri_get_userinfo(uri), "user") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "foo.com") == 0);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(strcmp(evhttp_uri_get_fragment(uri), "fragment") == 0);
TT_URI("scheme://user@foo.com/#fragment");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("scheme://%75ser@foo.com/#frag@ment");
- tt_want(strcmp(uri->scheme, "scheme") == 0);
- tt_want(strcmp(uri->userinfo, "%75ser") == 0);
- tt_want(strcmp(uri->host, "foo.com") == 0);
- tt_want(uri->port == -1);
- tt_want(strcmp(uri->path, "/") == 0);
- tt_want(uri->query == NULL);
- tt_want(strcmp(uri->fragment, "frag@ment") == 0);
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "scheme") == 0);
+ tt_want(strcmp(evhttp_uri_get_userinfo(uri), "%75ser") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "foo.com") == 0);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(strcmp(evhttp_uri_get_fragment(uri), "frag@ment") == 0);
TT_URI("scheme://%75ser@foo.com/#frag@ment");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("file:///some/path/to/the/file");
- tt_want(strcmp(uri->scheme, "file") == 0);
- tt_want(uri->userinfo == NULL);
- tt_want(strcmp(uri->host, "") == 0);
- tt_want(uri->port == -1);
- tt_want(strcmp(uri->path, "/some/path/to/the/file") == 0);
- tt_want(uri->query == NULL);
- tt_want(uri->fragment == NULL);
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "file") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "") == 0);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/some/path/to/the/file") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
TT_URI("file:///some/path/to/the/file");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("///some/path/to/the-file");
tt_want(uri != NULL);
- tt_want(uri->scheme == NULL);
- tt_want(uri->userinfo == NULL);
- tt_want(strcmp(uri->host, "") == 0);
- tt_want(uri->port == -1);
- tt_want(strcmp(uri->path, "/some/path/to/the-file") == 0);
- tt_want(uri->query == NULL);
- tt_want(uri->fragment == NULL);
+ tt_want(evhttp_uri_get_scheme(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "") == 0);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/some/path/to/the-file") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
TT_URI("///some/path/to/the-file");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("/s:ome/path/to/the-file?q=99#fred");
tt_want(uri != NULL);
- tt_want(uri->scheme == NULL);
- tt_want(uri->userinfo == NULL);
- tt_want(uri->host == NULL);
- tt_want(uri->port == -1);
- tt_want(strcmp(uri->path, "/s:ome/path/to/the-file") == 0);
- tt_want(strcmp(uri->query, "q=99") == 0);
- tt_want(strcmp(uri->fragment, "fred") == 0);
+ tt_want(evhttp_uri_get_scheme(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_host(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/s:ome/path/to/the-file") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=99") == 0);
+ tt_want(strcmp(evhttp_uri_get_fragment(uri), "fred") == 0);
TT_URI("/s:ome/path/to/the-file?q=99#fred");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("relative/path/with/co:lon");
tt_want(uri != NULL);
- tt_want(uri->scheme == NULL);
- tt_want(uri->userinfo == NULL);
- tt_want(uri->host == NULL);
- tt_want(uri->port == -1);
- tt_want(strcmp(uri->path, "relative/path/with/co:lon") == 0);
- tt_want(uri->query == NULL);
- tt_want(uri->fragment == NULL);
+ tt_want(evhttp_uri_get_scheme(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_host(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "relative/path/with/co:lon") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
TT_URI("relative/path/with/co:lon");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("bob?q=99&q2=q?33#fr?ed");
tt_want(uri != NULL);
- tt_want(uri->scheme == NULL);
- tt_want(uri->userinfo == NULL);
- tt_want(uri->host == NULL);
- tt_want(uri->port == -1);
- tt_want(strcmp(uri->path, "bob") == 0);
- tt_want(strcmp(uri->query, "q=99&q2=q?33") == 0);
- tt_want(strcmp(uri->fragment, "fr?ed") == 0);
+ tt_want(evhttp_uri_get_scheme(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_host(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "bob") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=99&q2=q?33") == 0);
+ tt_want(strcmp(evhttp_uri_get_fragment(uri), "fr?ed") == 0);
TT_URI("bob?q=99&q2=q?33#fr?ed");
evhttp_uri_free(uri);
uri = evhttp_uri_parse("#fr?ed");
tt_want(uri != NULL);
- tt_want(uri->scheme == NULL);
- tt_want(uri->userinfo == NULL);
- tt_want(uri->host == NULL);
- tt_want(uri->port == -1);
- tt_want(strcmp(uri->path, "") == 0);
- tt_want(uri->query == NULL);
- tt_want(strcmp(uri->fragment, "fr?ed") == 0);
+ tt_want(evhttp_uri_get_scheme(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_host(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(strcmp(evhttp_uri_get_fragment(uri), "fr?ed") == 0);
TT_URI("#fr?ed");
evhttp_uri_free(uri);
}