tests: Use g_assert_*() rather than g_assert() in notification tests

It won’t get compiled out with `G_DISABLE_ASSERT`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2024-06-14 23:05:25 +01:00
parent 9fa69b3a72
commit 577ad8d07d
No known key found for this signature in database
GPG Key ID: DCDF5885B1F3ED73

View File

@ -71,7 +71,7 @@ notification_received (GNotificationServer *server,
{ {
case 0: case 0:
g_assert_cmpstr (notification_id, ==, "test1"); g_assert_cmpstr (notification_id, ==, "test1");
g_assert (g_variant_lookup (notification, "title", "&s", &title)); g_assert_true (g_variant_lookup (notification, "title", "&s", &title));
g_assert_cmpstr (title, ==, "Test"); g_assert_cmpstr (title, ==, "Test");
break; break;
@ -88,7 +88,7 @@ notification_received (GNotificationServer *server,
break; break;
case 4: case 4:
g_assert (g_dbus_is_guid (notification_id)); g_assert_true (g_dbus_is_guid (notification_id));
g_notification_server_stop (server); g_notification_server_stop (server);
break; break;
@ -210,12 +210,12 @@ test_properties (void)
g_assert_cmpstr (rn->title, ==, "title"); g_assert_cmpstr (rn->title, ==, "title");
g_assert_cmpstr (rn->body, ==, "body"); g_assert_cmpstr (rn->body, ==, "body");
g_assert (G_IS_THEMED_ICON (rn->icon)); g_assert_true (G_IS_THEMED_ICON (rn->icon));
names = g_themed_icon_get_names (G_THEMED_ICON (rn->icon)); names = g_themed_icon_get_names (G_THEMED_ICON (rn->icon));
g_assert_cmpstr (names[0], ==, "i-c-o-n"); g_assert_cmpstr (names[0], ==, "i-c-o-n");
g_assert_cmpstr (names[1], ==, "i-c-o-n-symbolic"); g_assert_cmpstr (names[1], ==, "i-c-o-n-symbolic");
g_assert_null (names[2]); g_assert_null (names[2]);
g_assert (rn->priority == G_NOTIFICATION_PRIORITY_HIGH); g_assert_cmpint (rn->priority, ==, G_NOTIFICATION_PRIORITY_HIGH);
g_assert_cmpstr (rn->category, ==, "cate.gory"); g_assert_cmpstr (rn->category, ==, "cate.gory");
g_assert_cmpint (rn->buttons->len, ==, 1); g_assert_cmpint (rn->buttons->len, ==, 1);