diff options
author | Simon McVittie <smcv@collabora.com> | 2021-03-26 11:15:41 +0000 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2021-03-26 12:00:29 +0000 |
commit | c93990ce8ef79e569e7d70b5ed6c29090bb33b5c (patch) | |
tree | caa44ab5ce783d3749ce9166b560249aafe2bdc5 /test/core/proxy-peer.c | |
parent | 06a7fac32cfcd6c42fd6541a4d7770dc65588f68 (diff) | |
download | dbus-glib-c93990ce8ef79e569e7d70b5ed6c29090bb33b5c.tar.gz |
test: Replace all g_assert (x != NULL) with g_assert_nonnull (x)
This avoids the assertions being removed by G_DISABLE_ASSERT, and gives
somewhat better diagnostic messages if the assertion fails.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'test/core/proxy-peer.c')
-rw-r--r-- | test/core/proxy-peer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/core/proxy-peer.c b/test/core/proxy-peer.c index b225d94..6cead4e 100644 --- a/test/core/proxy-peer.c +++ b/test/core/proxy-peer.c @@ -94,7 +94,7 @@ setup (Fixture *f, f->server = dbus_server_listen (addr, &f->e); assert_no_error (&f->e); - g_assert (f->server != NULL); + g_assert_nonnull (f->server); dbus_server_set_new_connection_function (f->server, new_conn_cb, f, NULL); @@ -105,7 +105,7 @@ setup (Fixture *f, f->client_conn = dbus_connection_open_private ( dbus_server_get_address (f->server), &f->e); assert_no_error (&f->e); - g_assert (f->client_conn != NULL); + g_assert_nonnull (f->client_conn); dbus_connection_setup_with_g_main (f->client_conn, NULL); f->client_gconn = dbus_connection_get_g_connection (f->client_conn); @@ -123,7 +123,7 @@ setup (Fixture *f, f->proxy = dbus_g_proxy_new_for_peer (f->client_gconn, "/org/freedesktop/DBus/GLib/Tests/MyTestObject", "org.freedesktop.DBus.GLib.Tests.MyObject"); - g_assert (f->proxy != NULL); + g_assert_nonnull (f->proxy); g_assert (DBUS_IS_G_PROXY (f->proxy)); g_signal_connect (f->proxy, "destroy", G_CALLBACK (destroy_cb), f); @@ -155,7 +155,7 @@ test_method (Fixture *f, call = dbus_g_proxy_begin_call (f->proxy, "DoNothing", call_cb, f, NULL, G_TYPE_INVALID); - g_assert (call != NULL); + g_assert_nonnull (call); g_hash_table_insert (f->in_flight, call, call); while (g_hash_table_size (f->in_flight) > 0) |