aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/061_inverse_trans/00_all.in0
-rw-r--r--test/061_inverse_trans/00_all.out0
-rw-r--r--test/061_inverse_trans/inverse_trans_tests.c38
-rw-r--r--test/100_gendata_cocsep/00_all.in0
-rw-r--r--test/100_gendata_cocsep/00_all.out1
-rw-r--r--test/100_gendata_cocsep/gendata_cocsep_tests.c14
-rw-r--r--test/test.h1
7 files changed, 54 insertions, 0 deletions
diff --git a/test/061_inverse_trans/00_all.in b/test/061_inverse_trans/00_all.in
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/061_inverse_trans/00_all.in
diff --git a/test/061_inverse_trans/00_all.out b/test/061_inverse_trans/00_all.out
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/061_inverse_trans/00_all.out
diff --git a/test/061_inverse_trans/inverse_trans_tests.c b/test/061_inverse_trans/inverse_trans_tests.c
new file mode 100644
index 0000000..77bd40b
--- /dev/null
+++ b/test/061_inverse_trans/inverse_trans_tests.c
@@ -0,0 +1,38 @@
1#include "../test.h"
2
3uint8_t readtrans(char *);
4uint8_t inverse_trans(uint8_t);
5cube_t applymoves(cube_t, char *);
6cube_t applytrans(cube_t, char *);
7extern char *transstr[];
8
9int main(void) {
10 uint8_t t, tinv;
11 cube_t cube;
12
13 for (t = 0; t < 48; t++) {
14 cube = solvedcube();
15 cube = applymoves(cube, "R");
16 cube = applymoves(cube, "U");
17 cube = applymoves(cube, "F");
18
19 cube = applytrans(cube, transstr[t]);
20 tinv = inverse_trans(t);
21 cube = applytrans(cube, transstr[tinv]);
22
23 if (iserror(cube)) {
24 printf("Error transforming cube\n");
25 } else if (!issolvable(cube)) {
26 printf("Transformed cube is not solvable\n");
27 } else {
28 cube = applymoves(cube, "F'");
29 cube = applymoves(cube, "U'");
30 cube = applymoves(cube, "R'");
31 if (!issolved(cube))
32 printf("%s: Error! Got %" PRIu8 "\n",
33 transstr[t], tinv);
34 }
35 }
36
37 return 0;
38}
diff --git a/test/100_gendata_cocsep/00_all.in b/test/100_gendata_cocsep/00_all.in
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/100_gendata_cocsep/00_all.in
diff --git a/test/100_gendata_cocsep/00_all.out b/test/100_gendata_cocsep/00_all.out
new file mode 100644
index 0000000..37b8c1d
--- /dev/null
+++ b/test/100_gendata_cocsep/00_all.out
@@ -0,0 +1 @@
1119788
diff --git a/test/100_gendata_cocsep/gendata_cocsep_tests.c b/test/100_gendata_cocsep/gendata_cocsep_tests.c
new file mode 100644
index 0000000..19dfa9f
--- /dev/null
+++ b/test/100_gendata_cocsep/gendata_cocsep_tests.c
@@ -0,0 +1,14 @@
1#include "../test.h"
2
3size_t gendata_cocsep(void *);
4
5int main(void) {
6 uint32_t buf[300000];
7 size_t result;
8
9 result = gendata_cocsep(buf);
10
11 printf("%zu\n", result);
12
13 return 0;
14}
diff --git a/test/test.h b/test/test.h
index 7c5400e..3cbfd10 100644
--- a/test/test.h
+++ b/test/test.h
@@ -22,5 +22,6 @@ typedef cube_t cube_fast_t;
22cube_t solvedcube(void); 22cube_t solvedcube(void);
23bool iserror(cube_t); 23bool iserror(cube_t);
24bool issolvable(cube_t); 24bool issolvable(cube_t);
25bool issolved(cube_t);
25cube_t readcube(char *, char *); 26cube_t readcube(char *, char *);
26void writecube(char *, cube_t, char *); 27void writecube(char *, cube_t, char *);

Generated with cgit - Back to sebastiano.tronto.net