Commit befc111c authored by Dan Winship's avatar Dan Winship

gio/tests/socket: Update to check the error code

Only treat IPv6 as unsupported if the attempt to create a socket
returns G_IO_ERROR_NOT_SUPPORTED: any other error is a bug.
parent 9fc35dbf
......@@ -1053,18 +1053,24 @@ main (int argc,
char *argv[])
{
GSocket *sock;
GError *error = NULL;
g_test_init (&argc, &argv, NULL);
sock = g_socket_new (G_SOCKET_FAMILY_IPV6,
G_SOCKET_TYPE_STREAM,
G_SOCKET_PROTOCOL_DEFAULT,
NULL);
&error);
if (sock != NULL)
{
ipv6_supported = TRUE;
g_object_unref (sock);
}
else
{
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED);
g_clear_error (&error);
}
g_test_add_func ("/socket/ipv4_sync", test_ipv4_sync);
g_test_add_func ("/socket/ipv4_async", test_ipv4_async);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment