]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
net_is_in_network(): Added IPv6 unit tests
authorTimo Sirainen <tss@iki.fi>
Thu, 15 May 2008 05:31:20 +0000 (08:31 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 15 May 2008 05:31:20 +0000 (08:31 +0300)
--HG--
branch : HEAD

src/tests/test-lib.c

index e8207391fdaf4cc47812b55e83318ccd167fa6f4..8ea637200a930ea854d4fb1dc1130d49664c4335 100644 (file)
@@ -388,7 +388,15 @@ static void test_net_is_in_network(void)
                { "1.2.3.255", "1.2.3.254", 31, TRUE },
                { "1.2.3.255", "1.2.3.0", 24, TRUE },
                { "1.2.255.255", "1.2.254.0", 23, TRUE },
-               { "255.255.255.255", "128.0.0.0", 1, TRUE }
+               { "255.255.255.255", "128.0.0.0", 1, TRUE },
+               { "255.255.255.255", "127.0.0.0", 1, FALSE }
+#ifdef HAVE_IPV6
+               ,
+               { "1234:5678::abcf", "1234:5678::abce", 127, TRUE },
+               { "1234:5678::abcd", "1234:5678::abce", 127, FALSE },
+               { "123e::ffff", "123e::0", 15, TRUE },
+               { "123d::ffff", "123e::0", 15, FALSE }
+#endif
        };
        struct ip_addr ip, net_ip;
        unsigned int i;