]> Pileus Git - ~andy/gtk/commitdiff
tests: Relax a refcount comparison check
authorBenjamin Otte <otte@redhat.com>
Fri, 16 Dec 2011 12:38:06 +0000 (13:38 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 16 Dec 2011 12:39:43 +0000 (13:39 +0100)
We now test for real_refcount >= expected_refcount, because various
parts of the code (a11y, selection, cursor, ...) can and do add
references.

gtk/tests/gtktreemodelrefcount.c

index 9c91a587da6b663ff6972c3e0b2a6ab8f04cf85d..2097efb8e163f1091962f0e220ddf5ff219b9046 100644 (file)
@@ -239,7 +239,12 @@ check_iter (GtkTreeModelRefCount *ref_model,
     }
 
   if (may_assert)
-    g_assert_cmpint (expected_ref_count, ==, info->ref_count);
+    {
+      if (expected_ref_count == 0)
+        g_assert_cmpint (expected_ref_count, ==, info->ref_count);
+      else
+        g_assert_cmpint (expected_ref_count, <=, info->ref_count);
+    }
 
   return expected_ref_count == info->ref_count;
 }