[gtk+] tests: Relax a refcount comparison check



commit e104219ab18f4293e3614599bc5d6a31e19a3db4
Author: Benjamin Otte <otte redhat com>
Date:   Fri Dec 16 13:38:06 2011 +0100

    tests: Relax a refcount comparison check
    
    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 |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/tests/gtktreemodelrefcount.c b/gtk/tests/gtktreemodelrefcount.c
index 9c91a58..2097efb 100644
--- a/gtk/tests/gtktreemodelrefcount.c
+++ b/gtk/tests/gtktreemodelrefcount.c
@@ -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;
 }



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