From 0571557ad1a943739806046a24fdaf1e62b32886 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Wed, 1 Feb 2023 18:15:51 +0100 Subject: Enabled make test and test.sh --- tests/fst_tests.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'tests/fst_tests.c') 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 @@ #include "fst_tests.h" +static bool testmethod_fst_is_consistent(void *); +static bool testmethod_cube_to_fst_to_cube(void *); +static bool testmethod_fst_move(void *); +static bool testmethod_fst_inverse(void *); + static bool check_equal_and_log(Cube *, Cube *); static void void_to_cube(void *, Cube *); @@ -18,6 +23,49 @@ char *algs[] = { NULL, }; +Test test_fst_is_consistent = { + .name = "Consitency of FST (converted from cube)", + .t = testmethod_fst_is_consistent, + .cases = (void **)algs, +}; +Test test_cube_to_fst_to_cube = { + .name = "Cube to FST to cube", + .t = testmethod_cube_to_fst_to_cube, + .cases = (void **)algs, +}; +Test test_fst_move = { + .name = "FST move", + .t = testmethod_fst_move, + .cases = (void **)algs, +}; +Test test_fst_inverse = { + .name = "FST inverse", + .t = testmethod_fst_inverse, + .cases = (void **)algs, +}; + +Test *pre_init[] = { + &test_fst_is_consistent, + &test_cube_to_fst_to_cube, + NULL +}; +TestSuite fst_pre_init_suite = { + .setup = NULL, + .tests = pre_init, + .teardown = NULL, +}; + +Test *post_init[] = { + &test_fst_move, + &test_fst_inverse, + NULL +}; +TestSuite fst_post_init_suite = { + .setup = init_fst, + .tests = post_init, + .teardown = NULL, +}; + static bool check_equal_and_log(Cube *c, Cube *d) { -- cgit v1.3