[gtk+] tests: Reset the unnamed counter before a test run



commit 4c0814a1765b7c69a3dc9e5fbde845d16985fd70
Author: Benjamin Otte <otte redhat com>
Date:   Wed Jun 22 04:14:49 2011 +0200

    tests: Reset the unnamed counter before a test run
    
    This guarantees that objects are named the same all the time.

 tests/a11y/accessibility-dump.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/tests/a11y/accessibility-dump.c b/tests/a11y/accessibility-dump.c
index d91df61..3f21523 100644
--- a/tests/a11y/accessibility-dump.c
+++ b/tests/a11y/accessibility-dump.c
@@ -100,7 +100,13 @@ done:
   return diff;
 }
 
-static int unnamed_object_count = 0;
+static int unnamed_object_count;
+
+static void
+setup_test (void)
+{
+  unnamed_object_count = 0;
+}
 
 static const char *
 get_name (AtkObject *accessible)
@@ -727,7 +733,7 @@ add_test_for_file (GFile *file)
   g_test_add_vtable (g_file_get_path (file),
                      0,
                      g_object_ref (file),
-                     NULL,
+                     (GTestFixtureFunc) setup_test,
                      (GTestFixtureFunc) test_ui_file,
                      (GTestFixtureFunc) g_object_unref);
 }



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