#include #include #include #include START_TEST(test_dir_invert) { fail_unless(dir_invert(DIR_UP) == DIR_DOWN, "Wrong reverse of DIR_UP"); fail_unless(dir_invert(DIR_DOWN) == DIR_UP, "Wrong reverse of DIR_DOWN"); fail_unless(dir_invert(DIR_LEFT) == DIR_RIGHT, "Wrong reverse of DIR_LEFT"); fail_unless(dir_invert(DIR_RIGHT) == DIR_LEFT, "Wrong reverse of DIR_RIGHT"); } END_TEST /* Test suite for "Check" */ Suite *level_suite() { Suite *s = suite_create("level"); TCase *tc_core = tcase_create("Core"); /* Add tests here */ tcase_add_test(tc_core, test_dir_invert); suite_add_tcase(s, tc_core); } int main() { int number_failed; Suite *s = level_suite (); SRunner *sr = srunner_create (s); srunner_run_all (sr, CK_NORMAL); number_failed = srunner_ntests_failed (sr); srunner_free (sr); return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; }