tests: add a few more invalid IPv6 address tests

https://bugzilla.gnome.org/show_bug.cgi?id=701401
This commit is contained in:
Ryan Lortie 2013-06-05 15:51:13 -04:00 committed by Dan Winship
parent 59ed934b05
commit 74a034028a

View File

@ -54,10 +54,20 @@ test_parse (void)
addr = g_inet_address_new_from_string ("::1::2");
g_assert (addr == NULL);
addr = g_inet_address_new_from_string ("2001:1:2:3:4:5:6:7]");
g_assert (addr == NULL);
addr = g_inet_address_new_from_string ("[2001:1:2:3:4:5:6:7");
g_assert (addr == NULL);
addr = g_inet_address_new_from_string ("[2001:1:2:3:4:5:6:7]");
g_assert (addr == NULL);
addr = g_inet_address_new_from_string ("[2001:1:2:3:4:5:6:7]:80");
g_assert (addr == NULL);
addr = g_inet_address_new_from_string ("0:1:2:3:4:5:6:7:8:9");
g_assert (addr == NULL);
addr = g_inet_address_new_from_string ("::FFFFFFF");
g_assert (addr == NULL);
addr = g_inet_address_new_from_string ("204.152.189.116:80");
g_assert (addr != NULL);
}
static void