mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
gio/tests: Add a non-NULL assertion to help static analysis
The static analyser (correctly) considers a type check to fail if the variable is NULL. In this case, the address must be non-NULL as no error was thrown by g_socket_connection_get_remote_address(), but the static analyser doesn’t know this. Add a non-NULL assertion anyway, both to shut the analyser up, and because it’s good extra testing. Found by scan-build. https://bugzilla.gnome.org/show_bug.cgi?id=113075
This commit is contained in:
parent
c9ccc2af91
commit
32118951ea
@ -889,7 +889,7 @@ assert_direct (GSocketConnection *conn)
|
||||
|
||||
addr = g_socket_connection_get_remote_address (conn, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (!G_IS_PROXY_ADDRESS (addr));
|
||||
g_assert (addr != NULL && !G_IS_PROXY_ADDRESS (addr));
|
||||
g_object_unref (addr);
|
||||
|
||||
addr = g_socket_connection_get_local_address (conn, &error);
|
||||
|
Loading…
Reference in New Issue
Block a user