diff options
Diffstat (limited to 'tests/fst_tests.c')
| -rw-r--r-- | tests/fst_tests.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/fst_tests.c b/tests/fst_tests.c index 14aee1c..493f628 100644 --- a/tests/fst_tests.c +++ b/tests/fst_tests.c | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | #include "fst_tests.h" | 1 | #include "fst_tests.h" |
| 2 | 2 | ||
| 3 | static bool testmethod_fst_is_consistent(void *); | ||
| 4 | static bool testmethod_cube_to_fst_to_cube(void *); | ||
| 5 | static bool testmethod_fst_move(void *); | ||
| 6 | static bool testmethod_fst_inverse(void *); | ||
| 7 | |||
| 3 | static bool check_equal_and_log(Cube *, Cube *); | 8 | static bool check_equal_and_log(Cube *, Cube *); |
| 4 | static void void_to_cube(void *, Cube *); | 9 | static void void_to_cube(void *, Cube *); |
| 5 | 10 | ||
| @@ -18,6 +23,49 @@ char *algs[] = { | |||
| 18 | NULL, | 23 | NULL, |
| 19 | }; | 24 | }; |
| 20 | 25 | ||
| 26 | Test test_fst_is_consistent = { | ||
| 27 | .name = "Consitency of FST (converted from cube)", | ||
| 28 | .t = testmethod_fst_is_consistent, | ||
| 29 | .cases = (void **)algs, | ||
| 30 | }; | ||
| 31 | Test test_cube_to_fst_to_cube = { | ||
| 32 | .name = "Cube to FST to cube", | ||
| 33 | .t = testmethod_cube_to_fst_to_cube, | ||
| 34 | .cases = (void **)algs, | ||
| 35 | }; | ||
| 36 | Test test_fst_move = { | ||
| 37 | .name = "FST move", | ||
| 38 | .t = testmethod_fst_move, | ||
| 39 | .cases = (void **)algs, | ||
| 40 | }; | ||
| 41 | Test test_fst_inverse = { | ||
| 42 | .name = "FST inverse", | ||
| 43 | .t = testmethod_fst_inverse, | ||
| 44 | .cases = (void **)algs, | ||
| 45 | }; | ||
| 46 | |||
| 47 | Test *pre_init[] = { | ||
| 48 | &test_fst_is_consistent, | ||
| 49 | &test_cube_to_fst_to_cube, | ||
| 50 | NULL | ||
| 51 | }; | ||
| 52 | TestSuite fst_pre_init_suite = { | ||
| 53 | .setup = NULL, | ||
| 54 | .tests = pre_init, | ||
| 55 | .teardown = NULL, | ||
| 56 | }; | ||
| 57 | |||
| 58 | Test *post_init[] = { | ||
| 59 | &test_fst_move, | ||
| 60 | &test_fst_inverse, | ||
| 61 | NULL | ||
| 62 | }; | ||
| 63 | TestSuite fst_post_init_suite = { | ||
| 64 | .setup = init_fst, | ||
| 65 | .tests = post_init, | ||
| 66 | .teardown = NULL, | ||
| 67 | }; | ||
| 68 | |||
| 21 | static bool | 69 | static bool |
| 22 | check_equal_and_log(Cube *c, Cube *d) | 70 | check_equal_and_log(Cube *c, Cube *d) |
| 23 | { | 71 | { |
