diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-06-10 19:26:47 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-06-10 19:26:47 +0200 |
| commit | 832ad3dcf3818e57c53304ea9b09a943e785a16b (patch) | |
| tree | db78b51e3eee74d293b38337eeb1a02e33c5aed6 /test/020_io_B32_read_write | |
| parent | 1cecea625ed405c7203d1977e687da36d835fc9a (diff) | |
| download | nissy-core-832ad3dcf3818e57c53304ea9b09a943e785a16b.tar.gz nissy-core-832ad3dcf3818e57c53304ea9b09a943e785a16b.zip | |
Added tests for B32
Diffstat (limited to 'test/020_io_B32_read_write')
| -rw-r--r-- | test/020_io_B32_read_write/00_garbage.in | 3 | ||||
| -rw-r--r-- | test/020_io_B32_read_write/00_garbage.out | 1 | ||||
| -rw-r--r-- | test/020_io_B32_read_write/01_solved.in | 1 | ||||
| -rw-r--r-- | test/020_io_B32_read_write/01_solved.out | 1 | ||||
| -rw-r--r-- | test/020_io_B32_read_write/02_F.in | 1 | ||||
| -rw-r--r-- | test/020_io_B32_read_write/02_F.out | 1 | ||||
| -rw-r--r-- | test/020_io_B32_read_write/03_scrambled.in | 1 | ||||
| -rw-r--r-- | test/020_io_B32_read_write/03_scrambled.out | 1 | ||||
| -rw-r--r-- | test/020_io_B32_read_write/io_B32_tests.c | 21 |
9 files changed, 31 insertions, 0 deletions
diff --git a/test/020_io_B32_read_write/00_garbage.in b/test/020_io_B32_read_write/00_garbage.in new file mode 100644 index 0000000..9ac203a --- /dev/null +++ b/test/020_io_B32_read_write/00_garbage.in | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | FUF0 UBBBR2 k4 | ||
| 2 | hello | ||
| 3 | garbage | ||
diff --git a/test/020_io_B32_read_write/00_garbage.out b/test/020_io_B32_read_write/00_garbage.out new file mode 100644 index 0000000..5b9114e --- /dev/null +++ b/test/020_io_B32_read_write/00_garbage.out | |||
| @@ -0,0 +1 @@ | |||
| Error reading cube | |||
diff --git a/test/020_io_B32_read_write/01_solved.in b/test/020_io_B32_read_write/01_solved.in new file mode 100644 index 0000000..e1df94b --- /dev/null +++ b/test/020_io_B32_read_write/01_solved.in | |||
| @@ -0,0 +1 @@ | |||
| ABCDEFGH=ABCDEFGHIJKL | |||
diff --git a/test/020_io_B32_read_write/01_solved.out b/test/020_io_B32_read_write/01_solved.out new file mode 100644 index 0000000..e1df94b --- /dev/null +++ b/test/020_io_B32_read_write/01_solved.out | |||
| @@ -0,0 +1 @@ | |||
| ABCDEFGH=ABCDEFGHIJKL | |||
diff --git a/test/020_io_B32_read_write/02_F.in b/test/020_io_B32_read_write/02_F.in new file mode 100644 index 0000000..1677251 --- /dev/null +++ b/test/020_io_B32_read_write/02_F.in | |||
| @@ -0,0 +1 @@ | |||
| MBODSFQH=ZBCYEFGHQTKL | |||
diff --git a/test/020_io_B32_read_write/02_F.out b/test/020_io_B32_read_write/02_F.out new file mode 100644 index 0000000..1677251 --- /dev/null +++ b/test/020_io_B32_read_write/02_F.out | |||
| @@ -0,0 +1 @@ | |||
| MBODSFQH=ZBCYEFGHQTKL | |||
diff --git a/test/020_io_B32_read_write/03_scrambled.in b/test/020_io_B32_read_write/03_scrambled.in new file mode 100644 index 0000000..ed442fe --- /dev/null +++ b/test/020_io_B32_read_write/03_scrambled.in | |||
| @@ -0,0 +1 @@ | |||
| OINUTCXB=JCRIEDAbVaGH | |||
diff --git a/test/020_io_B32_read_write/03_scrambled.out b/test/020_io_B32_read_write/03_scrambled.out new file mode 100644 index 0000000..ed442fe --- /dev/null +++ b/test/020_io_B32_read_write/03_scrambled.out | |||
| @@ -0,0 +1 @@ | |||
| OINUTCXB=JCRIEDAbVaGH | |||
diff --git a/test/020_io_B32_read_write/io_B32_tests.c b/test/020_io_B32_read_write/io_B32_tests.c new file mode 100644 index 0000000..1953453 --- /dev/null +++ b/test/020_io_B32_read_write/io_B32_tests.c | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | int main(void) { | ||
| 4 | char str[STRLENMAX]; | ||
| 5 | cube_t cube; | ||
| 6 | |||
| 7 | fgets(str, STRLENMAX, stdin); | ||
| 8 | |||
| 9 | cube = readcube("B32", str); | ||
| 10 | |||
| 11 | if (iserror(cube)) { | ||
| 12 | printf("Error reading cube\n"); | ||
| 13 | } else if (!issolvable(cube)) { | ||
| 14 | printf("Cube is not solvable\n"); | ||
| 15 | } else { | ||
| 16 | writecube("B32", cube, str); | ||
| 17 | printf("%s\n", str); | ||
| 18 | } | ||
| 19 | |||
| 20 | return 0; | ||
| 21 | } | ||
