aboutsummaryrefslogtreecommitdiff
path: root/test/020_io_B32_read_write
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-06-10 19:26:47 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-06-10 19:26:47 +0200
commit832ad3dcf3818e57c53304ea9b09a943e785a16b (patch)
treedb78b51e3eee74d293b38337eeb1a02e33c5aed6 /test/020_io_B32_read_write
parent1cecea625ed405c7203d1977e687da36d835fc9a (diff)
downloadnissy-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.in3
-rw-r--r--test/020_io_B32_read_write/00_garbage.out1
-rw-r--r--test/020_io_B32_read_write/01_solved.in1
-rw-r--r--test/020_io_B32_read_write/01_solved.out1
-rw-r--r--test/020_io_B32_read_write/02_F.in1
-rw-r--r--test/020_io_B32_read_write/02_F.out1
-rw-r--r--test/020_io_B32_read_write/03_scrambled.in1
-rw-r--r--test/020_io_B32_read_write/03_scrambled.out1
-rw-r--r--test/020_io_B32_read_write/io_B32_tests.c21
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 @@
1FUF0 UBBBR2 k4
2hello
3garbage
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
3int 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}

Generated with cgit - Back to sebastiano.tronto.net