From: Timo Sirainen Date: Thu, 15 May 2008 05:31:20 +0000 (+0300) Subject: net_is_in_network(): Added IPv6 unit tests X-Git-Tag: 1.1.rc6~56 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9e8b5c3d0e607a092bbb3dc3b7f21bb04dc4999c;p=thirdparty%2Fdovecot%2Fcore.git net_is_in_network(): Added IPv6 unit tests --HG-- branch : HEAD --- diff --git a/src/tests/test-lib.c b/src/tests/test-lib.c index e8207391fd..8ea637200a 100644 --- a/src/tests/test-lib.c +++ b/src/tests/test-lib.c @@ -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;