diff options
author | Jörg Frings-Fürst <debian@jff-webhsoting.net> | 2022-10-30 19:35:00 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhsoting.net> | 2022-10-30 19:35:00 +0100 |
commit | 3033986433a2a79a1578d6d424f89e439e0444ef (patch) | |
tree | 1f9a12bfb94f12479d303df186c02fd7236d9b18 /test | |
parent | fda4a6a8635254361196b0497803b7d01514203e (diff) | |
parent | 0feeaa712b06f955dc7b721c81d4133732917cad (diff) |
Merge branch 'release/debian/0.9.7+dfsg-1'debian/0.9.7+dfsg-1
Diffstat (limited to 'test')
-rw-r--r-- | test/VersionSuite.cpp | 2 | ||||
-rw-r--r-- | test/test.cpp | 38 |
2 files changed, 39 insertions, 1 deletions
diff --git a/test/VersionSuite.cpp b/test/VersionSuite.cpp index a46f0d5..01f0284 100644 --- a/test/VersionSuite.cpp +++ b/test/VersionSuite.cpp @@ -23,7 +23,7 @@ #include <cstdio> -#include <config.h> // for PACKAGE_VERSION +#include "UriConfig.h" // for PACKAGE_VERSION #include <uriparser/UriBase.h> 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) { |