[glib: 7/8] tests: Add additional URI scope parsing tests
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 7/8] tests: Add additional URI scope parsing tests
- Date: Thu, 1 Oct 2020 10:14:47 +0000 (UTC)
commit 6762312ff228f405eef20e7c32cd328901118b74
Author: Philip Withnall <pwithnall endlessos org>
Date: Wed Sep 30 19:14:42 2020 +0100
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>
glib/tests/uri.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/glib/tests/uri.c b/glib/tests/uri.c
index 9658138f6..6de4c9cdc 100644
--- a/glib/tests/uri.c
+++ b/glib/tests/uri.c
@@ -701,14 +701,28 @@ static const UriAbsoluteTest absolute_tests[] = {
{ "http-ish", NULL, "host", -1, "/path", NULL, NULL } },
/* 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", 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", 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", 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", 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]