summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher James Halse Rogers <chris@Burninator.(none)>2007-06-26 11:59:29 +1000
committerChristopher James Halse Rogers <chris@Burninator.(none)>2007-06-26 11:59:29 +1000
commitf952189170ba78df51206a2184dc032af0db8dc3 (patch)
tree2594b769c792a5e514b32acdbdcef0d0f59f0c26
parent773d44ecbc0dd5953b6941e366074cccaaa5cf25 (diff)
downloadradial-switcher-f952189170ba78df51206a2184dc032af0db8dc3.tar.gz
radial-switcher-f952189170ba78df51206a2184dc032af0db8dc3.tar.bz2
Add test for adding multiple (different) windows to a tree
-rw-r--r--tests/check_switcher-util.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/check_switcher-util.c b/tests/check_switcher-util.c
index 7d01c3f..0a122a3 100644
--- a/tests/check_switcher-util.c
+++ b/tests/check_switcher-util.c
@@ -100,6 +100,26 @@ START_TEST (test_addToTree)
}
END_TEST
+START_TEST (test_addMultipleToFlatTree)
+{
+ CompWindow *array[500];
+ int i;
+
+ for (i = 0; i < 500; ++i)
+ array[i] = (CompWindow *)i;
+
+ for (i = 0; i < 500; ++i)
+ fail_unless (addWindowToTree (tree, array[i], &testCompare),
+ "addWindowToTree returned FALSE");
+
+ for (i = 0; i < 500; ++i)
+ fail_unless (tree->windows->w[i] == (CompWindow *)i,
+ "Incorrect window inserted in tree");
+
+ fail_unless(tree->windows->nWindows == 500,
+ "Number of windows not updated correctly");
+}
+END_TEST
Suite *
switcher_util_suite (void)
@@ -124,6 +144,7 @@ switcher_util_suite (void)
TCase *tc_addToTree = tcase_create ("Add To Tree");
tcase_add_checked_fixture (tc_addToTree, setup, teardown);
tcase_add_test (tc_addToTree, test_addToTree);
+ tcase_add_test (tc_addToTree, test_addMultipleToFlatTree);
suite_add_tcase (s, tc_addToTree);
return s;