diff --git a/testsuite/gsk/curve-special-cases.c b/testsuite/gsk/curve-special-cases.c index 47ae8d211ae82e1034baee2b8b1835a4d0a370ec..2a249da856b1dd37eb3222195938d6e8c28cc7c2 100644 --- a/testsuite/gsk/curve-special-cases.c +++ b/testsuite/gsk/curve-special-cases.c @@ -97,7 +97,7 @@ pathop_cb (GskPathOperation op, { GskCurve *curve = user_data; - g_assert (op != GSK_PATH_CLOSE); + g_assert_true (op != GSK_PATH_CLOSE); if (op == GSK_PATH_MOVE) return TRUE; diff --git a/testsuite/gsk/gskrendernodeattach.c b/testsuite/gsk/gskrendernodeattach.c index 3abf2fdfe22600358885ecc1788fdca547e8a2a0..c1bfb816d0cd6332153475ab8d85ac1ba6b94a4f 100644 --- a/testsuite/gsk/gskrendernodeattach.c +++ b/testsuite/gsk/gskrendernodeattach.c @@ -190,7 +190,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS { GdkSubsurface *subsurface; - g_assert (gsk_subsurface_node_get_subsurface (node) == NULL); + g_assert_null (gsk_subsurface_node_get_subsurface (node)); if (*idx == -1) subsurface = gdk_surface_create_subsurface (surface); diff --git a/testsuite/gsk/misc.c b/testsuite/gsk/misc.c index 89fa5430a580a92e5684c08ef7fa5acceeb61f80..2038b2cd28b97b54ee6e8c767e682e2a6b96d4e9 100644 --- a/testsuite/gsk/misc.c +++ b/testsuite/gsk/misc.c @@ -157,7 +157,7 @@ test_renderer (GskRenderer *renderer) GdkSurface *surface; GError *error = NULL; - g_assert (GSK_IS_RENDERER (renderer)); + g_assert_true (GSK_IS_RENDERER (renderer)); display = gdk_display_open (NULL); diff --git a/testsuite/gsk/replay-node.c b/testsuite/gsk/replay-node.c index 712abd12ca34e28a0954a3ad089f735100f9706e..4f37658b8d4de8b4dc6948a8b1b045cab16f5584 100644 --- a/testsuite/gsk/replay-node.c +++ b/testsuite/gsk/replay-node.c @@ -539,6 +539,6 @@ replay_node (GskRenderNode *node, GtkSnapshot *snapshot) case GSK_SUBSURFACE_NODE: case GSK_NOT_A_RENDER_NODE: default: - g_assert (FALSE); + g_assert_not_reached (); } } diff --git a/testsuite/gtk/builder.c b/testsuite/gtk/builder.c index 2dfe71a8c26a0e65bda35814075470779b74660c..c7208efe65ee2e494ce9165bb23813713041085c 100644 --- a/testsuite/gtk/builder.c +++ b/testsuite/gtk/builder.c @@ -2924,12 +2924,12 @@ builder_object_get_file_property (GtkBuilder *builder, const gchar *object_id) GObject *obj = gtk_builder_get_object (builder, object_id); GFile *value = NULL; - g_assert (obj); + g_assert_nonnull (obj); - g_object_get(obj, "file", &value, NULL); - g_assert (value); + g_object_get (obj, "file", &value, NULL); + g_assert_nonnull (value); - g_assert (g_type_is_a (G_OBJECT_TYPE (value), G_TYPE_FILE)); + g_assert_true (g_type_is_a (G_OBJECT_TYPE (value), G_TYPE_FILE)); return value; } @@ -2956,24 +2956,24 @@ test_picture (void) file_path = builder_object_get_file_property (builder, "relative_path"); path = g_file_get_path (file_path); - g_assert (path); + g_assert_nonnull (path); /* Check path is absolute */ - g_assert (g_path_is_absolute (path)); + g_assert_true (g_path_is_absolute (path)); /* Check contents can be loaded */ - g_assert (g_file_load_contents (file_path, NULL, &contents, NULL, NULL, NULL)); + g_assert_true (g_file_load_contents (file_path, NULL, &contents, NULL, NULL, NULL)); g_free (contents); file_uri = builder_object_get_file_property (builder, "relative_uri"); uri = g_file_get_uri (file_uri); - g_assert (uri); + g_assert_nonnull (uri); /* Check uri is absolute */ - g_assert (g_str_has_prefix (uri, "file://")); - g_assert (g_path_is_absolute (uri + strlen("file://"))); + g_assert_true (g_str_has_prefix (uri, "file://")); + g_assert_true (g_path_is_absolute (uri + strlen("file://"))); - g_assert (g_file_load_contents (file_uri, NULL, &contents, NULL, NULL, NULL)); + g_assert_true (g_file_load_contents (file_uri, NULL, &contents, NULL, NULL, NULL)); g_free (contents); g_object_unref (builder); diff --git a/testsuite/gtk/maplistmodel.c b/testsuite/gtk/maplistmodel.c index 16604f7ee283e011896fdf5b27abecbfcdb5a73e..a754f4c16e113f64902a6840006a5a7d21157064 100644 --- a/testsuite/gtk/maplistmodel.c +++ b/testsuite/gtk/maplistmodel.c @@ -67,7 +67,7 @@ section_model_to_string (GListModel *model) while (i < g_list_model_get_n_items (model)) { gtk_section_model_get_section (GTK_SECTION_MODEL (model), i, &s, &e); - g_assert (s == i); + g_assert_true (s == i); if (i > 0) g_string_append (string, " "); diff --git a/testsuite/gtk/slicelistmodel.c b/testsuite/gtk/slicelistmodel.c index 15e7757b40814276fd3fcb3d2b9e13654b7e6806..d9d3a780675ff894268593b2bc303a31bb315ab3 100644 --- a/testsuite/gtk/slicelistmodel.c +++ b/testsuite/gtk/slicelistmodel.c @@ -66,7 +66,7 @@ section_model_to_string (GListModel *model) while (i < g_list_model_get_n_items (model)) { gtk_section_model_get_section (GTK_SECTION_MODEL (model), i, &s, &e); - g_assert (s == i); + g_assert_true (s == i); if (i > 0) g_string_append (string, " "); diff --git a/testsuite/gtk/sorter.c b/testsuite/gtk/sorter.c index d878bf62b19df576ccb4438bef743bf9b2238b10..1d0895c7a28fabc589ab9f3852e7076bf93c387b 100644 --- a/testsuite/gtk/sorter.c +++ b/testsuite/gtk/sorter.c @@ -390,7 +390,7 @@ check_ascending (GtkSorter *sorter, gpointer item1 = g_list_model_get_item (model, i); gpointer item2 = g_list_model_get_item (model, i + 1); - g_assert (gtk_sorter_compare (sorter, item1, item2) != GTK_ORDERING_LARGER); + g_assert_true (gtk_sorter_compare (sorter, item1, item2) != GTK_ORDERING_LARGER); g_object_unref (item1); g_object_unref (item2); diff --git a/testsuite/gtk/sortlistmodel.c b/testsuite/gtk/sortlistmodel.c index 42044a0c5fa1b2c1cfb3844d239f94b74f70b8c2..002da5265386160864060da15cebff8c56683f93 100644 --- a/testsuite/gtk/sortlistmodel.c +++ b/testsuite/gtk/sortlistmodel.c @@ -67,7 +67,7 @@ section_model_to_string (GListModel *model) while (i < g_list_model_get_n_items (model)) { gtk_section_model_get_section (GTK_SECTION_MODEL (model), i, &s, &e); - g_assert (s == i); + g_assert_true (s == i); if (i > 0) g_string_append (string, " "); diff --git a/testsuite/reftests/gtk-reftest.c b/testsuite/reftests/gtk-reftest.c index 2ba47a45932e39150065fc70bd46b954c0c87b9f..349dc2be775636b275622528ea92d0bcc70ff81a 100644 --- a/testsuite/reftests/gtk-reftest.c +++ b/testsuite/reftests/gtk-reftest.c @@ -561,15 +561,10 @@ main (int argc, char **argv) /* We need to ensure the process' current working directory * is the same as the reftest data, because we're using the * "file" property of GtkImage as a relative path in builder files. - * - * The g_assert() is needed to ensure GNU libc does not complain - * about the unused return value, and the G_GNUC_UNUSED is needed - * to avoid compiler warnings when g_assert() is compiled out - * during the release build. */ - int res G_GNUC_UNUSED; + int res; res = chdir (basedir); - g_assert (res == 0); + g_assert_true (res == 0); g_log_set_writer_func (log_writer, NULL, NULL);