aboutsummaryrefslogtreecommitdiff
path: root/tests/test_fst.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_fst.c')
-rw-r--r--tests/test_fst.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/test_fst.c b/tests/test_fst.c
index fc1185c..5f48f6c 100644
--- a/tests/test_fst.c
+++ b/tests/test_fst.c
@@ -26,7 +26,17 @@ test_cube_to_fst_to_cube(Cube *c)
26 fst = cube_to_fst(c); 26 fst = cube_to_fst(c);
27 fst_to_cube(fst, &d); 27 fst_to_cube(fst, &d);
28 28
29 return equal(c, &d); 29 if (!equal(c, &d)) {
30 printf("Cubes are different:\n\n");
31 printf("Cube 1:\n");
32 print_cube(c);
33 printf("\nCube 2:\n");
34 print_cube(&d);
35 printf("\n");
36 return false;
37 }
38
39 return true;
30} 40}
31 41
32static bool 42static bool
@@ -64,7 +74,8 @@ test_cube_to_fst_to_cube_unsolved()
64 b = test_cube_to_fst_to_cube(&c); 74 b = test_cube_to_fst_to_cube(&c);
65 free_alg(a); 75 free_alg(a);
66 if (!b) { 76 if (!b) {
67 printf("Failed with alg %s\n", algs[i]); 77 printf("Cube to FST to cube failed with alg %s\n",
78 algs[i]);
68 return false; 79 return false;
69 } 80 }
70 } 81 }
@@ -74,7 +85,7 @@ test_cube_to_fst_to_cube_unsolved()
74void test_fst_all() { 85void test_fst_all() {
75 int i; 86 int i;
76 87
77 init_fst(); 88 init_trans();
78 89
79 for (i = 0; test[i] != NULL; i++) { 90 for (i = 0; test[i] != NULL; i++) {
80 printf("Test: %s\n", name[i]); 91 printf("Test: %s\n", name[i]);
@@ -82,7 +93,7 @@ void test_fst_all() {
82 printf("Failed!\n"); 93 printf("Failed!\n");
83 exit(1); 94 exit(1);
84 } 95 }
85 printf("Passed.\n"); 96 printf("Passed.\n\n");
86 } 97 }
87 printf("All FST tests passed.\n\n"); 98 printf("All FST tests passed.\n\n");
88} 99}

Generated with cgit - Back to sebastiano.tronto.net