[gtk/wip/otte/dnd: 22/22] testsuite: Don't use return_if_fail()



commit 18d7187e4b5ea97546bee6870188fa2dcea7c1de
Author: Benjamin Otte <otte redhat com>
Date:   Sat Feb 22 07:35:23 2020 +0100

    testsuite: Don't use return_if_fail()
    
    Use assert() instead

 testsuite/gtk/treeview.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/testsuite/gtk/treeview.c b/testsuite/gtk/treeview.c
index 016f1a8357..f92f42c7b8 100644
--- a/testsuite/gtk/treeview.c
+++ b/testsuite/gtk/treeview.c
@@ -135,23 +135,23 @@ test_select_collapsed_row (void)
 
   /* Check that the parent is not selected. */
   gtk_tree_path_up (path);
-  g_return_if_fail (gtk_tree_selection_path_is_selected (selection, path) == FALSE);
+  g_assert_false (gtk_tree_selection_path_is_selected (selection, path));
 
   /* Nothing should be selected at this point. */
-  g_return_if_fail (gtk_tree_selection_count_selected_rows (selection) == 0);
+  g_assert_cmpint (gtk_tree_selection_count_selected_rows (selection), ==, 0);
 
   /* Check that selection really still works. */
   gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, NULL, FALSE);
-  g_return_if_fail (gtk_tree_selection_path_is_selected (selection, path) == TRUE);
-  g_return_if_fail (gtk_tree_selection_count_selected_rows (selection) == 1);
+  g_assert_true (gtk_tree_selection_path_is_selected (selection, path));
+  g_assert_cmpint (gtk_tree_selection_count_selected_rows (selection), ==, 1);
 
   /* Expand and select child node now. */
   gtk_tree_path_append_index (path, 1);
   gtk_tree_view_expand_all (GTK_TREE_VIEW (view));
 
   gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, NULL, FALSE);
-  g_return_if_fail (gtk_tree_selection_path_is_selected (selection, path) == TRUE);
-  g_return_if_fail (gtk_tree_selection_count_selected_rows (selection) == 1);
+  g_assert_true (gtk_tree_selection_path_is_selected (selection, path));
+  g_assert_cmpint (gtk_tree_selection_count_selected_rows (selection), ==, 1);
 
   gtk_tree_path_free (path);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]