summaryrefslogtreecommitdiff
path: root/gio
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-03-21 16:57:56 -0400
committerDan Winship <danw@gnome.org>2014-03-30 11:06:35 -0400
commitbefc111c435be63bdc6a2d59204f697d26688369 (patch)
tree440b515563ea4c72a41e408afb99797300d1075e /gio
parent9fc35dbfb6b804c0ead5dd3dba1bbf14773a2f8f (diff)
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.
Diffstat (limited to 'gio')
-rw-r--r--gio/tests/socket.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gio/tests/socket.c b/gio/tests/socket.c
index 362a1f2ea..5cc8ee606 100644
--- a/gio/tests/socket.c
+++ b/gio/tests/socket.c
@@ -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);