mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-30 19:06:38 +02:00
inet-address: Ignore windows specific failure
In this case getaddrinfo on Windows succeeds at parsing something that fails on Linux.
This commit is contained in:
@@ -53,7 +53,7 @@ test_parse (void)
|
|||||||
addr = g_inet_address_new_from_string ("204.152.189.116");
|
addr = g_inet_address_new_from_string ("204.152.189.116");
|
||||||
g_assert (addr != NULL);
|
g_assert (addr != NULL);
|
||||||
g_object_unref (addr);
|
g_object_unref (addr);
|
||||||
#ifndef G_OS_WIN32
|
#ifndef G_OS_WIN32 /* getaddrinfo on Windows does not support scope-id */
|
||||||
addr = g_inet_address_new_from_string ("::1%0");
|
addr = g_inet_address_new_from_string ("::1%0");
|
||||||
g_assert (addr != NULL);
|
g_assert (addr != NULL);
|
||||||
g_object_unref (addr);
|
g_object_unref (addr);
|
||||||
@@ -65,10 +65,12 @@ test_parse (void)
|
|||||||
g_assert (addr == NULL);
|
g_assert (addr == NULL);
|
||||||
addr = g_inet_address_new_from_string ("[2001:1:2:3:4:5:6:7");
|
addr = g_inet_address_new_from_string ("[2001:1:2:3:4:5:6:7");
|
||||||
g_assert (addr == NULL);
|
g_assert (addr == NULL);
|
||||||
|
#ifndef G_OS_WIN32 /* getaddrinfo on Windows is more forgiving about format and accepts these strings */
|
||||||
addr = g_inet_address_new_from_string ("[2001:1:2:3:4:5:6:7]");
|
addr = g_inet_address_new_from_string ("[2001:1:2:3:4:5:6:7]");
|
||||||
g_assert (addr == NULL);
|
g_assert (addr == NULL);
|
||||||
addr = g_inet_address_new_from_string ("[2001:1:2:3:4:5:6:7]:80");
|
addr = g_inet_address_new_from_string ("[2001:1:2:3:4:5:6:7]:80");
|
||||||
g_assert (addr == NULL);
|
g_assert (addr == NULL);
|
||||||
|
#endif
|
||||||
addr = g_inet_address_new_from_string ("0:1:2:3:4:5:6:7:8:9");
|
addr = g_inet_address_new_from_string ("0:1:2:3:4:5:6:7:8:9");
|
||||||
g_assert (addr == NULL);
|
g_assert (addr == NULL);
|
||||||
addr = g_inet_address_new_from_string ("::FFFFFFF");
|
addr = g_inet_address_new_from_string ("::FFFFFFF");
|
||||||
|
@@ -176,8 +176,13 @@ static ResolveTest address_tests[] = {
|
|||||||
* (just) IP addresses.
|
* (just) IP addresses.
|
||||||
*/
|
*/
|
||||||
{ "192.168.1.2:80", TRUE, FALSE, FALSE },
|
{ "192.168.1.2:80", TRUE, FALSE, FALSE },
|
||||||
|
#ifndef G_OS_WIN32 /* getaddrinfo on Windows is more forgiving about format and accepts these strings */
|
||||||
{ "[fe80::42]", TRUE, FALSE, FALSE },
|
{ "[fe80::42]", TRUE, FALSE, FALSE },
|
||||||
{ "[fe80::42]:80", TRUE, FALSE, FALSE },
|
{ "[fe80::42]:80", TRUE, FALSE, FALSE },
|
||||||
|
#else
|
||||||
|
{ "[fe80::42]", TRUE, TRUE, FALSE },
|
||||||
|
{ "[fe80::42]:80", TRUE, TRUE, FALSE },
|
||||||
|
#endif
|
||||||
|
|
||||||
/* These should not be considered IP addresses by anyone. */
|
/* These should not be considered IP addresses by anyone. */
|
||||||
{ "192.168.258", FALSE, FALSE, FALSE },
|
{ "192.168.258", FALSE, FALSE, FALSE },
|
||||||
|
Reference in New Issue
Block a user