From 4c0814a1765b7c69a3dc9e5fbde845d16985fd70 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 22 Jun 2011 04:14:49 +0200 Subject: [PATCH] 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 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/a11y/accessibility-dump.c b/tests/a11y/accessibility-dump.c index d91df61f94..3f2152384a 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); }