mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 07:26:15 +01:00
tests: Add additional URI scope parsing tests
This bumps the coverage of `parse_host()` and `parse_ip_literal()` up to 100% of lines and branches. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
d2f324545b
commit
6762312ff2
@ -701,14 +701,28 @@ static const UriAbsoluteTest absolute_tests[] = {
|
|||||||
{ "http-ish", NULL, "host", -1, "/path", NULL, NULL } },
|
{ "http-ish", NULL, "host", -1, "/path", NULL, NULL } },
|
||||||
|
|
||||||
/* IPv6 scope ID parsing (both correct and incorrect) */
|
/* IPv6 scope ID parsing (both correct and incorrect) */
|
||||||
|
{ "http://[fe80::dead:beef%]/", G_URI_FLAGS_PARSE_RELAXED, FALSE, G_URI_ERROR_BAD_HOST,
|
||||||
|
{ NULL, NULL, NULL, -1, NULL, NULL, NULL } },
|
||||||
{ "http://[fe80::dead:beef%em1]/", G_URI_FLAGS_PARSE_RELAXED, TRUE, 0,
|
{ "http://[fe80::dead:beef%em1]/", G_URI_FLAGS_PARSE_RELAXED, TRUE, 0,
|
||||||
{ "http", NULL, "fe80::dead:beef%em1", -1, "/", NULL, NULL } },
|
{ "http", NULL, "fe80::dead:beef%em1", -1, "/", NULL, NULL } },
|
||||||
|
{ "http://[fe80::dead:beef%em1]/", G_URI_FLAGS_NONE, FALSE, G_URI_ERROR_BAD_HOST,
|
||||||
|
{ NULL, NULL, NULL, -1, NULL, NULL, NULL } },
|
||||||
{ "http://[fe80::dead:beef%25em1]/", G_URI_FLAGS_NONE, TRUE, 0,
|
{ "http://[fe80::dead:beef%25em1]/", G_URI_FLAGS_NONE, TRUE, 0,
|
||||||
{ "http", NULL, "fe80::dead:beef%em1", -1, "/", NULL, NULL } },
|
{ "http", NULL, "fe80::dead:beef%em1", -1, "/", NULL, NULL } },
|
||||||
|
{ "http://[fe80::dead:beef%25em1%20]/", G_URI_FLAGS_NONE, TRUE, 0,
|
||||||
|
{ "http", NULL, "fe80::dead:beef%em1 ", -1, "/", NULL, NULL } },
|
||||||
|
{ "http://[fe80::dead:beef%25em%31]/", G_URI_FLAGS_NONE, TRUE, 0,
|
||||||
|
{ "http", NULL, "fe80::dead:beef%em1", -1, "/", NULL, NULL } },
|
||||||
{ "http://[fe80::dead:beef%10]/", G_URI_FLAGS_PARSE_RELAXED, TRUE, 0,
|
{ "http://[fe80::dead:beef%10]/", G_URI_FLAGS_PARSE_RELAXED, TRUE, 0,
|
||||||
{ "http", NULL, "fe80::dead:beef%10", -1, "/", NULL, NULL } },
|
{ "http", NULL, "fe80::dead:beef%10", -1, "/", NULL, NULL } },
|
||||||
|
{ "http://[fe80::dead:beef%10]/", G_URI_FLAGS_NONE, FALSE, G_URI_ERROR_BAD_HOST,
|
||||||
|
{ NULL, NULL, NULL, -1, NULL, NULL, NULL } },
|
||||||
{ "http://[fe80::dead:beef%25]/", G_URI_FLAGS_PARSE_RELAXED, TRUE, 0,
|
{ "http://[fe80::dead:beef%25]/", G_URI_FLAGS_PARSE_RELAXED, TRUE, 0,
|
||||||
{ "http", NULL, "fe80::dead:beef%25", -1, "/", NULL, NULL } },
|
{ "http", NULL, "fe80::dead:beef%25", -1, "/", NULL, NULL } },
|
||||||
|
{ "http://[fe80::dead:beef%25]/", G_URI_FLAGS_NONE, FALSE, G_URI_ERROR_BAD_HOST,
|
||||||
|
{ NULL, NULL, NULL, -1, NULL, NULL, NULL } },
|
||||||
|
{ "http://[192.168.0.1%25em1]/", G_URI_FLAGS_NONE, FALSE, G_URI_ERROR_BAD_HOST,
|
||||||
|
{ NULL, NULL, NULL, -1, NULL, NULL, NULL } },
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user