aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2022-10-09 18:29:00 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2022-10-09 18:29:00 +0200
commit4da48094d65b4269be7a4d7d2dc9c7d72f2e6869 (patch)
tree4aa75235b1ad0736cf06a120390d2c503c6c39e7
parent445364a4b495c275e2723a05e7f4be0090ba5d0a (diff)
downloadnissy-4da48094d65b4269be7a4d7d2dc9c7d72f2e6869.tar.gz
nissy-4da48094d65b4269be7a4d7d2dc9c7d72f2e6869.zip
Added some failing tests
-rw-r--r--src/fst.c7
-rw-r--r--tests/test_fst.c19
2 files changed, 20 insertions, 6 deletions
diff --git a/src/fst.c b/src/fst.c
index ebd3333..2aa6219 100644
--- a/src/fst.c
+++ b/src/fst.c
@@ -149,6 +149,9 @@ fst_to_cube(FstCube fst, Cube *cube)
149 coord_eofb.i[0]->to_cube((uint64_t)fst.uf_eofb, cube); 149 coord_eofb.i[0]->to_cube((uint64_t)fst.uf_eofb, cube);
150 coord_coud.i[0]->to_cube((uint64_t)fst.uf_coud, cube); 150 coord_coud.i[0]->to_cube((uint64_t)fst.uf_coud, cube);
151 coord_cp.i[0]->to_cube((uint64_t)fst.uf_cp, cube); 151 coord_cp.i[0]->to_cube((uint64_t)fst.uf_cp, cube);
152
153 for (i = 0; i < 6; i++)
154 cube->xp[i] = i;
152} 155}
153 156
154static int 157static int
@@ -178,6 +181,8 @@ transform_ep_only(Trans t, int *ep, Cube *dst)
178void 181void
179init_fst() 182init_fst()
180{ 183{
184 init_trans();
185
181 init_fst_corner_invtables(); 186 init_fst_corner_invtables();
182 init_fst_eo_invtables(); 187 init_fst_eo_invtables();
183 init_fst_transalg(); 188 init_fst_transalg();
@@ -276,8 +281,6 @@ init_fst_where_is_edge()
276 Cube c, d; 281 Cube c, d;
277 uint64_t e; 282 uint64_t e;
278 283
279 init_trans();
280
281 make_solved(&c); 284 make_solved(&c);
282 for (e = 0; e < BINOM12ON4 * FACTORIAL4; e++) { 285 for (e = 0; e < BINOM12ON4 * FACTORIAL4; e++) {
283 coord_eposepe.i[0]->to_cube(e, &c); 286 coord_eposepe.i[0]->to_cube(e, &c);
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