From 148ce781baa3798014e18bf05c65ed501a893ab3 Mon Sep 17 00:00:00 2001 From: Christopher James Halse Rogers Date: Mon, 25 Jun 2007 16:50:59 +1000 Subject: Fix tests, now that I know how setup/teardown works --- tests/check_switcher-util.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/check_switcher-util.c b/tests/check_switcher-util.c index e37f8e4..2fbe0dd 100644 --- a/tests/check_switcher-util.c +++ b/tests/check_switcher-util.c @@ -11,6 +11,20 @@ WindowList *list; CompWindow *a, *b, *c, *d; +void setup () +{ + list = newWindowList (); + tree = newWindowTree (); + a = 0x5; + b = 0x4; + c = 0x4; + d = 0x4; +} + +void teardown () +{ +} + static Bool testCompare (CompWindow *a, CompWindow *b) { printf("In testCompare\n"); @@ -42,8 +56,6 @@ END_TEST START_TEST (test_addToList) { - list = newWindowList (); - fail_unless (addWindowToList (list, a), "addWindowToList returned FALSE"); @@ -82,6 +94,7 @@ switcher_util_suite (void) /* Add windows to tree test cases */ TCase *tc_addToList = tcase_create ("Add To List"); + tcase_add_checked_fixture (tc_addToList, setup, teardown); tcase_add_test (tc_addToList, test_addToList); suite_add_tcase (s, tc_addToList); -- cgit v1.1