[gtk+] Use g_assert_cmpint instead of g_assert in check_level_length()



commit 4f33f10511df846813dcda501fcba534ea4cb176
Author: Kristian Rietveld <kris gtk org>
Date:   Sat May 14 14:45:54 2011 +0200

    Use g_assert_cmpint instead of g_assert in check_level_length()

 gtk/tests/filtermodel.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/gtk/tests/filtermodel.c b/gtk/tests/filtermodel.c
index 6d12cf2..88fe123 100644
--- a/gtk/tests/filtermodel.c
+++ b/gtk/tests/filtermodel.c
@@ -787,24 +787,26 @@ check_filter_model_with_root (FilterTest  *fixture,
 static void
 check_level_length (GtkTreeModelFilter *filter,
                     const gchar        *level,
-                    const int           length)
+                    const int           expected_length)
 {
   if (!level)
     {
-      int l = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (filter), NULL);
-      g_return_if_fail (l == length);
+      int model_length;
+
+      model_length = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (filter), NULL);
+      g_assert_cmpint (model_length, ==, expected_length);
     }
   else
     {
-      int l;
+      int model_length;
       gboolean retrieved_iter = FALSE;
       GtkTreeIter iter;
 
       retrieved_iter = gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (filter),
                                                             &iter, level);
       g_return_if_fail (retrieved_iter);
-      l = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (filter), &iter);
-      g_return_if_fail (l == length);
+      model_length = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (filter), &iter);
+      g_assert_cmpint (model_length, ==, expected_length);
     }
 }
 



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