From 086a06fe3d84ac8b2e74c824e05f9d23f0b292ab Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 22 Dec 2025 18:07:06 +0100 Subject: Added tests for copy_co, renamed some tests --- test/076_copy_co/00_solved_solved.in | 2 ++ test/076_copy_co/00_solved_solved.out | 1 + test/076_copy_co/01_solved_scrambled.in | 4 +++ test/076_copy_co/01_solved_scrambled.out | 1 + test/076_copy_co/02_scrambled_scrambled.in | 4 +++ test/076_copy_co/02_scrambled_scrambled.out | 1 + test/076_copy_co/copy_co_tests.c | 34 ++++++++++++++++++++ test/076_copy_corners/00_solved_scrambled.in | 2 -- test/076_copy_corners/00_solved_scrambled.out | 1 - test/076_copy_corners/copy_corners_tests.c | 25 --------------- test/077_copy_corners/00_solved_scrambled.in | 2 ++ test/077_copy_corners/00_solved_scrambled.out | 1 + test/077_copy_corners/copy_corners_tests.c | 25 +++++++++++++++ test/077_copy_edges/00_solved_scrambled.in | 2 -- test/077_copy_edges/00_solved_scrambled.out | 1 - test/077_copy_edges/copy_edges_tests.c | 25 --------------- test/078_copy_edges/00_solved_scrambled.in | 2 ++ test/078_copy_edges/00_solved_scrambled.out | 1 + test/078_copy_edges/copy_edges_tests.c | 25 +++++++++++++++ test/078_invcoord_esep/00_solved.in | 1 - test/078_invcoord_esep/00_solved.out | 1 - test/078_invcoord_esep/01_U.in | 1 - test/078_invcoord_esep/01_U.out | 1 - test/078_invcoord_esep/02_U2.in | 1 - test/078_invcoord_esep/02_U2.out | 1 - test/078_invcoord_esep/20_scrambled.in | 3 -- test/078_invcoord_esep/20_scrambled.out | 1 - test/078_invcoord_esep/21_swapaxis_FB.in | 1 - test/078_invcoord_esep/21_swapaxis_FB.out | 1 - test/078_invcoord_esep/22_swapaxis_RL.in | 1 - test/078_invcoord_esep/22_swapaxis_RL.out | 1 - test/078_invcoord_esep/23_swapaxis_UD.in | 1 - test/078_invcoord_esep/23_swapaxis_UD.out | 1 - test/078_invcoord_esep/invcoord_esep_tests.c | 19 ------------ test/079_invcoord_co/00_all.in | 0 test/079_invcoord_co/00_all.out | 1 - test/079_invcoord_co/invcoord_co_tests.c | 36 ---------------------- test/080_invcoord_cp/00_all.in | 0 test/080_invcoord_cp/00_all.out | 1 - test/080_invcoord_cp/invcoord_cp_tests.c | 32 ------------------- test/080_invcoord_esep/00_solved.in | 1 + test/080_invcoord_esep/00_solved.out | 1 + test/080_invcoord_esep/01_U.in | 1 + test/080_invcoord_esep/01_U.out | 1 + test/080_invcoord_esep/02_U2.in | 1 + test/080_invcoord_esep/02_U2.out | 1 + test/080_invcoord_esep/20_scrambled.in | 3 ++ test/080_invcoord_esep/20_scrambled.out | 1 + test/080_invcoord_esep/21_swapaxis_FB.in | 1 + test/080_invcoord_esep/21_swapaxis_FB.out | 1 + test/080_invcoord_esep/22_swapaxis_RL.in | 1 + test/080_invcoord_esep/22_swapaxis_RL.out | 1 + test/080_invcoord_esep/23_swapaxis_UD.in | 1 + test/080_invcoord_esep/23_swapaxis_UD.out | 1 + test/080_invcoord_esep/invcoord_esep_tests.c | 19 ++++++++++++ test/081_invcoord_co/00_all.in | 0 test/081_invcoord_co/00_all.out | 1 + test/081_invcoord_co/invcoord_co_tests.c | 36 ++++++++++++++++++++++ test/081_invcoord_epud/00_all.in | 0 test/081_invcoord_epud/00_all.out | 1 - test/081_invcoord_epud/invcoord_epud_tests.c | 32 ------------------- test/082_invcoord_cp/00_all.in | 0 test/082_invcoord_cp/00_all.out | 1 + test/082_invcoord_cp/invcoord_cp_tests.c | 32 +++++++++++++++++++ test/082_invcoord_epe/00_all.in | 0 test/082_invcoord_epe/00_all.out | 1 - test/082_invcoord_epe/invcoord_epe_tests.c | 32 ------------------- test/083_invcoord_epud/00_all.in | 0 test/083_invcoord_epud/00_all.out | 1 + test/083_invcoord_epud/invcoord_epud_tests.c | 32 +++++++++++++++++++ test/083_invcoord_epudsep/00_all.in | 0 test/083_invcoord_epudsep/00_all.out | 1 - test/083_invcoord_epudsep/invcoord_epudsep_tests.c | 32 ------------------- test/084_invcoord_epe/00_all.in | 0 test/084_invcoord_epe/00_all.out | 1 + test/084_invcoord_epe/invcoord_epe_tests.c | 32 +++++++++++++++++++ test/085_invcoord_epudsep/00_all.in | 0 test/085_invcoord_epudsep/00_all.out | 1 + test/085_invcoord_epudsep/invcoord_epudsep_tests.c | 32 +++++++++++++++++++ 79 files changed, 307 insertions(+), 260 deletions(-) create mode 100644 test/076_copy_co/00_solved_solved.in create mode 100644 test/076_copy_co/00_solved_solved.out create mode 100644 test/076_copy_co/01_solved_scrambled.in create mode 100644 test/076_copy_co/01_solved_scrambled.out create mode 100644 test/076_copy_co/02_scrambled_scrambled.in create mode 100644 test/076_copy_co/02_scrambled_scrambled.out create mode 100644 test/076_copy_co/copy_co_tests.c delete mode 100644 test/076_copy_corners/00_solved_scrambled.in delete mode 100644 test/076_copy_corners/00_solved_scrambled.out delete mode 100644 test/076_copy_corners/copy_corners_tests.c create mode 100644 test/077_copy_corners/00_solved_scrambled.in create mode 100644 test/077_copy_corners/00_solved_scrambled.out create mode 100644 test/077_copy_corners/copy_corners_tests.c delete mode 100644 test/077_copy_edges/00_solved_scrambled.in delete mode 100644 test/077_copy_edges/00_solved_scrambled.out delete mode 100644 test/077_copy_edges/copy_edges_tests.c create mode 100644 test/078_copy_edges/00_solved_scrambled.in create mode 100644 test/078_copy_edges/00_solved_scrambled.out create mode 100644 test/078_copy_edges/copy_edges_tests.c delete mode 100644 test/078_invcoord_esep/00_solved.in delete mode 100644 test/078_invcoord_esep/00_solved.out delete mode 100644 test/078_invcoord_esep/01_U.in delete mode 100644 test/078_invcoord_esep/01_U.out delete mode 100644 test/078_invcoord_esep/02_U2.in delete mode 100644 test/078_invcoord_esep/02_U2.out delete mode 100644 test/078_invcoord_esep/20_scrambled.in delete mode 100644 test/078_invcoord_esep/20_scrambled.out delete mode 100644 test/078_invcoord_esep/21_swapaxis_FB.in delete mode 100644 test/078_invcoord_esep/21_swapaxis_FB.out delete mode 100644 test/078_invcoord_esep/22_swapaxis_RL.in delete mode 100644 test/078_invcoord_esep/22_swapaxis_RL.out delete mode 100644 test/078_invcoord_esep/23_swapaxis_UD.in delete mode 100644 test/078_invcoord_esep/23_swapaxis_UD.out delete mode 100644 test/078_invcoord_esep/invcoord_esep_tests.c delete mode 100644 test/079_invcoord_co/00_all.in delete mode 100644 test/079_invcoord_co/00_all.out delete mode 100644 test/079_invcoord_co/invcoord_co_tests.c delete mode 100644 test/080_invcoord_cp/00_all.in delete mode 100644 test/080_invcoord_cp/00_all.out delete mode 100644 test/080_invcoord_cp/invcoord_cp_tests.c create mode 100644 test/080_invcoord_esep/00_solved.in create mode 100644 test/080_invcoord_esep/00_solved.out create mode 100644 test/080_invcoord_esep/01_U.in create mode 100644 test/080_invcoord_esep/01_U.out create mode 100644 test/080_invcoord_esep/02_U2.in create mode 100644 test/080_invcoord_esep/02_U2.out create mode 100644 test/080_invcoord_esep/20_scrambled.in create mode 100644 test/080_invcoord_esep/20_scrambled.out create mode 100644 test/080_invcoord_esep/21_swapaxis_FB.in create mode 100644 test/080_invcoord_esep/21_swapaxis_FB.out create mode 100644 test/080_invcoord_esep/22_swapaxis_RL.in create mode 100644 test/080_invcoord_esep/22_swapaxis_RL.out create mode 100644 test/080_invcoord_esep/23_swapaxis_UD.in create mode 100644 test/080_invcoord_esep/23_swapaxis_UD.out create mode 100644 test/080_invcoord_esep/invcoord_esep_tests.c create mode 100644 test/081_invcoord_co/00_all.in create mode 100644 test/081_invcoord_co/00_all.out create mode 100644 test/081_invcoord_co/invcoord_co_tests.c delete mode 100644 test/081_invcoord_epud/00_all.in delete mode 100644 test/081_invcoord_epud/00_all.out delete mode 100644 test/081_invcoord_epud/invcoord_epud_tests.c create mode 100644 test/082_invcoord_cp/00_all.in create mode 100644 test/082_invcoord_cp/00_all.out create mode 100644 test/082_invcoord_cp/invcoord_cp_tests.c delete mode 100644 test/082_invcoord_epe/00_all.in delete mode 100644 test/082_invcoord_epe/00_all.out delete mode 100644 test/082_invcoord_epe/invcoord_epe_tests.c create mode 100644 test/083_invcoord_epud/00_all.in create mode 100644 test/083_invcoord_epud/00_all.out create mode 100644 test/083_invcoord_epud/invcoord_epud_tests.c delete mode 100644 test/083_invcoord_epudsep/00_all.in delete mode 100644 test/083_invcoord_epudsep/00_all.out delete mode 100644 test/083_invcoord_epudsep/invcoord_epudsep_tests.c create mode 100644 test/084_invcoord_epe/00_all.in create mode 100644 test/084_invcoord_epe/00_all.out create mode 100644 test/084_invcoord_epe/invcoord_epe_tests.c create mode 100644 test/085_invcoord_epudsep/00_all.in create mode 100644 test/085_invcoord_epudsep/00_all.out create mode 100644 test/085_invcoord_epudsep/invcoord_epudsep_tests.c diff --git a/test/076_copy_co/00_solved_solved.in b/test/076_copy_co/00_solved_solved.in new file mode 100644 index 0000000..14c8c39 --- /dev/null +++ b/test/076_copy_co/00_solved_solved.in @@ -0,0 +1,2 @@ +ABCDEFGH=ABCDEFGHIJKL=A +ABCDEFGH=ABCDEFGHIJKL=A diff --git a/test/076_copy_co/00_solved_solved.out b/test/076_copy_co/00_solved_solved.out new file mode 100644 index 0000000..5aa6ba7 --- /dev/null +++ b/test/076_copy_co/00_solved_solved.out @@ -0,0 +1 @@ +ABCDEFGH=ABCDEFGHIJKL=A diff --git a/test/076_copy_co/01_solved_scrambled.in b/test/076_copy_co/01_solved_scrambled.in new file mode 100644 index 0000000..3a1db4b --- /dev/null +++ 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 new file mode 100644 index 0000000..bcfe94c --- /dev/null +++ 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 new file mode 100644 index 0000000..fb0bccd --- /dev/null +++ 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 new file mode 100644 index 0000000..cde43a9 --- /dev/null +++ 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 new file mode 100644 index 0000000..3ca109b --- /dev/null +++ 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/076_copy_corners/00_solved_scrambled.in deleted file mode 100644 index 38c1566..0000000 --- a/test/076_copy_corners/00_solved_scrambled.in +++ /dev/null @@ -1,2 +0,0 @@ -ABCDEFGH=ABCDEFGHIJKL=A -CILVXGMR=FKbGIDSXBJAU=A diff --git a/test/076_copy_corners/00_solved_scrambled.out b/test/076_copy_corners/00_solved_scrambled.out deleted file mode 100644 index 04ed32e..0000000 --- a/test/076_copy_corners/00_solved_scrambled.out +++ /dev/null @@ -1 +0,0 @@ -CILVXGMR=ABCDEFGHIJKL=A diff --git a/test/076_copy_corners/copy_corners_tests.c b/test/076_copy_corners/copy_corners_tests.c deleted file mode 100644 index 02e949b..0000000 --- a/test/076_copy_corners/copy_corners_tests.c +++ /dev/null @@ -1,25 +0,0 @@ -#include "../test.h" - -void copy_corners(cube_t *, cube_t); - -void run(void) { - char str[STRLENMAX]; - oriented_cube_t c1, c2; - - fgets(str, STRLENMAX, stdin); - c1 = readcube(str); - - fgets(str, STRLENMAX, stdin); - c2 = readcube(str); - - copy_corners(&c1.cube, c2.cube); - - if (iserror(c1)) { - printf("Error setting EO\n"); - } else if (!isconsistent(c1)) { - printf("Setting EO resulted in inconsistent cube\n"); - } else { - writecube(c1, NISSY_SIZE_CUBE, str); - printf("%s\n", str); - } -} diff --git a/test/077_copy_corners/00_solved_scrambled.in b/test/077_copy_corners/00_solved_scrambled.in new file mode 100644 index 0000000..38c1566 --- /dev/null +++ b/test/077_copy_corners/00_solved_scrambled.in @@ -0,0 +1,2 @@ +ABCDEFGH=ABCDEFGHIJKL=A +CILVXGMR=FKbGIDSXBJAU=A diff --git a/test/077_copy_corners/00_solved_scrambled.out b/test/077_copy_corners/00_solved_scrambled.out new file mode 100644 index 0000000..04ed32e --- /dev/null +++ b/test/077_copy_corners/00_solved_scrambled.out @@ -0,0 +1 @@ +CILVXGMR=ABCDEFGHIJKL=A diff --git a/test/077_copy_corners/copy_corners_tests.c b/test/077_copy_corners/copy_corners_tests.c new file mode 100644 index 0000000..02e949b --- /dev/null +++ b/test/077_copy_corners/copy_corners_tests.c @@ -0,0 +1,25 @@ +#include "../test.h" + +void copy_corners(cube_t *, cube_t); + +void run(void) { + char str[STRLENMAX]; + oriented_cube_t c1, c2; + + fgets(str, STRLENMAX, stdin); + c1 = readcube(str); + + fgets(str, STRLENMAX, stdin); + c2 = readcube(str); + + copy_corners(&c1.cube, c2.cube); + + if (iserror(c1)) { + printf("Error setting EO\n"); + } else if (!isconsistent(c1)) { + printf("Setting EO resulted in inconsistent cube\n"); + } else { + writecube(c1, NISSY_SIZE_CUBE, str); + printf("%s\n", str); + } +} diff --git a/test/077_copy_edges/00_solved_scrambled.in b/test/077_copy_edges/00_solved_scrambled.in deleted file mode 100644 index 38c1566..0000000 --- a/test/077_copy_edges/00_solved_scrambled.in +++ /dev/null @@ -1,2 +0,0 @@ -ABCDEFGH=ABCDEFGHIJKL=A -CILVXGMR=FKbGIDSXBJAU=A diff --git a/test/077_copy_edges/00_solved_scrambled.out b/test/077_copy_edges/00_solved_scrambled.out deleted file mode 100644 index 0d38603..0000000 --- a/test/077_copy_edges/00_solved_scrambled.out +++ /dev/null @@ -1 +0,0 @@ -ABCDEFGH=FKbGIDSXBJAU=A diff --git a/test/077_copy_edges/copy_edges_tests.c b/test/077_copy_edges/copy_edges_tests.c deleted file mode 100644 index f3b0589..0000000 --- a/test/077_copy_edges/copy_edges_tests.c +++ /dev/null @@ -1,25 +0,0 @@ -#include "../test.h" - -void copy_edges(cube_t *, cube_t); - -void run(void) { - char str[STRLENMAX]; - oriented_cube_t c1, c2; - - fgets(str, STRLENMAX, stdin); - c1 = readcube(str); - - fgets(str, STRLENMAX, stdin); - c2 = readcube(str); - - copy_edges(&c1.cube, c2.cube); - - if (iserror(c1)) { - printf("Error setting EO\n"); - } else if (!isconsistent(c1)) { - printf("Setting EO resulted in inconsistent cube\n"); - } else { - writecube(c1, NISSY_SIZE_CUBE, str); - printf("%s\n", str); - } -} diff --git a/test/078_copy_edges/00_solved_scrambled.in b/test/078_copy_edges/00_solved_scrambled.in new file mode 100644 index 0000000..38c1566 --- /dev/null +++ b/test/078_copy_edges/00_solved_scrambled.in @@ -0,0 +1,2 @@ +ABCDEFGH=ABCDEFGHIJKL=A +CILVXGMR=FKbGIDSXBJAU=A diff --git a/test/078_copy_edges/00_solved_scrambled.out b/test/078_copy_edges/00_solved_scrambled.out new file mode 100644 index 0000000..0d38603 --- /dev/null +++ b/test/078_copy_edges/00_solved_scrambled.out @@ -0,0 +1 @@ +ABCDEFGH=FKbGIDSXBJAU=A diff --git a/test/078_copy_edges/copy_edges_tests.c b/test/078_copy_edges/copy_edges_tests.c new file mode 100644 index 0000000..f3b0589 --- /dev/null +++ b/test/078_copy_edges/copy_edges_tests.c @@ -0,0 +1,25 @@ +#include "../test.h" + +void copy_edges(cube_t *, cube_t); + +void run(void) { + char str[STRLENMAX]; + oriented_cube_t c1, c2; + + fgets(str, STRLENMAX, stdin); + c1 = readcube(str); + + fgets(str, STRLENMAX, stdin); + c2 = readcube(str); + + copy_edges(&c1.cube, c2.cube); + + if (iserror(c1)) { + printf("Error setting EO\n"); + } else if (!isconsistent(c1)) { + printf("Setting EO resulted in inconsistent cube\n"); + } else { + writecube(c1, NISSY_SIZE_CUBE, str); + printf("%s\n", str); + } +} diff --git a/test/078_invcoord_esep/00_solved.in b/test/078_invcoord_esep/00_solved.in deleted file mode 100644 index 5aa6ba7..0000000 --- a/test/078_invcoord_esep/00_solved.in +++ /dev/null @@ -1 +0,0 @@ -ABCDEFGH=ABCDEFGHIJKL=A diff --git a/test/078_invcoord_esep/00_solved.out b/test/078_invcoord_esep/00_solved.out deleted file mode 100644 index 573541a..0000000 --- a/test/078_invcoord_esep/00_solved.out +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/test/078_invcoord_esep/01_U.in b/test/078_invcoord_esep/01_U.in deleted file mode 100644 index 250d3a1..0000000 --- a/test/078_invcoord_esep/01_U.in +++ /dev/null @@ -1 +0,0 @@ -FECDABGH=EFCDBAGHIJKL=A diff --git a/test/078_invcoord_esep/01_U.out b/test/078_invcoord_esep/01_U.out deleted file mode 100644 index c3f407c..0000000 --- a/test/078_invcoord_esep/01_U.out +++ /dev/null @@ -1 +0,0 @@ -55 diff --git a/test/078_invcoord_esep/02_U2.in b/test/078_invcoord_esep/02_U2.in deleted file mode 100644 index b14792e..0000000 --- a/test/078_invcoord_esep/02_U2.in +++ /dev/null @@ -1 +0,0 @@ -BACDFEGH=BACDFEGHIJKL=A diff --git a/test/078_invcoord_esep/02_U2.out b/test/078_invcoord_esep/02_U2.out deleted file mode 100644 index 573541a..0000000 --- a/test/078_invcoord_esep/02_U2.out +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/test/078_invcoord_esep/20_scrambled.in b/test/078_invcoord_esep/20_scrambled.in deleted file mode 100644 index cfe9ee4..0000000 --- a/test/078_invcoord_esep/20_scrambled.in +++ /dev/null @@ -1,3 +0,0 @@ -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/078_invcoord_esep/20_scrambled.out b/test/078_invcoord_esep/20_scrambled.out deleted file mode 100644 index b204ff8..0000000 --- a/test/078_invcoord_esep/20_scrambled.out +++ /dev/null @@ -1 +0,0 @@ -22248 diff --git a/test/078_invcoord_esep/21_swapaxis_FB.in b/test/078_invcoord_esep/21_swapaxis_FB.in deleted file mode 100644 index 485925f..0000000 --- a/test/078_invcoord_esep/21_swapaxis_FB.in +++ /dev/null @@ -1 +0,0 @@ -ABCDEFGH=ILKJEFGHDABC=A diff --git a/test/078_invcoord_esep/21_swapaxis_FB.out b/test/078_invcoord_esep/21_swapaxis_FB.out deleted file mode 100644 index cb33fb1..0000000 --- a/test/078_invcoord_esep/21_swapaxis_FB.out +++ /dev/null @@ -1 +0,0 @@ -34649 diff --git a/test/078_invcoord_esep/22_swapaxis_RL.in b/test/078_invcoord_esep/22_swapaxis_RL.in deleted file mode 100644 index 7fa067f..0000000 --- a/test/078_invcoord_esep/22_swapaxis_RL.in +++ /dev/null @@ -1 +0,0 @@ -ABCDEFGH=ABCDIJKLHGFE=A diff --git a/test/078_invcoord_esep/22_swapaxis_RL.out b/test/078_invcoord_esep/22_swapaxis_RL.out deleted file mode 100644 index ddeb3cf..0000000 --- a/test/078_invcoord_esep/22_swapaxis_RL.out +++ /dev/null @@ -1 +0,0 @@ -4830 diff --git a/test/078_invcoord_esep/23_swapaxis_UD.in b/test/078_invcoord_esep/23_swapaxis_UD.in deleted file mode 100644 index 3a1502b..0000000 --- a/test/078_invcoord_esep/23_swapaxis_UD.in +++ /dev/null @@ -1 +0,0 @@ -ABCDEFGH=EFGHBADCIJKL=A diff --git a/test/078_invcoord_esep/23_swapaxis_UD.out b/test/078_invcoord_esep/23_swapaxis_UD.out deleted file mode 100644 index b5489e5..0000000 --- a/test/078_invcoord_esep/23_swapaxis_UD.out +++ /dev/null @@ -1 +0,0 @@ -69 diff --git a/test/078_invcoord_esep/invcoord_esep_tests.c b/test/078_invcoord_esep/invcoord_esep_tests.c deleted file mode 100644 index 16db3a0..0000000 --- a/test/078_invcoord_esep/invcoord_esep_tests.c +++ /dev/null @@ -1,19 +0,0 @@ -#include "../test.h" - -uint64_t coord_esep(cube_t); -cube_t invcoord_esep(uint64_t); - -void run(void) { - char str[STRLENMAX]; - oriented_cube_t cube; - uint64_t i; - - fgets(str, STRLENMAX, stdin); - cube = readcube(str); - - i = coord_esep(cube.cube); - cube.cube = invcoord_esep(i); - i = coord_esep(cube.cube); - - printf("%" PRIu64 "\n", i); -} diff --git a/test/079_invcoord_co/00_all.in b/test/079_invcoord_co/00_all.in deleted file mode 100644 index e69de29..0000000 diff --git a/test/079_invcoord_co/00_all.out b/test/079_invcoord_co/00_all.out deleted file mode 100644 index d6109db..0000000 --- a/test/079_invcoord_co/00_all.out +++ /dev/null @@ -1 +0,0 @@ -All good diff --git a/test/079_invcoord_co/invcoord_co_tests.c b/test/079_invcoord_co/invcoord_co_tests.c deleted file mode 100644 index dd5853e..0000000 --- a/test/079_invcoord_co/invcoord_co_tests.c +++ /dev/null @@ -1,36 +0,0 @@ -#include "../test.h" - -#define POW_3_7 2187 - -uint64_t coord_co(cube_t); -cube_t invcoord_co(uint64_t); - -void run(void) { - oriented_cube_t cube; - uint64_t coord, coord2; - - cube.orientation = 0; - - /* Test all possible values for CO coordinate */ - for (coord = 0; coord < POW_3_7; coord++) { - cube.cube = invcoord_co(coord); - - if (!isconsistent(cube)) { - printf("Not consistent\n"); - return; - } - if (!issolvable(cube)) { - printf("Not solvable\n"); - return; - } - - coord2 = coord_co(cube.cube); - if (coord != coord2) { - printf("Error: invcoord of %" PRIu64 - " returns %" PRIu64 "\n", coord, coord2); - return; - } - } - - printf("All good\n"); -} diff --git a/test/080_invcoord_cp/00_all.in b/test/080_invcoord_cp/00_all.in deleted file mode 100644 index e69de29..0000000 diff --git a/test/080_invcoord_cp/00_all.out b/test/080_invcoord_cp/00_all.out deleted file mode 100644 index d6109db..0000000 --- a/test/080_invcoord_cp/00_all.out +++ /dev/null @@ -1 +0,0 @@ -All good diff --git a/test/080_invcoord_cp/invcoord_cp_tests.c b/test/080_invcoord_cp/invcoord_cp_tests.c deleted file mode 100644 index 7d1e33f..0000000 --- a/test/080_invcoord_cp/invcoord_cp_tests.c +++ /dev/null @@ -1,32 +0,0 @@ -#include "../test.h" - -#define FACT_8 40320 - -uint64_t coord_cp(cube_t); -cube_t invcoord_cp(uint64_t); - -void run(void) { - oriented_cube_t cube; - uint64_t coord, coord2; - - cube.orientation = 0; - - /* Test all possible values for CP coordinate */ - for (coord = 0; coord < FACT_8; coord++) { - cube.cube = invcoord_cp(coord); - - if (!isconsistent(cube)) { - printf("Not consistent\n"); - return; - } - - coord2 = coord_cp(cube.cube); - if (coord != coord2) { - printf("Error: invcoord of %" PRIu64 - " returns %" PRIu64 "\n", coord, coord2); - return; - } - } - - printf("All good\n"); -} diff --git a/test/080_invcoord_esep/00_solved.in b/test/080_invcoord_esep/00_solved.in new file mode 100644 index 0000000..5aa6ba7 --- /dev/null +++ b/test/080_invcoord_esep/00_solved.in @@ -0,0 +1 @@ +ABCDEFGH=ABCDEFGHIJKL=A diff --git a/test/080_invcoord_esep/00_solved.out b/test/080_invcoord_esep/00_solved.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/080_invcoord_esep/00_solved.out @@ -0,0 +1 @@ +0 diff --git a/test/080_invcoord_esep/01_U.in b/test/080_invcoord_esep/01_U.in new file mode 100644 index 0000000..250d3a1 --- /dev/null +++ b/test/080_invcoord_esep/01_U.in @@ -0,0 +1 @@ +FECDABGH=EFCDBAGHIJKL=A diff --git a/test/080_invcoord_esep/01_U.out b/test/080_invcoord_esep/01_U.out new file mode 100644 index 0000000..c3f407c --- /dev/null +++ b/test/080_invcoord_esep/01_U.out @@ -0,0 +1 @@ +55 diff --git a/test/080_invcoord_esep/02_U2.in b/test/080_invcoord_esep/02_U2.in new file mode 100644 index 0000000..b14792e --- /dev/null +++ b/test/080_invcoord_esep/02_U2.in @@ -0,0 +1 @@ +BACDFEGH=BACDFEGHIJKL=A diff --git a/test/080_invcoord_esep/02_U2.out b/test/080_invcoord_esep/02_U2.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/080_invcoord_esep/02_U2.out @@ -0,0 +1 @@ +0 diff --git a/test/080_invcoord_esep/20_scrambled.in b/test/080_invcoord_esep/20_scrambled.in new file mode 100644 index 0000000..cfe9ee4 --- /dev/null +++ b/test/080_invcoord_esep/20_scrambled.in @@ -0,0 +1,3 @@ +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/080_invcoord_esep/20_scrambled.out b/test/080_invcoord_esep/20_scrambled.out new file mode 100644 index 0000000..b204ff8 --- /dev/null +++ b/test/080_invcoord_esep/20_scrambled.out @@ -0,0 +1 @@ +22248 diff --git a/test/080_invcoord_esep/21_swapaxis_FB.in b/test/080_invcoord_esep/21_swapaxis_FB.in new file mode 100644 index 0000000..485925f --- /dev/null +++ b/test/080_invcoord_esep/21_swapaxis_FB.in @@ -0,0 +1 @@ +ABCDEFGH=ILKJEFGHDABC=A diff --git a/test/080_invcoord_esep/21_swapaxis_FB.out b/test/080_invcoord_esep/21_swapaxis_FB.out new file mode 100644 index 0000000..cb33fb1 --- /dev/null +++ b/test/080_invcoord_esep/21_swapaxis_FB.out @@ -0,0 +1 @@ +34649 diff --git a/test/080_invcoord_esep/22_swapaxis_RL.in b/test/080_invcoord_esep/22_swapaxis_RL.in new file mode 100644 index 0000000..7fa067f --- /dev/null +++ b/test/080_invcoord_esep/22_swapaxis_RL.in @@ -0,0 +1 @@ +ABCDEFGH=ABCDIJKLHGFE=A diff --git a/test/080_invcoord_esep/22_swapaxis_RL.out b/test/080_invcoord_esep/22_swapaxis_RL.out new file mode 100644 index 0000000..ddeb3cf --- /dev/null +++ b/test/080_invcoord_esep/22_swapaxis_RL.out @@ -0,0 +1 @@ +4830 diff --git a/test/080_invcoord_esep/23_swapaxis_UD.in b/test/080_invcoord_esep/23_swapaxis_UD.in new file mode 100644 index 0000000..3a1502b --- /dev/null +++ b/test/080_invcoord_esep/23_swapaxis_UD.in @@ -0,0 +1 @@ +ABCDEFGH=EFGHBADCIJKL=A diff --git a/test/080_invcoord_esep/23_swapaxis_UD.out b/test/080_invcoord_esep/23_swapaxis_UD.out new file mode 100644 index 0000000..b5489e5 --- /dev/null +++ b/test/080_invcoord_esep/23_swapaxis_UD.out @@ -0,0 +1 @@ +69 diff --git a/test/080_invcoord_esep/invcoord_esep_tests.c b/test/080_invcoord_esep/invcoord_esep_tests.c new file mode 100644 index 0000000..16db3a0 --- /dev/null +++ b/test/080_invcoord_esep/invcoord_esep_tests.c @@ -0,0 +1,19 @@ +#include "../test.h" + +uint64_t coord_esep(cube_t); +cube_t invcoord_esep(uint64_t); + +void run(void) { + char str[STRLENMAX]; + oriented_cube_t cube; + uint64_t i; + + fgets(str, STRLENMAX, stdin); + cube = readcube(str); + + i = coord_esep(cube.cube); + cube.cube = invcoord_esep(i); + i = coord_esep(cube.cube); + + printf("%" PRIu64 "\n", i); +} diff --git a/test/081_invcoord_co/00_all.in b/test/081_invcoord_co/00_all.in new file mode 100644 index 0000000..e69de29 diff --git a/test/081_invcoord_co/00_all.out b/test/081_invcoord_co/00_all.out new file mode 100644 index 0000000..d6109db --- /dev/null +++ b/test/081_invcoord_co/00_all.out @@ -0,0 +1 @@ +All good diff --git a/test/081_invcoord_co/invcoord_co_tests.c b/test/081_invcoord_co/invcoord_co_tests.c new file mode 100644 index 0000000..dd5853e --- /dev/null +++ b/test/081_invcoord_co/invcoord_co_tests.c @@ -0,0 +1,36 @@ +#include "../test.h" + +#define POW_3_7 2187 + +uint64_t coord_co(cube_t); +cube_t invcoord_co(uint64_t); + +void run(void) { + oriented_cube_t cube; + uint64_t coord, coord2; + + cube.orientation = 0; + + /* Test all possible values for CO coordinate */ + for (coord = 0; coord < POW_3_7; coord++) { + cube.cube = invcoord_co(coord); + + if (!isconsistent(cube)) { + printf("Not consistent\n"); + return; + } + if (!issolvable(cube)) { + printf("Not solvable\n"); + return; + } + + coord2 = coord_co(cube.cube); + if (coord != coord2) { + printf("Error: invcoord of %" PRIu64 + " returns %" PRIu64 "\n", coord, coord2); + return; + } + } + + printf("All good\n"); +} diff --git a/test/081_invcoord_epud/00_all.in b/test/081_invcoord_epud/00_all.in deleted file mode 100644 index e69de29..0000000 diff --git a/test/081_invcoord_epud/00_all.out b/test/081_invcoord_epud/00_all.out deleted file mode 100644 index d6109db..0000000 --- a/test/081_invcoord_epud/00_all.out +++ /dev/null @@ -1 +0,0 @@ -All good diff --git a/test/081_invcoord_epud/invcoord_epud_tests.c b/test/081_invcoord_epud/invcoord_epud_tests.c deleted file mode 100644 index 6d7672b..0000000 --- a/test/081_invcoord_epud/invcoord_epud_tests.c +++ /dev/null @@ -1,32 +0,0 @@ -#include "../test.h" - -#define FACT_8 40320 - -uint64_t coord_epud(cube_t); -cube_t invcoord_epud(uint64_t); - -void run(void) { - oriented_cube_t cube; - uint64_t coord, coord2; - - cube.orientation = 0; - - /* Test all possible values for CP coordinate */ - for (coord = 0; coord < FACT_8; coord++) { - cube.cube = invcoord_epud(coord); - - if (!isconsistent(cube)) { - printf("Not consistent\n"); - return; - } - - coord2 = coord_epud(cube.cube); - if (coord != coord2) { - printf("Error: invcoord of %" PRIu64 - " returns %" PRIu64 "\n", coord, coord2); - return; - } - } - - printf("All good\n"); -} diff --git a/test/082_invcoord_cp/00_all.in b/test/082_invcoord_cp/00_all.in new file mode 100644 index 0000000..e69de29 diff --git a/test/082_invcoord_cp/00_all.out b/test/082_invcoord_cp/00_all.out new file mode 100644 index 0000000..d6109db --- /dev/null +++ b/test/082_invcoord_cp/00_all.out @@ -0,0 +1 @@ +All good diff --git a/test/082_invcoord_cp/invcoord_cp_tests.c b/test/082_invcoord_cp/invcoord_cp_tests.c new file mode 100644 index 0000000..7d1e33f --- /dev/null +++ b/test/082_invcoord_cp/invcoord_cp_tests.c @@ -0,0 +1,32 @@ +#include "../test.h" + +#define FACT_8 40320 + +uint64_t coord_cp(cube_t); +cube_t invcoord_cp(uint64_t); + +void run(void) { + oriented_cube_t cube; + uint64_t coord, coord2; + + cube.orientation = 0; + + /* Test all possible values for CP coordinate */ + for (coord = 0; coord < FACT_8; coord++) { + cube.cube = invcoord_cp(coord); + + if (!isconsistent(cube)) { + printf("Not consistent\n"); + return; + } + + coord2 = coord_cp(cube.cube); + if (coord != coord2) { + printf("Error: invcoord of %" PRIu64 + " returns %" PRIu64 "\n", coord, coord2); + return; + } + } + + printf("All good\n"); +} diff --git a/test/082_invcoord_epe/00_all.in b/test/082_invcoord_epe/00_all.in deleted file mode 100644 index e69de29..0000000 diff --git a/test/082_invcoord_epe/00_all.out b/test/082_invcoord_epe/00_all.out deleted file mode 100644 index d6109db..0000000 --- a/test/082_invcoord_epe/00_all.out +++ /dev/null @@ -1 +0,0 @@ -All good diff --git a/test/082_invcoord_epe/invcoord_epe_tests.c b/test/082_invcoord_epe/invcoord_epe_tests.c deleted file mode 100644 index 69c3c50..0000000 --- a/test/082_invcoord_epe/invcoord_epe_tests.c +++ /dev/null @@ -1,32 +0,0 @@ -#include "../test.h" - -#define FACT_4 24 - -uint64_t coord_epe(cube_t); -cube_t invcoord_epe(uint64_t); - -void run(void) { - oriented_cube_t cube; - uint64_t coord, coord2; - - cube.orientation = 0; - - /* Test all possible values for CP coordinate */ - for (coord = 0; coord < FACT_4; coord++) { - cube.cube = invcoord_epe(coord); - - if (!isconsistent(cube)) { - printf("Not consistent\n"); - return; - } - - coord2 = coord_epe(cube.cube); - if (coord != coord2) { - printf("Error: invcoord of %" PRIu64 - " returns %" PRIu64 "\n", coord, coord2); - return; - } - } - - printf("All good\n"); -} diff --git a/test/083_invcoord_epud/00_all.in b/test/083_invcoord_epud/00_all.in new file mode 100644 index 0000000..e69de29 diff --git a/test/083_invcoord_epud/00_all.out b/test/083_invcoord_epud/00_all.out new file mode 100644 index 0000000..d6109db --- /dev/null +++ b/test/083_invcoord_epud/00_all.out @@ -0,0 +1 @@ +All good diff --git a/test/083_invcoord_epud/invcoord_epud_tests.c b/test/083_invcoord_epud/invcoord_epud_tests.c new file mode 100644 index 0000000..6d7672b --- /dev/null +++ b/test/083_invcoord_epud/invcoord_epud_tests.c @@ -0,0 +1,32 @@ +#include "../test.h" + +#define FACT_8 40320 + +uint64_t coord_epud(cube_t); +cube_t invcoord_epud(uint64_t); + +void run(void) { + oriented_cube_t cube; + uint64_t coord, coord2; + + cube.orientation = 0; + + /* Test all possible values for CP coordinate */ + for (coord = 0; coord < FACT_8; coord++) { + cube.cube = invcoord_epud(coord); + + if (!isconsistent(cube)) { + printf("Not consistent\n"); + return; + } + + coord2 = coord_epud(cube.cube); + if (coord != coord2) { + printf("Error: invcoord of %" PRIu64 + " returns %" PRIu64 "\n", coord, coord2); + return; + } + } + + printf("All good\n"); +} diff --git a/test/083_invcoord_epudsep/00_all.in b/test/083_invcoord_epudsep/00_all.in deleted file mode 100644 index e69de29..0000000 diff --git a/test/083_invcoord_epudsep/00_all.out b/test/083_invcoord_epudsep/00_all.out deleted file mode 100644 index d6109db..0000000 --- a/test/083_invcoord_epudsep/00_all.out +++ /dev/null @@ -1 +0,0 @@ -All good diff --git a/test/083_invcoord_epudsep/invcoord_epudsep_tests.c b/test/083_invcoord_epudsep/invcoord_epudsep_tests.c deleted file mode 100644 index 709e5d8..0000000 --- a/test/083_invcoord_epudsep/invcoord_epudsep_tests.c +++ /dev/null @@ -1,32 +0,0 @@ -#include "../test.h" - -#define COMB_8_4 70 - -uint64_t coord_epudsep(cube_t); -cube_t invcoord_epudsep(uint64_t); - -void run(void) { - oriented_cube_t cube; - uint64_t coord, coord2; - - cube.orientation = 0; - - /* Test all possible values for CP coordinate */ - for (coord = 0; coord < COMB_8_4; coord++) { - cube.cube = invcoord_epudsep(coord); - - if (!isconsistent(cube)) { - printf("Not consistent\n"); - return; - } - - coord2 = coord_epudsep(cube.cube); - if (coord != coord2) { - printf("Error: invcoord of %" PRIu64 - " returns %" PRIu64 "\n", coord, coord2); - return; - } - } - - printf("All good\n"); -} diff --git a/test/084_invcoord_epe/00_all.in b/test/084_invcoord_epe/00_all.in new file mode 100644 index 0000000..e69de29 diff --git a/test/084_invcoord_epe/00_all.out b/test/084_invcoord_epe/00_all.out new file mode 100644 index 0000000..d6109db --- /dev/null +++ b/test/084_invcoord_epe/00_all.out @@ -0,0 +1 @@ +All good diff --git a/test/084_invcoord_epe/invcoord_epe_tests.c b/test/084_invcoord_epe/invcoord_epe_tests.c new file mode 100644 index 0000000..69c3c50 --- /dev/null +++ b/test/084_invcoord_epe/invcoord_epe_tests.c @@ -0,0 +1,32 @@ +#include "../test.h" + +#define FACT_4 24 + +uint64_t coord_epe(cube_t); +cube_t invcoord_epe(uint64_t); + +void run(void) { + oriented_cube_t cube; + uint64_t coord, coord2; + + cube.orientation = 0; + + /* Test all possible values for CP coordinate */ + for (coord = 0; coord < FACT_4; coord++) { + cube.cube = invcoord_epe(coord); + + if (!isconsistent(cube)) { + printf("Not consistent\n"); + return; + } + + coord2 = coord_epe(cube.cube); + if (coord != coord2) { + printf("Error: invcoord of %" PRIu64 + " returns %" PRIu64 "\n", coord, coord2); + return; + } + } + + printf("All good\n"); +} diff --git a/test/085_invcoord_epudsep/00_all.in b/test/085_invcoord_epudsep/00_all.in new file mode 100644 index 0000000..e69de29 diff --git a/test/085_invcoord_epudsep/00_all.out b/test/085_invcoord_epudsep/00_all.out new file mode 100644 index 0000000..d6109db --- /dev/null +++ b/test/085_invcoord_epudsep/00_all.out @@ -0,0 +1 @@ +All good diff --git a/test/085_invcoord_epudsep/invcoord_epudsep_tests.c b/test/085_invcoord_epudsep/invcoord_epudsep_tests.c new file mode 100644 index 0000000..709e5d8 --- /dev/null +++ b/test/085_invcoord_epudsep/invcoord_epudsep_tests.c @@ -0,0 +1,32 @@ +#include "../test.h" + +#define COMB_8_4 70 + +uint64_t coord_epudsep(cube_t); +cube_t invcoord_epudsep(uint64_t); + +void run(void) { + oriented_cube_t cube; + uint64_t coord, coord2; + + cube.orientation = 0; + + /* Test all possible values for CP coordinate */ + for (coord = 0; coord < COMB_8_4; coord++) { + cube.cube = invcoord_epudsep(coord); + + if (!isconsistent(cube)) { + printf("Not consistent\n"); + return; + } + + coord2 = coord_epudsep(cube.cube); + if (coord != coord2) { + printf("Error: invcoord of %" PRIu64 + " returns %" PRIu64 "\n", coord, coord2); + return; + } + } + + printf("All good\n"); +} -- cgit v1.3