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/021_io_SRC_write | |
| parent | ad9bdca9741b5f038610cbe0536131ab0dc7b511 (diff) | |
| download | nissy-core-e0f38c7e42d9e48ac654f9dcedf8722ff1136106.tar.gz nissy-core-e0f38c7e42d9e48ac654f9dcedf8722ff1136106.zip | |
Renamed tests, added tests for permsign
Diffstat (limited to 'test/021_io_SRC_write')
| -rw-r--r-- | test/021_io_SRC_write/01_solved.in | 1 | ||||
| -rw-r--r-- | test/021_io_SRC_write/01_solved.out | 4 | ||||
| -rw-r--r-- | test/021_io_SRC_write/02_scrambled.in | 1 | ||||
| -rw-r--r-- | test/021_io_SRC_write/02_scrambled.out | 4 | ||||
| -rw-r--r-- | test/021_io_SRC_write/io_SRC_tests.c | 22 |
5 files changed, 32 insertions, 0 deletions
diff --git a/test/021_io_SRC_write/01_solved.in b/test/021_io_SRC_write/01_solved.in new file mode 100644 index 0000000..dff224d --- /dev/null +++ b/test/021_io_SRC_write/01_solved.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/021_io_SRC_write/01_solved.out b/test/021_io_SRC_write/01_solved.out new file mode 100644 index 0000000..3c21bcc --- /dev/null +++ b/test/021_io_SRC_write/01_solved.out | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | { | ||
| 2 | .corner = {0, 1, 2, 3, 4, 5, 6, 7}, | ||
| 3 | .edge = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} | ||
| 4 | } | ||
diff --git a/test/021_io_SRC_write/02_scrambled.in b/test/021_io_SRC_write/02_scrambled.in new file mode 100644 index 0000000..6a05bbc --- /dev/null +++ b/test/021_io_SRC_write/02_scrambled.in | |||
| @@ -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/021_io_SRC_write/02_scrambled.out b/test/021_io_SRC_write/02_scrambled.out new file mode 100644 index 0000000..b899386 --- /dev/null +++ b/test/021_io_SRC_write/02_scrambled.out | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | { | ||
| 2 | .corner = {38, 32, 37, 68, 67, 2, 71, 1}, | ||
| 3 | .edge = {9, 2, 17, 8, 4, 3, 0, 27, 21, 26, 6, 7} | ||
| 4 | } | ||
diff --git a/test/021_io_SRC_write/io_SRC_tests.c b/test/021_io_SRC_write/io_SRC_tests.c new file mode 100644 index 0000000..5ae3d99 --- /dev/null +++ b/test/021_io_SRC_write/io_SRC_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("SRC", cube, str); | ||
| 18 | printf("%s\n", str); | ||
| 19 | } | ||
| 20 | |||
| 21 | return 0; | ||
| 22 | } | ||
