nissy-nx

A Rubik's cube optimal solver
git clone https://git.tronto.net/nissy-nx
Download | Log | Files | Refs | README | LICENSE

commit 4da48094d65b4269be7a4d7d2dc9c7d72f2e6869
parent 445364a4b495c275e2723a05e7f4be0090ba5d0a
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date:   Sun,  9 Oct 2022 18:29:00 +0200

Added some failing tests

Diffstat:
Msrc/fst.c | 7+++++--
Mtests/test_fst.c | 19+++++++++++++++----
2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/src/fst.c b/src/fst.c @@ -149,6 +149,9 @@ fst_to_cube(FstCube fst, Cube *cube) coord_eofb.i[0]->to_cube((uint64_t)fst.uf_eofb, cube); coord_coud.i[0]->to_cube((uint64_t)fst.uf_coud, cube); coord_cp.i[0]->to_cube((uint64_t)fst.uf_cp, cube); + + for (i = 0; i < 6; i++) + cube->xp[i] = i; } static int @@ -178,6 +181,8 @@ transform_ep_only(Trans t, int *ep, Cube *dst) void init_fst() { + init_trans(); + init_fst_corner_invtables(); init_fst_eo_invtables(); init_fst_transalg(); @@ -276,8 +281,6 @@ init_fst_where_is_edge() Cube c, d; uint64_t e; - init_trans(); - make_solved(&c); for (e = 0; e < BINOM12ON4 * FACTORIAL4; e++) { coord_eposepe.i[0]->to_cube(e, &c); diff --git a/tests/test_fst.c b/tests/test_fst.c @@ -26,7 +26,17 @@ test_cube_to_fst_to_cube(Cube *c) fst = cube_to_fst(c); fst_to_cube(fst, &d); - return equal(c, &d); + if (!equal(c, &d)) { + printf("Cubes are different:\n\n"); + printf("Cube 1:\n"); + print_cube(c); + printf("\nCube 2:\n"); + print_cube(&d); + printf("\n"); + return false; + } + + return true; } static bool @@ -64,7 +74,8 @@ test_cube_to_fst_to_cube_unsolved() b = test_cube_to_fst_to_cube(&c); free_alg(a); if (!b) { - printf("Failed with alg %s\n", algs[i]); + printf("Cube to FST to cube failed with alg %s\n", + algs[i]); return false; } } @@ -74,7 +85,7 @@ test_cube_to_fst_to_cube_unsolved() void test_fst_all() { int i; - init_fst(); + init_trans(); for (i = 0; test[i] != NULL; i++) { printf("Test: %s\n", name[i]); @@ -82,7 +93,7 @@ void test_fst_all() { printf("Failed!\n"); exit(1); } - printf("Passed.\n"); + printf("Passed.\n\n"); } printf("All FST tests passed.\n\n"); }