[glib/wip/hadess/test-fixes: 1/2] tests: Fix incomplete failure check in socket test
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/hadess/test-fixes: 1/2] tests: Fix incomplete failure check in socket test
- Date: Wed, 18 Dec 2019 15:57:32 +0000 (UTC)
commit fd5df1e52abbf83293e38a1374e5308f57b007a0
Author: Bastien Nocera <hadess hadess net>
Date: Mon Dec 2 17:34:03 2019 +0100
tests: Fix incomplete failure check in socket test
For the check "if (error != NULL)" to work as expected, the
create_server() (and create_server_full()) functions need to make
sure to return an error for all the possible failures, but this
might not always be the case.
Catch all the failures by testing for a non-NULL return value if there
was no error.
gio/tests/socket.c | 1 +
1 file changed, 1 insertion(+)
---
diff --git a/gio/tests/socket.c b/gio/tests/socket.c
index f1651972f..aea71dd45 100644
--- a/gio/tests/socket.c
+++ b/gio/tests/socket.c
@@ -342,6 +342,7 @@ test_ip_async (GSocketFamily family)
g_clear_error (&error);
return;
}
+ g_assert_nonnull (data);
addr = g_socket_get_local_address (data->server, &error);
g_assert_no_error (error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]