int i = 0;
/* be helpful and skip initial white space */
- while (*uri == '\v' || g_ascii_isspace (*uri)) uri++;
+ while (*uri == '\v' || g_ascii_isspace (*uri))
+ uri++;
if (g_ascii_isalpha (uri[i])) {
/* find end of scheme name */
eoh = strchr (uri, ']');
if (eoh == NULL || eoh > eoa) {
GST_DEBUG ("Unable to parse the host part of the URI '%s'.",
- orig_uri);
- _gst_uri_free (uri_obj);
+ orig_uri);
+ _gst_uri_free (uri_obj);
return NULL;
}
reoh = eoh + 1;
/* if port number is malformed then we can't parse this */
if (uri[0] != ':' || strspn (uri + 1, "0123456789") != eoa - uri - 1) {
GST_DEBUG ("Unable to parse host/port part of the URI '%s'.",
- orig_uri);
+ orig_uri);
_gst_uri_free (uri_obj);
return NULL;
}
static const struct URITest url_presenting_tests[] = {
/* check all URI elements present */
- { .uri = { "scheme", "user:pass", "host", 1234, "/path/to/dir",
- {{"query", NULL}, {"key", "value"}}, "fragment"},
- .str = "scheme://user:pass@host:1234/path/to/dir?query&key=value#fragment"
- },
+ {.uri = {"scheme", "user:pass", "host", 1234, "/path/to/dir",
+ {{"query", NULL}, {"key", "value"}}, "fragment"},
+ .str =
+ "scheme://user:pass@host:1234/path/to/dir?query&key=value#fragment"},
/* IPv6 literal should render in square brackets */
- { .uri = { "scheme", "user:pass", "12:34:56:78:9a:bc:de:f0", 1234,
- "/path/to/dir", {{"query", "value"}}, "fragment"},
- .str = "scheme://user:pass@[12:34:56:78:9a:bc:de:f0]:1234/path/to/dir?query=value#fragment" },
+ {.uri = {"scheme", "user:pass", "12:34:56:78:9a:bc:de:f0", 1234,
+ "/path/to/dir", {{"query", "value"}}, "fragment"},
+ .str =
+ "scheme://user:pass@[12:34:56:78:9a:bc:de:f0]:1234/path/to/dir?query=value#fragment"},
};
GST_START_TEST (test_url_presenting)
for (i = 0; i < G_N_ELEMENTS (url_presenting_tests); i++) {
uri = gst_uri_new (url_presenting_tests[i].uri.scheme,
- url_presenting_tests[i].uri.userinfo,
- url_presenting_tests[i].uri.host,
- url_presenting_tests[i].uri.port,
- url_presenting_tests[i].uri.path,
- NULL, url_presenting_tests[i].uri.fragment);
+ url_presenting_tests[i].uri.userinfo,
+ url_presenting_tests[i].uri.host,
+ url_presenting_tests[i].uri.port,
+ url_presenting_tests[i].uri.path,
+ NULL, url_presenting_tests[i].uri.fragment);
fail_unless (uri != NULL);
for (j = 0; j < 10; j++) {
if (!url_presenting_tests[i].uri.query[j].key)