diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-14 22:18:45 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-14 22:18:45 +0100 |
| commit | e0f38c7e42d9e48ac654f9dcedf8722ff1136106 (patch) | |
| tree | fc92f1dc8d0ade82541d216e05ba37b3ddc97ca3 /test/020_io_H48_read_write | |
| parent | ad9bdca9741b5f038610cbe0536131ab0dc7b511 (diff) | |
| download | nissy-core-e0f38c7e42d9e48ac654f9dcedf8722ff1136106.tar.gz nissy-core-e0f38c7e42d9e48ac654f9dcedf8722ff1136106.zip | |
Renamed tests, added tests for permsign
Diffstat (limited to 'test/020_io_H48_read_write')
19 files changed, 55 insertions, 0 deletions
diff --git a/test/020_io_H48_read_write/00_garbage.in b/test/020_io_H48_read_write/00_garbage.in new file mode 100644 index 0000000..9ac203a --- /dev/null +++ b/test/020_io_H48_read_write/00_garbage.in | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | FUF0 UBBBR2 k4 | ||
| 2 | hello | ||
| 3 | garbage | ||
diff --git a/test/020_io_H48_read_write/00_garbage.out b/test/020_io_H48_read_write/00_garbage.out new file mode 100644 index 0000000..5b9114e --- /dev/null +++ b/test/020_io_H48_read_write/00_garbage.out | |||
| @@ -0,0 +1 @@ | |||
| Error reading cube | |||
diff --git a/test/020_io_H48_read_write/01_solved_oneline.in b/test/020_io_H48_read_write/01_solved_oneline.in new file mode 100644 index 0000000..dff224d --- /dev/null +++ b/test/020_io_H48_read_write/01_solved_oneline.in | |||
| @@ -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/020_io_H48_read_write/01_solved_oneline.out b/test/020_io_H48_read_write/01_solved_oneline.out new file mode 100644 index 0000000..dff224d --- /dev/null +++ b/test/020_io_H48_read_write/01_solved_oneline.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/020_io_H48_read_write/02_solved_oneline_whitespace.in b/test/020_io_H48_read_write/02_solved_oneline_whitespace.in new file mode 100644 index 0000000..5d10368 --- /dev/null +++ b/test/020_io_H48_read_write/02_solved_oneline_whitespace.in | |||
| @@ -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/020_io_H48_read_write/02_solved_oneline_whitespace.out b/test/020_io_H48_read_write/02_solved_oneline_whitespace.out new file mode 100644 index 0000000..dff224d --- /dev/null +++ b/test/020_io_H48_read_write/02_solved_oneline_whitespace.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/020_io_H48_read_write/03_solved_multiline.in b/test/020_io_H48_read_write/03_solved_multiline.in new file mode 100644 index 0000000..9f9652b --- /dev/null +++ b/test/020_io_H48_read_write/03_solved_multiline.in | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | UF0 UB0 | ||
| 2 | DB0 DF0 UR0 UL0 DL0 | ||
| 3 | DR0 FR0 FL0 BL0 BR0 UFR0 | ||
| 4 | |||
| 5 | UBL0 DFL0 DBR0 | ||
| 6 | |||
| 7 | |||
| 8 | UFL0 UBR0 DFR0 | ||
| 9 | DBL0 | ||
diff --git a/test/020_io_H48_read_write/03_solved_multiline.out b/test/020_io_H48_read_write/03_solved_multiline.out new file mode 100644 index 0000000..dff224d --- /dev/null +++ b/test/020_io_H48_read_write/03_solved_multiline.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/020_io_H48_read_write/04_unsolvable_ep.in b/test/020_io_H48_read_write/04_unsolvable_ep.in new file mode 100644 index 0000000..8483962 --- /dev/null +++ b/test/020_io_H48_read_write/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/020_io_H48_read_write/04_unsolvable_ep.out b/test/020_io_H48_read_write/04_unsolvable_ep.out new file mode 100644 index 0000000..e35c6e4 --- /dev/null +++ b/test/020_io_H48_read_write/04_unsolvable_ep.out | |||
| @@ -0,0 +1 @@ | |||
| Cube is not solvable | |||
diff --git a/test/020_io_H48_read_write/05_unsolvable_eo.in b/test/020_io_H48_read_write/05_unsolvable_eo.in new file mode 100644 index 0000000..a92089d --- /dev/null +++ b/test/020_io_H48_read_write/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/020_io_H48_read_write/05_unsolvable_eo.out b/test/020_io_H48_read_write/05_unsolvable_eo.out new file mode 100644 index 0000000..e35c6e4 --- /dev/null +++ b/test/020_io_H48_read_write/05_unsolvable_eo.out | |||
| @@ -0,0 +1 @@ | |||
| Cube is not solvable | |||
diff --git a/test/020_io_H48_read_write/06_unsolvable_cp.in b/test/020_io_H48_read_write/06_unsolvable_cp.in new file mode 100644 index 0000000..2085dd5 --- /dev/null +++ b/test/020_io_H48_read_write/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/020_io_H48_read_write/06_unsolvable_cp.out b/test/020_io_H48_read_write/06_unsolvable_cp.out new file mode 100644 index 0000000..e35c6e4 --- /dev/null +++ b/test/020_io_H48_read_write/06_unsolvable_cp.out | |||
| @@ -0,0 +1 @@ | |||
| Cube is not solvable | |||
diff --git a/test/020_io_H48_read_write/07_unsolvable_co.in b/test/020_io_H48_read_write/07_unsolvable_co.in new file mode 100644 index 0000000..abd74e2 --- /dev/null +++ b/test/020_io_H48_read_write/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/020_io_H48_read_write/07_unsolvable_co.out b/test/020_io_H48_read_write/07_unsolvable_co.out new file mode 100644 index 0000000..e35c6e4 --- /dev/null +++ b/test/020_io_H48_read_write/07_unsolvable_co.out | |||
| @@ -0,0 +1 @@ | |||
| Cube is not solvable | |||
diff --git a/test/020_io_H48_read_write/08_unsolved.in b/test/020_io_H48_read_write/08_unsolved.in new file mode 100644 index 0000000..c992ce7 --- /dev/null +++ b/test/020_io_H48_read_write/08_unsolved.in | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | UL1 DR0 UB0 DL1 | ||
| 2 | UR0 FR1 DB0 BR0 | ||
| 3 | UF1 DF0 BL0 FL0 | ||
| 4 | |||
| 5 | UBL0 DLF1 DBR2 UFR1 | ||
| 6 | DFR1 UBR1 UFL0 DBL0 | ||
diff --git a/test/020_io_H48_read_write/08_unsolved.out b/test/020_io_H48_read_write/08_unsolved.out new file mode 100644 index 0000000..8c132cf --- /dev/null +++ b/test/020_io_H48_read_write/08_unsolved.out | |||
| @@ -0,0 +1 @@ | |||
| UL1 DR0 UB0 DL1 UR0 FR1 DB0 BR0 UF1 DF0 BL0 FL0 UBL0 DFL1 DBR2 UFR1 DFR1 UBR1 UFL0 DBL0 | |||
diff --git a/test/020_io_H48_read_write/io_H48_tests.c b/test/020_io_H48_read_write/io_H48_tests.c new file mode 100644 index 0000000..71df1e7 --- /dev/null +++ b/test/020_io_H48_read_write/io_H48_tests.c | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | int main() { | ||
| 4 | char *c, str[STRLENMAX]; | ||
| 5 | cube_t cube; | ||
| 6 | |||
| 7 | for (c = str; (*c = getchar()) != EOF; c++) ; | ||
| 8 | *c = '\0'; | ||
| 9 | |||
| 10 | cube = readcube("H48", str); | ||
| 11 | |||
| 12 | if (iserror(cube)) { | ||
| 13 | printf("Error reading cube\n"); | ||
| 14 | } else if (!issolvable(cube)) { | ||
| 15 | printf("Cube is not solvable\n"); | ||
| 16 | } else { | ||
| 17 | writecube("H48", cube, str); | ||
| 18 | printf("%s\n", str); | ||
| 19 | } | ||
| 20 | |||
| 21 | return 0; | ||
| 22 | } | ||
