nissy-core

The "engine" of nissy, including the H48 optimal solver.
git clone https://git.tronto.net/nissy-core
Download | Log | Files | Refs | README | LICENSE

commit 086a06fe3d84ac8b2e74c824e05f9d23f0b292ab
parent 0c5e4730c699ac006feec4efe25c390977fe372f
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date:   Mon, 22 Dec 2025 18:07:06 +0100

Added tests for copy_co, renamed some tests

Diffstat:
Atest/076_copy_co/00_solved_solved.in | 2++
Rtest/078_invcoord_esep/00_solved.in -> test/076_copy_co/00_solved_solved.out | 0
Atest/076_copy_co/01_solved_scrambled.in | 4++++
Atest/076_copy_co/01_solved_scrambled.out | 1+
Atest/076_copy_co/02_scrambled_scrambled.in | 4++++
Atest/076_copy_co/02_scrambled_scrambled.out | 1+
Atest/076_copy_co/copy_co_tests.c | 34++++++++++++++++++++++++++++++++++
Rtest/076_copy_corners/00_solved_scrambled.in -> test/077_copy_corners/00_solved_scrambled.in | 0
Rtest/076_copy_corners/00_solved_scrambled.out -> test/077_copy_corners/00_solved_scrambled.out | 0
Rtest/076_copy_corners/copy_corners_tests.c -> test/077_copy_corners/copy_corners_tests.c | 0
Rtest/077_copy_edges/00_solved_scrambled.in -> test/078_copy_edges/00_solved_scrambled.in | 0
Rtest/077_copy_edges/00_solved_scrambled.out -> test/078_copy_edges/00_solved_scrambled.out | 0
Rtest/077_copy_edges/copy_edges_tests.c -> test/078_copy_edges/copy_edges_tests.c | 0
Rtest/078_invcoord_esep/00_solved.in -> test/080_invcoord_esep/00_solved.in | 0
Rtest/078_invcoord_esep/00_solved.out -> test/080_invcoord_esep/00_solved.out | 0
Rtest/078_invcoord_esep/01_U.in -> test/080_invcoord_esep/01_U.in | 0
Rtest/078_invcoord_esep/01_U.out -> test/080_invcoord_esep/01_U.out | 0
Rtest/078_invcoord_esep/02_U2.in -> test/080_invcoord_esep/02_U2.in | 0
Rtest/078_invcoord_esep/02_U2.out -> test/080_invcoord_esep/02_U2.out | 0
Rtest/078_invcoord_esep/20_scrambled.in -> test/080_invcoord_esep/20_scrambled.in | 0
Rtest/078_invcoord_esep/20_scrambled.out -> test/080_invcoord_esep/20_scrambled.out | 0
Rtest/078_invcoord_esep/21_swapaxis_FB.in -> test/080_invcoord_esep/21_swapaxis_FB.in | 0
Rtest/078_invcoord_esep/21_swapaxis_FB.out -> test/080_invcoord_esep/21_swapaxis_FB.out | 0
Rtest/078_invcoord_esep/22_swapaxis_RL.in -> test/080_invcoord_esep/22_swapaxis_RL.in | 0
Rtest/078_invcoord_esep/22_swapaxis_RL.out -> test/080_invcoord_esep/22_swapaxis_RL.out | 0
Rtest/078_invcoord_esep/23_swapaxis_UD.in -> test/080_invcoord_esep/23_swapaxis_UD.in | 0
Rtest/078_invcoord_esep/23_swapaxis_UD.out -> test/080_invcoord_esep/23_swapaxis_UD.out | 0
Rtest/078_invcoord_esep/invcoord_esep_tests.c -> test/080_invcoord_esep/invcoord_esep_tests.c | 0
Rtest/079_invcoord_co/00_all.in -> test/081_invcoord_co/00_all.in | 0
Rtest/079_invcoord_co/00_all.out -> test/081_invcoord_co/00_all.out | 0
Rtest/079_invcoord_co/invcoord_co_tests.c -> test/081_invcoord_co/invcoord_co_tests.c | 0
Rtest/080_invcoord_cp/00_all.in -> test/082_invcoord_cp/00_all.in | 0
Rtest/080_invcoord_cp/00_all.out -> test/082_invcoord_cp/00_all.out | 0
Rtest/080_invcoord_cp/invcoord_cp_tests.c -> test/082_invcoord_cp/invcoord_cp_tests.c | 0
Rtest/081_invcoord_epud/00_all.in -> test/083_invcoord_epud/00_all.in | 0
Rtest/081_invcoord_epud/00_all.out -> test/083_invcoord_epud/00_all.out | 0
Rtest/081_invcoord_epud/invcoord_epud_tests.c -> test/083_invcoord_epud/invcoord_epud_tests.c | 0
Rtest/082_invcoord_epe/00_all.in -> test/084_invcoord_epe/00_all.in | 0
Rtest/082_invcoord_epe/00_all.out -> test/084_invcoord_epe/00_all.out | 0
Rtest/082_invcoord_epe/invcoord_epe_tests.c -> test/084_invcoord_epe/invcoord_epe_tests.c | 0
Rtest/083_invcoord_epudsep/00_all.in -> test/085_invcoord_epudsep/00_all.in | 0
Rtest/083_invcoord_epudsep/00_all.out -> test/085_invcoord_epudsep/00_all.out | 0
Rtest/083_invcoord_epudsep/invcoord_epudsep_tests.c -> test/085_invcoord_epudsep/invcoord_epudsep_tests.c | 0
43 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/test/076_copy_co/00_solved_solved.in b/test/076_copy_co/00_solved_solved.in @@ -0,0 +1,2 @@ +ABCDEFGH=ABCDEFGHIJKL=A +ABCDEFGH=ABCDEFGHIJKL=A diff --git a/test/078_invcoord_esep/00_solved.in b/test/076_copy_co/00_solved_solved.out diff --git a/test/076_copy_co/01_solved_scrambled.in b/test/076_copy_co/01_solved_scrambled.in @@ -0,0 +1,4 @@ +ABCDEFGH=ABCDEFGHIJKL=A +CILVXGMR=FKbGIDSXBJAU=A + +// Scramble: U R D' L D' F L2 D L F B D2 B' L2 F U2 L2 D2 R2 L2 B' diff --git a/test/076_copy_co/01_solved_scrambled.out b/test/076_copy_co/01_solved_scrambled.out @@ -0,0 +1 @@ +AJKTUFOX=ABCDEFGHIJKL=A diff --git a/test/076_copy_co/02_scrambled_scrambled.in b/test/076_copy_co/02_scrambled_scrambled.in @@ -0,0 +1,4 @@ +ICLMVGRX=FIJDAXKGbBUS=A +CILVXGMR=FKbGIDSXBJAU=A + +// Scramble: U R D' L D' F L2 D L F B D2 B' L2 F U2 L2 D2 R2 L2 B' diff --git a/test/076_copy_co/02_scrambled_scrambled.out b/test/076_copy_co/02_scrambled_scrambled.out @@ -0,0 +1 @@ +AKLUVGJX=FIJDAXKGbBUS=A diff --git a/test/076_copy_co/copy_co_tests.c b/test/076_copy_co/copy_co_tests.c @@ -0,0 +1,34 @@ +#include "../test.h" + +void copy_co(cube_t *, cube_t); +void pieces(cube_t *, uint8_t [static 8], uint8_t [static 12]); + +void run(void) { + char str[STRLENMAX]; + oriented_cube_t cube1, cube2; + uint8_t edge[12], corner[8]; + + fgets(str, STRLENMAX, stdin); + cube1 = readcube(str); + fgets(str, STRLENMAX, stdin); + cube2 = readcube(str); + + copy_co(&cube1.cube, cube2.cube); + + if (iserror(cube1)) { + printf("Error copying CO\n"); + } else if (!isconsistent(cube2)) { + pieces(&cube1.cube, corner, edge); + fprintf(stderr, "edges: "); + for (int i = 0; i < 12; i++) + fprintf(stderr, "%d ", edge[i]); + fprintf(stderr, "\n"); + for (int i = 0; i < 8; i++) + fprintf(stderr, "%d ", corner[i]); + fprintf(stderr, "\n"); + printf("Setting CO resulted in inconsistent cube\n"); + } else { + writecube(cube1, NISSY_SIZE_CUBE, str); + printf("%s\n", str); + } +} diff --git a/test/076_copy_corners/00_solved_scrambled.in b/test/077_copy_corners/00_solved_scrambled.in diff --git a/test/076_copy_corners/00_solved_scrambled.out b/test/077_copy_corners/00_solved_scrambled.out diff --git a/test/076_copy_corners/copy_corners_tests.c b/test/077_copy_corners/copy_corners_tests.c diff --git a/test/077_copy_edges/00_solved_scrambled.in b/test/078_copy_edges/00_solved_scrambled.in diff --git a/test/077_copy_edges/00_solved_scrambled.out b/test/078_copy_edges/00_solved_scrambled.out diff --git a/test/077_copy_edges/copy_edges_tests.c b/test/078_copy_edges/copy_edges_tests.c diff --git a/test/078_invcoord_esep/00_solved.in b/test/080_invcoord_esep/00_solved.in diff --git a/test/078_invcoord_esep/00_solved.out b/test/080_invcoord_esep/00_solved.out diff --git a/test/078_invcoord_esep/01_U.in b/test/080_invcoord_esep/01_U.in diff --git a/test/078_invcoord_esep/01_U.out b/test/080_invcoord_esep/01_U.out diff --git a/test/078_invcoord_esep/02_U2.in b/test/080_invcoord_esep/02_U2.in diff --git a/test/078_invcoord_esep/02_U2.out b/test/080_invcoord_esep/02_U2.out diff --git a/test/078_invcoord_esep/20_scrambled.in b/test/080_invcoord_esep/20_scrambled.in diff --git a/test/078_invcoord_esep/20_scrambled.out b/test/080_invcoord_esep/20_scrambled.out diff --git a/test/078_invcoord_esep/21_swapaxis_FB.in b/test/080_invcoord_esep/21_swapaxis_FB.in diff --git a/test/078_invcoord_esep/21_swapaxis_FB.out b/test/080_invcoord_esep/21_swapaxis_FB.out diff --git a/test/078_invcoord_esep/22_swapaxis_RL.in b/test/080_invcoord_esep/22_swapaxis_RL.in diff --git a/test/078_invcoord_esep/22_swapaxis_RL.out b/test/080_invcoord_esep/22_swapaxis_RL.out diff --git a/test/078_invcoord_esep/23_swapaxis_UD.in b/test/080_invcoord_esep/23_swapaxis_UD.in diff --git a/test/078_invcoord_esep/23_swapaxis_UD.out b/test/080_invcoord_esep/23_swapaxis_UD.out diff --git a/test/078_invcoord_esep/invcoord_esep_tests.c b/test/080_invcoord_esep/invcoord_esep_tests.c diff --git a/test/079_invcoord_co/00_all.in b/test/081_invcoord_co/00_all.in diff --git a/test/079_invcoord_co/00_all.out b/test/081_invcoord_co/00_all.out diff --git a/test/079_invcoord_co/invcoord_co_tests.c b/test/081_invcoord_co/invcoord_co_tests.c diff --git a/test/080_invcoord_cp/00_all.in b/test/082_invcoord_cp/00_all.in diff --git a/test/080_invcoord_cp/00_all.out b/test/082_invcoord_cp/00_all.out diff --git a/test/080_invcoord_cp/invcoord_cp_tests.c b/test/082_invcoord_cp/invcoord_cp_tests.c diff --git a/test/081_invcoord_epud/00_all.in b/test/083_invcoord_epud/00_all.in diff --git a/test/081_invcoord_epud/00_all.out b/test/083_invcoord_epud/00_all.out diff --git a/test/081_invcoord_epud/invcoord_epud_tests.c b/test/083_invcoord_epud/invcoord_epud_tests.c diff --git a/test/082_invcoord_epe/00_all.in b/test/084_invcoord_epe/00_all.in diff --git a/test/082_invcoord_epe/00_all.out b/test/084_invcoord_epe/00_all.out diff --git a/test/082_invcoord_epe/invcoord_epe_tests.c b/test/084_invcoord_epe/invcoord_epe_tests.c diff --git a/test/083_invcoord_epudsep/00_all.in b/test/085_invcoord_epudsep/00_all.in diff --git a/test/083_invcoord_epudsep/00_all.out b/test/085_invcoord_epudsep/00_all.out diff --git a/test/083_invcoord_epudsep/invcoord_epudsep_tests.c b/test/085_invcoord_epudsep/invcoord_epudsep_tests.c