diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-06-11 12:05:24 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-06-11 12:05:24 +0200 |
| commit | b4d33513bd44c82426ef9e3c6daf5b8046672514 (patch) | |
| tree | db64d441059897974d270614cd1ad22d15fc8e56 /test/022_io_B32_read | |
| parent | c89c5a1832354d656757c5aff49018d0313838e0 (diff) | |
| download | nissy-core-b4d33513bd44c82426ef9e3c6daf5b8046672514.tar.gz nissy-core-b4d33513bd44c82426ef9e3c6daf5b8046672514.zip | |
Finished refactor
Diffstat (limited to 'test/022_io_B32_read')
| -rw-r--r-- | test/022_io_B32_read/00_solved.in | 1 | ||||
| -rw-r--r-- | test/022_io_B32_read/00_solved.out | 1 | ||||
| -rw-r--r-- | test/022_io_B32_read/01_F.in | 1 | ||||
| -rw-r--r-- | test/022_io_B32_read/01_F.out | 1 | ||||
| -rw-r--r-- | test/022_io_B32_read/02_scrambled.in | 1 | ||||
| -rw-r--r-- | test/022_io_B32_read/02_scrambled.out | 1 | ||||
| -rw-r--r-- | test/022_io_B32_read/io_B32_read_tests.c | 24 |
7 files changed, 30 insertions, 0 deletions
diff --git a/test/022_io_B32_read/00_solved.in b/test/022_io_B32_read/00_solved.in new file mode 100644 index 0000000..e1df94b --- /dev/null +++ b/test/022_io_B32_read/00_solved.in | |||
| @@ -0,0 +1 @@ | |||
| ABCDEFGH=ABCDEFGHIJKL | |||
diff --git a/test/022_io_B32_read/00_solved.out b/test/022_io_B32_read/00_solved.out new file mode 100644 index 0000000..dff224d --- /dev/null +++ b/test/022_io_B32_read/00_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/022_io_B32_read/01_F.in b/test/022_io_B32_read/01_F.in new file mode 100644 index 0000000..1677251 --- /dev/null +++ b/test/022_io_B32_read/01_F.in | |||
| @@ -0,0 +1 @@ | |||
| MBODSFQH=ZBCYEFGHQTKL | |||
diff --git a/test/022_io_B32_read/01_F.out b/test/022_io_B32_read/01_F.out new file mode 100644 index 0000000..e805af8 --- /dev/null +++ b/test/022_io_B32_read/01_F.out | |||
| @@ -0,0 +1 @@ | |||
| FL1 UB0 DB0 FR1 UR0 UL0 DL0 DR0 UF1 DF1 BL0 BR0 UFL1 UBL0 DFR1 DBR0 DFL2 UBR0 UFR2 DBL0 | |||
diff --git a/test/022_io_B32_read/02_scrambled.in b/test/022_io_B32_read/02_scrambled.in new file mode 100644 index 0000000..ed442fe --- /dev/null +++ b/test/022_io_B32_read/02_scrambled.in | |||
| @@ -0,0 +1 @@ | |||
| OINUTCXB=JCRIEDAbVaGH | |||
diff --git a/test/022_io_B32_read/02_scrambled.out b/test/022_io_B32_read/02_scrambled.out new file mode 100644 index 0000000..6a05bbc --- /dev/null +++ b/test/022_io_B32_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/022_io_B32_read/io_B32_read_tests.c b/test/022_io_B32_read/io_B32_read_tests.c new file mode 100644 index 0000000..cf987f7 --- /dev/null +++ b/test/022_io_B32_read/io_B32_read_tests.c | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | int main(void) { | ||
| 4 | char str[STRLENMAX], *aux; | ||
| 5 | cube_t cube; | ||
| 6 | |||
| 7 | aux = str; | ||
| 8 | while (fgets(aux, STRLENMAX, stdin) != NULL) | ||
| 9 | while (*aux != '\n') | ||
| 10 | aux++; | ||
| 11 | |||
| 12 | cube = readcube("B32", str); | ||
| 13 | |||
| 14 | if (iserror(cube)) { | ||
| 15 | printf("Error reading cube\n"); | ||
| 16 | } else if (!issolvable(cube)) { | ||
| 17 | printf("Cube is not solvable\n"); | ||
| 18 | } else { | ||
| 19 | writecube("H48", cube, str); | ||
| 20 | printf("%s\n", str); | ||
| 21 | } | ||
| 22 | |||
| 23 | return 0; | ||
| 24 | } | ||
