From 2c8ad86805516211103df1ef7552d882f54748c3 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sun, 19 Nov 2023 22:03:17 +0100 Subject: Removed src cube type, kept only H48 and LST (for now) --- test/021_io_SRC_write/01_solved.in | 1 - test/021_io_SRC_write/01_solved.out | 4 ---- test/021_io_SRC_write/02_scrambled.in | 1 - test/021_io_SRC_write/02_scrambled.out | 4 ---- test/021_io_SRC_write/io_SRC_tests.c | 24 ------------------------ test/023_io_LST_write/io_LST_tests.c | 7 ------- test/024_io_LST_read/01_solved.in | 1 + test/024_io_LST_read/01_solved.out | 1 + test/024_io_LST_read/02_scrambled.in | 1 + test/024_io_LST_read/02_scrambled.out | 1 + test/024_io_LST_read/io_LST_tests.c | 24 ++++++++++++++++++++++++ 11 files changed, 28 insertions(+), 41 deletions(-) delete mode 100644 test/021_io_SRC_write/01_solved.in delete mode 100644 test/021_io_SRC_write/01_solved.out delete mode 100644 test/021_io_SRC_write/02_scrambled.in delete mode 100644 test/021_io_SRC_write/02_scrambled.out delete mode 100644 test/021_io_SRC_write/io_SRC_tests.c create mode 100644 test/024_io_LST_read/01_solved.in create mode 100644 test/024_io_LST_read/01_solved.out create mode 100644 test/024_io_LST_read/02_scrambled.in create mode 100644 test/024_io_LST_read/02_scrambled.out create mode 100644 test/024_io_LST_read/io_LST_tests.c (limited to 'test') diff --git a/test/021_io_SRC_write/01_solved.in b/test/021_io_SRC_write/01_solved.in deleted file mode 100644 index dff224d..0000000 --- a/test/021_io_SRC_write/01_solved.in +++ /dev/null @@ -1 +0,0 @@ -UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0 diff --git a/test/021_io_SRC_write/01_solved.out b/test/021_io_SRC_write/01_solved.out deleted file mode 100644 index 3c21bcc..0000000 --- a/test/021_io_SRC_write/01_solved.out +++ /dev/null @@ -1,4 +0,0 @@ -{ - .corner = {0, 1, 2, 3, 4, 5, 6, 7}, - .edge = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} -} diff --git a/test/021_io_SRC_write/02_scrambled.in b/test/021_io_SRC_write/02_scrambled.in deleted file mode 100644 index 6a05bbc..0000000 --- a/test/021_io_SRC_write/02_scrambled.in +++ /dev/null @@ -1 +0,0 @@ -FL0 DB0 UB1 FR0 UR0 DF0 UF0 BR1 UL1 BL1 DL0 DR0 DFR1 UFR1 UBR1 UFL2 DBR2 DFL0 DBL2 UBL0 diff --git a/test/021_io_SRC_write/02_scrambled.out b/test/021_io_SRC_write/02_scrambled.out deleted file mode 100644 index b899386..0000000 --- a/test/021_io_SRC_write/02_scrambled.out +++ /dev/null @@ -1,4 +0,0 @@ -{ - .corner = {38, 32, 37, 68, 67, 2, 71, 1}, - .edge = {9, 2, 17, 8, 4, 3, 0, 27, 21, 26, 6, 7} -} diff --git a/test/021_io_SRC_write/io_SRC_tests.c b/test/021_io_SRC_write/io_SRC_tests.c deleted file mode 100644 index c427c6c..0000000 --- a/test/021_io_SRC_write/io_SRC_tests.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "../test.h" - -int main(void) { - char str[STRLENMAX], *aux; - cube_t cube; - - aux = str; - while (fgets(aux, STRLENMAX, stdin) != NULL) - while (*aux != '\n') - aux++; - - cube = readcube("H48", str); - - if (iserror(cube)) { - printf("Error reading cube\n"); - } else if (!issolvable(cube)) { - printf("Cube is not solvable\n"); - } else { - writecube("SRC", cube, str); - printf("%s\n", str); - } - - return 0; -} diff --git a/test/023_io_LST_write/io_LST_tests.c b/test/023_io_LST_write/io_LST_tests.c index 45cc203..df35632 100644 --- a/test/023_io_LST_write/io_LST_tests.c +++ b/test/023_io_LST_write/io_LST_tests.c @@ -1,12 +1,5 @@ #include "../test.h" -#define STRLENMAX 10000 - -bool iserror(cube_t); -bool issolvable(cube_t); -cube_t readcube(char *, char *); -void writecube(char *, cube_t, char *); - int main(void) { char str[STRLENMAX], *aux; cube_t cube; diff --git a/test/024_io_LST_read/01_solved.in b/test/024_io_LST_read/01_solved.in new file mode 100644 index 0000000..c5b394b --- /dev/null +++ b/test/024_io_LST_read/01_solved.in @@ -0,0 +1 @@ +0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 diff --git a/test/024_io_LST_read/01_solved.out b/test/024_io_LST_read/01_solved.out new file mode 100644 index 0000000..dff224d --- /dev/null +++ b/test/024_io_LST_read/01_solved.out @@ -0,0 +1 @@ +UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0 diff --git a/test/024_io_LST_read/02_scrambled.in b/test/024_io_LST_read/02_scrambled.in new file mode 100644 index 0000000..9fcb603 --- /dev/null +++ b/test/024_io_LST_read/02_scrambled.in @@ -0,0 +1 @@ +38, 32, 37, 68, 67, 2, 71, 1, 9, 2, 17, 8, 4, 3, 0, 27, 21, 26, 6, 7 diff --git a/test/024_io_LST_read/02_scrambled.out b/test/024_io_LST_read/02_scrambled.out new file mode 100644 index 0000000..6a05bbc --- /dev/null +++ b/test/024_io_LST_read/02_scrambled.out @@ -0,0 +1 @@ +FL0 DB0 UB1 FR0 UR0 DF0 UF0 BR1 UL1 BL1 DL0 DR0 DFR1 UFR1 UBR1 UFL2 DBR2 DFL0 DBL2 UBL0 diff --git a/test/024_io_LST_read/io_LST_tests.c b/test/024_io_LST_read/io_LST_tests.c new file mode 100644 index 0000000..506a23d --- /dev/null +++ b/test/024_io_LST_read/io_LST_tests.c @@ -0,0 +1,24 @@ +#include "../test.h" + +int main(void) { + char str[STRLENMAX], *aux; + cube_t cube; + + aux = str; + while (fgets(aux, STRLENMAX, stdin) != NULL) + while (*aux != '\n') + aux++; + + cube = readcube("LST", str); + + if (iserror(cube)) { + printf("Error reading cube\n"); + } else if (!issolvable(cube)) { + printf("Cube is not solvable\n"); + } else { + writecube("H48", cube, str); + printf("%s\n", str); + } + + return 0; +} -- cgit v1.3