summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2017-03-13 23:52:56 +0000
committerVincent Sanders <vince@kyllikki.org>2017-03-13 23:52:56 +0000
commitfcc1a1e4c2bab6373d94ff1f21d1d0f4f137d995 (patch)
treefcd7fce4e3c28228297f67bdca1b8107f31fdffc
parent2406acfeb347da3d4957627cdb70e2583c03aee7 (diff)
downloadnetsurf-fcc1a1e4c2bab6373d94ff1f21d1d0f4f137d995.tar.gz
netsurf-fcc1a1e4c2bab6373d94ff1f21d1d0f4f137d995.tar.bz2
improve numerical ipv6 urldb prefix search test coverage
-rw-r--r--test/urldbtest.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/urldbtest.c b/test/urldbtest.c
index 793b04abb..31cba2e1f 100644
--- a/test/urldbtest.c
+++ b/test/urldbtest.c
@@ -831,6 +831,18 @@ START_TEST(urldb_iterate_partial_numeric_v6_test)
urldb_iterate_entries_cb);
ck_assert_int_eq(cb_count, 1);
+ /* double path separators are ignored */
+ cb_count = 0;
+ urldb_iterate_partial("[2001:db8:1f70::999:de8:7648:6e8]//index.html",
+ urldb_iterate_entries_cb);
+ ck_assert_int_eq(cb_count, 1);
+
+ /* bad ipv6 address inet_pton should fail with this */
+ cb_count = 0;
+ urldb_iterate_partial("[2001::1f70::999::7648:8]",
+ urldb_iterate_entries_cb);
+ ck_assert_int_eq(cb_count, 0);
+
}
END_TEST