From aaeb153ce869567f4f88f083dba28445216714f6 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sun, 22 Jan 2023 00:23:32 +0100 Subject: Started working on testing (broken for now) --- tests/fst_tests.h | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 tests/fst_tests.h (limited to 'tests/fst_tests.h') diff --git a/tests/fst_tests.h b/tests/fst_tests.h new file mode 100644 index 0000000..2e11069 --- /dev/null +++ b/tests/fst_tests.h @@ -0,0 +1,57 @@ +#ifndef FST_TESTS_H +#define FST_TESTS_H + +#include "../src/fst.h" +#include "test.h" + +bool testmethod_fst_is_consistent(void *); +bool testmethod_cube_to_fst_to_cube(void *); +bool testmethod_fst_move(void *); +bool testmethod_fst_inverse(void *); + +extern char *algs[]; + +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, +}; + +#endif -- cgit v1.3