From 76e04a75b16a452c5021d6d1e499a15b44fc586d Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sun, 22 Jan 2023 00:25:47 +0100 Subject: Removed old test files --- tests/fst_post_init_tests.c | 81 --------------------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 tests/fst_post_init_tests.c (limited to 'tests/fst_post_init_tests.c') diff --git a/tests/fst_post_init_tests.c b/tests/fst_post_init_tests.c deleted file mode 100644 index 9d8d554..0000000 --- a/tests/fst_post_init_tests.c +++ /dev/null @@ -1,81 +0,0 @@ -#include "fst_test_util.h" - -static bool fst_move_testcase(Cube *c, Alg *a); -static bool fst_inverse_testcase(Cube *c, Alg *a); - -static bool fst_move_test(); -static bool fst_inverse_test(); - -static Tester test[] = { - fst_move_test, - fst_inverse_test, - NULL -}; - -static char *name[] = { - "FST move", - "FST inverse", -}; - -static bool -fst_move_testcase(Cube *c, Alg *a) -{ - int i; - Cube d; - FstCube fst; - - make_solved(&d); - fst = cube_to_fst(&d); - - for (i = 0; i < a->len; i++) { - if (a->inv[i] || a->move[i] > B3) { - printf("Cannot apply the following alg to FST: "); - print_alg(a, false); - return false; - } - fst = fst_move(a->move[i], fst); - } - - fst_to_cube(fst, &d); - - return equal_and_log(c, &d); -} - -static bool -fst_inverse_testcase(Cube *c, Alg *a) -{ - Cube d; - - fst_to_cube(fst_inverse(cube_to_fst(c)), &d); - invert_cube(c); - - return equal_and_log(c, &d); -} - -static bool -fst_move_test() -{ - return try_all_str(fst_move_testcase, "FST move incorrect"); -} - -static bool -fst_inverse_test() -{ - return try_all_str(fst_inverse_testcase, "FST test incorrect"); -} - -void fst_post_init_testall() { - int i; - - init_fst(); - - for (i = 0; test[i] != NULL; i++) { - printf("Test: %s\n", name[i]); - if (!test[i]()) { - printf("Failed!\n"); - exit(1); - } - printf("Passed.\n\n"); - } - printf("All FST post-init tests passed.\n\n"); -} -- cgit v1.3