Use g_assert_cmpint instead of g_assert in check_level_length()

This commit is contained in:
Kristian Rietveld 2011-05-14 14:45:54 +02:00
parent 7b3c2751ee
commit 4f33f10511

View File

@ -787,24 +787,26 @@ check_filter_model_with_root (FilterTest *fixture,
static void static void
check_level_length (GtkTreeModelFilter *filter, check_level_length (GtkTreeModelFilter *filter,
const gchar *level, const gchar *level,
const int length) const int expected_length)
{ {
if (!level) if (!level)
{ {
int l = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (filter), NULL); int model_length;
g_return_if_fail (l == length);
model_length = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (filter), NULL);
g_assert_cmpint (model_length, ==, expected_length);
} }
else else
{ {
int l; int model_length;
gboolean retrieved_iter = FALSE; gboolean retrieved_iter = FALSE;
GtkTreeIter iter; GtkTreeIter iter;
retrieved_iter = gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (filter), retrieved_iter = gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (filter),
&iter, level); &iter, level);
g_return_if_fail (retrieved_iter); g_return_if_fail (retrieved_iter);
l = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (filter), &iter); model_length = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (filter), &iter);
g_return_if_fail (l == length); g_assert_cmpint (model_length, ==, expected_length);
} }
} }