diff options
author | Jörg Frings-Fürst <debian@jff-webhsoting.net> | 2022-10-29 22:31:53 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhsoting.net> | 2022-10-29 22:31:53 +0200 |
commit | 89fb04a92f080a266c9b509cb522a4b8e8ad92de (patch) | |
tree | 8569378dcf6086eef4af28d270fff284ce3018ad /test/test.cpp | |
parent | 592ab485a70ab4c8e4cefc37bbdfb76110f9205e (diff) |
New upstream version 0.9.7upstream/0.9.7upstream
Diffstat (limited to 'test/test.cpp')
-rw-r--r-- | test/test.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/test.cpp b/test/test.cpp index 31e9866..fade025 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -213,6 +213,18 @@ TEST(UriSuite, TestIpSixPass) { URI_TEST_IP_SIX_PASS("2001:db8:100:f101::1"); URI_TEST_IP_SIX_PASS("a:b:c::12:1"); URI_TEST_IP_SIX_PASS("a:b::0:1:2:3"); + + // Issue #146: These are not leading zeros. + URI_TEST_IP_SIX_PASS("::100.1.1.1"); + URI_TEST_IP_SIX_PASS("::1.100.1.1"); + URI_TEST_IP_SIX_PASS("::1.1.100.1"); + URI_TEST_IP_SIX_PASS("::1.1.1.100"); + URI_TEST_IP_SIX_PASS("::100.100.100.100"); + URI_TEST_IP_SIX_PASS("::10.1.1.1"); + URI_TEST_IP_SIX_PASS("::1.10.1.1"); + URI_TEST_IP_SIX_PASS("::1.1.10.1"); + URI_TEST_IP_SIX_PASS("::1.1.1.10"); + URI_TEST_IP_SIX_PASS("::10.10.10.10"); } TEST(UriSuite, TestIpSixFail) { @@ -259,6 +271,32 @@ TEST(UriSuite, TestIpSixFail) { // Nonhex URI_TEST_IP_SIX_FAIL("g:0:0:0:0:0:0"); + + // Issue #146: Zipper between the 7th and 8th quads. + URI_TEST_IP_SIX_FAIL("0:0:0:0:0:0:0::1"); + + // Issue #146: Leading or trailing ":". + URI_TEST_IP_SIX_FAIL(":1::1"); + URI_TEST_IP_SIX_FAIL("1::1:"); + URI_TEST_IP_SIX_FAIL(":1::1:"); + URI_TEST_IP_SIX_FAIL(":0:0:0:0:0:0:0:0"); + URI_TEST_IP_SIX_FAIL("0:0:0:0:0:0:0:0:"); + URI_TEST_IP_SIX_FAIL(":0:0:0:0:0:0:0:0:"); + + // Issue #146: Zipper between six quads and IPv4 address. + URI_TEST_IP_SIX_FAIL("1:1:1:1:1:1::1.1.1.1"); +} + +TEST(UriSuite, TestIpFuture) { + UriParserStateA stateA; + UriUriA uriA; + stateA.uri = &uriA; + + // Issue #146: The leading "v" of IPvFuture is case-insensitive. + ASSERT_TRUE(0 == uriParseUriA(&stateA, "//[vF.addr]")); + uriFreeUriMembersA(&uriA); + ASSERT_TRUE(0 == uriParseUriA(&stateA, "//[VF.addr]")); + uriFreeUriMembersA(&uriA); } TEST(UriSuite, TestIpSixOverread) { |