Commit 0cf441eb authored by Simon McVittie's avatar Simon McVittie
Browse files

test: Replace g_assert (x == NULL) with g_assert_null (x)



Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
parent c93990ce
......@@ -69,7 +69,7 @@ new_conn_cb (DBusServer *server,
{
Fixture *f = data;
g_assert (f->server_conn == NULL);
g_assert_null (f->server_conn);
f->server_conn = dbus_connection_ref (server_conn);
dbus_connection_setup_with_g_main (server_conn, NULL);
f->server_gconn = dbus_connection_get_g_connection (server_conn);
......@@ -100,7 +100,7 @@ setup (Fixture *f,
new_conn_cb, f, NULL);
dbus_server_setup_with_g_main (f->server, NULL);
g_assert (f->server_conn == NULL);
g_assert_null (f->server_conn);
f->client_conn = dbus_connection_open_private (
dbus_server_get_address (f->server), &f->e);
......@@ -187,7 +187,7 @@ test_disconnect (Fixture *f,
fail = dbus_g_proxy_begin_call (f->proxy, "DoNothing", call_cb, f, NULL,
G_TYPE_INVALID);
g_assert (fail == NULL);
g_assert_null (fail);
ok = dbus_g_proxy_end_call (f->proxy, fail, &error,
G_TYPE_INVALID);
......
......@@ -127,7 +127,7 @@ test_lookup (Fixture *f,
g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") ==
f->object);
/* this was briefly broken while fixing fd.o#5688 */
g_assert (dbus_g_connection_lookup_g_object (f->bus, "/bar") == NULL);
g_assert_null (dbus_g_connection_lookup_g_object (f->bus, "/bar"));
}
static void
......@@ -141,7 +141,7 @@ test_unregister (Fixture *f,
g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") ==
f->object);
dbus_g_connection_unregister_g_object (f->bus, f->object);
g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") == NULL);
g_assert_null (dbus_g_connection_lookup_g_object (f->bus, "/foo"));
}
static void
......@@ -160,9 +160,9 @@ test_unregister_on_last_unref (Fixture *f,
g_object_unref (f->object);
f->object = NULL;
g_assert (weak_pointer == NULL);
g_assert_null (weak_pointer);
g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") == NULL);
g_assert_null (dbus_g_connection_lookup_g_object (f->bus, "/foo"));
}
static void
......@@ -176,7 +176,7 @@ test_unregister_on_forced_dispose (Fixture *f,
* this at home) */
g_object_run_dispose (f->object);
g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") == NULL);
g_assert_null (dbus_g_connection_lookup_g_object (f->bus, "/foo"));
}
static void
......@@ -198,7 +198,7 @@ test_reregister (Fixture *f,
/* This would critical in 0.84. */
dbus_g_connection_unregister_g_object (f->bus, f->object);
g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") == NULL);
g_assert_null (dbus_g_connection_lookup_g_object (f->bus, "/foo"));
}
static DBusHandlerResult
......@@ -222,7 +222,7 @@ frobnicate_cb (DBusConnection *conn,
g_assert_cmpstr (sender, ==, dbus_bus_get_unique_name (
dbus_g_connection_get_connection (f->bus)));
g_assert (f->frobnicate1_message == NULL);
g_assert_null (f->frobnicate1_message);
f->frobnicate1_message = dbus_message_ref (message);
}
else
......@@ -231,7 +231,7 @@ frobnicate_cb (DBusConnection *conn,
g_assert_cmpstr (sender, ==, dbus_bus_get_unique_name (
dbus_g_connection_get_connection (f->bus2)));
g_assert (f->frobnicate2_message == NULL);
g_assert_null (f->frobnicate2_message);
f->frobnicate2_message = dbus_message_ref (message);
}
}
......@@ -283,7 +283,7 @@ test_twice (Fixture *f,
while (f->frobnicate2_message == NULL)
g_main_context_iteration (NULL, TRUE);
g_assert (f->frobnicate1_message == NULL);
g_assert_null (f->frobnicate1_message);
dbus_message_unref (f->frobnicate2_message);
f->frobnicate2_message = NULL;
}
......@@ -345,7 +345,7 @@ test_clean_slate (Fixture *f,
/* check that this wasn't received anyway, which would indicate that
* either unregistration from /foo was unsuccessful, or the double
* emission mentioned above was seen */
g_assert (f->frobnicate1_message == NULL);
g_assert_null (f->frobnicate1_message);
dbus_message_unref (f->frobnicate2_message);
f->frobnicate2_message = NULL;
......
......@@ -273,7 +273,7 @@ echo_received_cb (DBusGProxy *proxy,
char *echo_data;
g_assert (call == echo_call);
g_assert (data == NULL);
g_assert_null (data);
error = NULL;
echo_data = NULL;
......@@ -604,7 +604,7 @@ main (int argc, char **argv)
g_print (" %s\n", name_list[i]);
++i;
}
g_assert (name_list[i] == NULL);
g_assert_null (name_list[i]);
g_strfreev (name_list);
......@@ -2278,7 +2278,7 @@ main (int argc, char **argv)
/* Now, call disable_legacy_property_access */
g_assert (proxy == NULL);
g_assert_null (proxy);
proxy = dbus_g_proxy_new_for_name_owner (connection,
"org.freedesktop.DBus.GLib.TestService",
"/org/freedesktop/DBus/GLib/Tests/MyTestObject",
......
Supports Markdown
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