From ffb67c9dcd22c4c3258b9ef78301e404e7d9a796 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 5 Oct 2023 15:28:45 +0200 Subject: Split isconsistent() and issolvable() --- test/00_basic/all.out | 4 ++-- test/00_basic/basic_tests.c | 2 +- test/01_io/04_inconsistent_ep.in | 1 - test/01_io/04_inconsistent_ep.out | 1 - test/01_io/04_unsolvable_ep.in | 1 + test/01_io/04_unsolvable_ep.out | 1 + test/01_io/05_inconsistent_eo.in | 1 - test/01_io/05_inconsistent_eo.out | 1 - test/01_io/05_unsolvable_eo.in | 1 + test/01_io/05_unsolvable_eo.out | 1 + test/01_io/06_inconsistent_cp.in | 1 - test/01_io/06_inconsistent_cp.out | 1 - test/01_io/06_unsolvable_cp.in | 1 + test/01_io/06_unsolvable_cp.out | 1 + test/01_io/07_inconsistent_co.in | 1 - test/01_io/07_inconsistent_co.out | 1 - test/01_io/07_unsolvable_co.in | 1 + test/01_io/07_unsolvable_co.out | 1 + test/01_io/io_tests.c | 4 ++-- test/02_move/move_tests.c | 4 ++-- test/03_inverse/inverse_tests.c | 4 ++-- test/04_compose/compose_tests.c | 4 ++-- 22 files changed, 19 insertions(+), 19 deletions(-) delete mode 100644 test/01_io/04_inconsistent_ep.in delete mode 100644 test/01_io/04_inconsistent_ep.out create mode 100644 test/01_io/04_unsolvable_ep.in create mode 100644 test/01_io/04_unsolvable_ep.out delete mode 100644 test/01_io/05_inconsistent_eo.in delete mode 100644 test/01_io/05_inconsistent_eo.out create mode 100644 test/01_io/05_unsolvable_eo.in create mode 100644 test/01_io/05_unsolvable_eo.out delete mode 100644 test/01_io/06_inconsistent_cp.in delete mode 100644 test/01_io/06_inconsistent_cp.out create mode 100644 test/01_io/06_unsolvable_cp.in create mode 100644 test/01_io/06_unsolvable_cp.out delete mode 100644 test/01_io/07_inconsistent_co.in delete mode 100644 test/01_io/07_inconsistent_co.out create mode 100644 test/01_io/07_unsolvable_co.in create mode 100644 test/01_io/07_unsolvable_co.out (limited to 'test') diff --git a/test/00_basic/all.out b/test/00_basic/all.out index aad167e..892ad22 100644 --- a/test/00_basic/all.out +++ b/test/00_basic/all.out @@ -1,6 +1,6 @@ -Solved is consistent +Solved is solvable Solved is solved -Zero is NOT consistent +Zero is NOT solvable Zero is NOT solved Solved and Solved are equal Solved and Zero are NOT equal diff --git a/test/00_basic/basic_tests.c b/test/00_basic/basic_tests.c index 8c52941..a3ae0b9 100644 --- a/test/00_basic/basic_tests.c +++ b/test/00_basic/basic_tests.c @@ -7,7 +7,7 @@ void check(cube_t cube, char *name) { - printf("%s is%s consistent\n", name, isconsistent(cube) ? "" : " NOT"); + printf("%s is%s solvable\n", name, issolvable(cube) ? "" : " NOT"); printf("%s is%s solved\n", name, issolved(cube) ? "" : " NOT"); } diff --git a/test/01_io/04_inconsistent_ep.in b/test/01_io/04_inconsistent_ep.in deleted file mode 100644 index 8483962..0000000 --- a/test/01_io/04_inconsistent_ep.in +++ /dev/null @@ -1 +0,0 @@ -UB0 UF0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0 diff --git a/test/01_io/04_inconsistent_ep.out b/test/01_io/04_inconsistent_ep.out deleted file mode 100644 index cb70902..0000000 --- a/test/01_io/04_inconsistent_ep.out +++ /dev/null @@ -1 +0,0 @@ -Cube is inconsistent diff --git a/test/01_io/04_unsolvable_ep.in b/test/01_io/04_unsolvable_ep.in new file mode 100644 index 0000000..8483962 --- /dev/null +++ b/test/01_io/04_unsolvable_ep.in @@ -0,0 +1 @@ +UB0 UF0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0 diff --git a/test/01_io/04_unsolvable_ep.out b/test/01_io/04_unsolvable_ep.out new file mode 100644 index 0000000..e35c6e4 --- /dev/null +++ b/test/01_io/04_unsolvable_ep.out @@ -0,0 +1 @@ +Cube is not solvable diff --git a/test/01_io/05_inconsistent_eo.in b/test/01_io/05_inconsistent_eo.in deleted file mode 100644 index a92089d..0000000 --- a/test/01_io/05_inconsistent_eo.in +++ /dev/null @@ -1 +0,0 @@ -UF1 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0 diff --git a/test/01_io/05_inconsistent_eo.out b/test/01_io/05_inconsistent_eo.out deleted file mode 100644 index cb70902..0000000 --- a/test/01_io/05_inconsistent_eo.out +++ /dev/null @@ -1 +0,0 @@ -Cube is inconsistent diff --git a/test/01_io/05_unsolvable_eo.in b/test/01_io/05_unsolvable_eo.in new file mode 100644 index 0000000..a92089d --- /dev/null +++ b/test/01_io/05_unsolvable_eo.in @@ -0,0 +1 @@ +UF1 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0 diff --git a/test/01_io/05_unsolvable_eo.out b/test/01_io/05_unsolvable_eo.out new file mode 100644 index 0000000..e35c6e4 --- /dev/null +++ b/test/01_io/05_unsolvable_eo.out @@ -0,0 +1 @@ +Cube is not solvable diff --git a/test/01_io/06_inconsistent_cp.in b/test/01_io/06_inconsistent_cp.in deleted file mode 100644 index 2085dd5..0000000 --- a/test/01_io/06_inconsistent_cp.in +++ /dev/null @@ -1 +0,0 @@ -UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UBL0 UFR0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0 diff --git a/test/01_io/06_inconsistent_cp.out b/test/01_io/06_inconsistent_cp.out deleted file mode 100644 index cb70902..0000000 --- a/test/01_io/06_inconsistent_cp.out +++ /dev/null @@ -1 +0,0 @@ -Cube is inconsistent diff --git a/test/01_io/06_unsolvable_cp.in b/test/01_io/06_unsolvable_cp.in new file mode 100644 index 0000000..2085dd5 --- /dev/null +++ b/test/01_io/06_unsolvable_cp.in @@ -0,0 +1 @@ +UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UBL0 UFR0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0 diff --git a/test/01_io/06_unsolvable_cp.out b/test/01_io/06_unsolvable_cp.out new file mode 100644 index 0000000..e35c6e4 --- /dev/null +++ b/test/01_io/06_unsolvable_cp.out @@ -0,0 +1 @@ +Cube is not solvable diff --git a/test/01_io/07_inconsistent_co.in b/test/01_io/07_inconsistent_co.in deleted file mode 100644 index abd74e2..0000000 --- a/test/01_io/07_inconsistent_co.in +++ /dev/null @@ -1 +0,0 @@ -UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR1 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0 diff --git a/test/01_io/07_inconsistent_co.out b/test/01_io/07_inconsistent_co.out deleted file mode 100644 index cb70902..0000000 --- a/test/01_io/07_inconsistent_co.out +++ /dev/null @@ -1 +0,0 @@ -Cube is inconsistent diff --git a/test/01_io/07_unsolvable_co.in b/test/01_io/07_unsolvable_co.in new file mode 100644 index 0000000..abd74e2 --- /dev/null +++ b/test/01_io/07_unsolvable_co.in @@ -0,0 +1 @@ +UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR1 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0 diff --git a/test/01_io/07_unsolvable_co.out b/test/01_io/07_unsolvable_co.out new file mode 100644 index 0000000..e35c6e4 --- /dev/null +++ b/test/01_io/07_unsolvable_co.out @@ -0,0 +1 @@ +Cube is not solvable diff --git a/test/01_io/io_tests.c b/test/01_io/io_tests.c index 42ef9b8..913ec1d 100644 --- a/test/01_io/io_tests.c +++ b/test/01_io/io_tests.c @@ -17,8 +17,8 @@ int main() { if (iserror(cube)) { printf("Error reading cube\n"); - } else if (!isconsistent(cube)) { - printf("Cube is inconsistent\n"); + } else if (!issolvable(cube)) { + printf("Cube is not solvable\n"); } else { writecube(cube, str); printf("%s\n", str); diff --git a/test/02_move/move_tests.c b/test/02_move/move_tests.c index ac25de3..333c8ee 100644 --- a/test/02_move/move_tests.c +++ b/test/02_move/move_tests.c @@ -29,8 +29,8 @@ int main() { if (iserror(cube)) { printf("Error moving cube\n"); - } else if (!isconsistent(cube)) { - printf("Moved cube is inconsistent\n"); + } else if (!issolvable(cube)) { + printf("Moved cube is not solvable\n"); } else { writecube(cube, str); printf("%s\n", str); diff --git a/test/03_inverse/inverse_tests.c b/test/03_inverse/inverse_tests.c index 5fab71a..c8d8d95 100644 --- a/test/03_inverse/inverse_tests.c +++ b/test/03_inverse/inverse_tests.c @@ -16,8 +16,8 @@ int main() { if (iserror(inv)) { printf("Error inverting cube\n"); - } else if (!isconsistent(inv)) { - printf("Inverted cube is inconsistent\n"); + } else if (!issolvable(inv)) { + printf("Inverted cube is not solvable\n"); } else { writecube(inv, str); printf("%s\n", str); diff --git a/test/04_compose/compose_tests.c b/test/04_compose/compose_tests.c index ae34f6d..575c2c9 100644 --- a/test/04_compose/compose_tests.c +++ b/test/04_compose/compose_tests.c @@ -19,8 +19,8 @@ int main() { if (iserror(c3)) { printf("Error composing cubes\n"); - } else if (!isconsistent(c3)) { - printf("Composed cube is inconsistent\n"); + } else if (!issolvable(c3)) { + printf("Composed cube is not solvable\n"); } else { writecube(c3, str); printf("%s\n", str); -- cgit v1.3