aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--TODO.txt4
-rw-r--r--src/cube.c1
-rw-r--r--src/cube_avx2.h48
-rw-r--r--src/cube_portable.h36
-rw-r--r--src/solve_h48.h9
-rw-r--r--test/075_set_eo/00_solved_0.in2
-rw-r--r--test/075_set_eo/00_solved_0.out1
-rw-r--r--test/075_set_eo/01_solved_1.in2
-rw-r--r--test/075_set_eo/01_solved_1.out1
-rw-r--r--test/075_set_eo/02_solved_other.in2
-rw-r--r--test/075_set_eo/02_solved_other.out1
-rw-r--r--test/075_set_eo/03_solved_firstlast.in2
-rw-r--r--test/075_set_eo/03_solved_firstlast.out1
-rw-r--r--test/075_set_eo/10_scrambled_0.in4
-rw-r--r--test/075_set_eo/10_scrambled_0.out1
-rw-r--r--test/075_set_eo/11_scrambled_1.in4
-rw-r--r--test/075_set_eo/11_scrambled_1.out1
-rw-r--r--test/075_set_eo/set_eo_tests.c38
-rw-r--r--test/076_copy_corners/00_solved_scrambled.in2
-rw-r--r--test/076_copy_corners/00_solved_scrambled.out1
-rw-r--r--test/076_copy_corners/copy_corners_tests.c33
-rw-r--r--test/077_copy_edges/00_solved_scrambled.in2
-rw-r--r--test/077_copy_edges/00_solved_scrambled.out1
-rw-r--r--test/077_copy_edges/copy_edges_tests.c33
-rwxr-xr-xtest/test41
-rw-r--r--test/test.h1
26 files changed, 252 insertions, 20 deletions
diff --git a/TODO.txt b/TODO.txt
index e8a6496..5441a9f 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,7 +1,7 @@
1In progress: go back to nissy-style BFS for eosep data computation 1In progress: go back to nissy-style BFS for eosep data computation
2 - (done) compute selfsim and cocsep representatives 2 - (done) compute selfsim and cocsep representatives
3 - implement set_eo_fast for invcoord_h48 (with tests for set_eo_fast) 3 - (done) implement set_eo_fast for invcoord_h48
4 also: implement other set_stuff methods for fast cube representation 4 - add unit tests for invcoord_h48 (compute tables, if needed)
5 - in gendata_esep, compute representatives for esep inverse coordinate 5 - in gendata_esep, compute representatives for esep inverse coordinate
6 - change to BFS 6 - change to BFS
7 7
diff --git a/src/cube.c b/src/cube.c
index 27d54b4..a6b733e 100644
--- a/src/cube.c
+++ b/src/cube.c
@@ -1,5 +1,6 @@
1#include <inttypes.h> 1#include <inttypes.h>
2#include <stdbool.h> 2#include <stdbool.h>
3#include <stdlib.h> /* TODO: Used only for malloc, remove if possible */
3#include <string.h> 4#include <string.h>
4 5
5#ifdef DEBUG 6#ifdef DEBUG
diff --git a/src/cube_avx2.h b/src/cube_avx2.h
index 42fb9d1..8d1c940 100644
--- a/src/cube_avx2.h
+++ b/src/cube_avx2.h
@@ -23,9 +23,12 @@ _static_inline int64_t coord_fast_co(cube_fast_t);
23_static_inline int64_t coord_fast_csep(cube_fast_t); 23_static_inline int64_t coord_fast_csep(cube_fast_t);
24_static_inline int64_t coord_fast_cocsep(cube_fast_t); 24_static_inline int64_t coord_fast_cocsep(cube_fast_t);
25_static_inline int64_t coord_fast_eo(cube_fast_t); 25_static_inline int64_t coord_fast_eo(cube_fast_t);
26_static_inline void set_eo_fast(cube_fast_t *, int64_t);
27_static_inline int64_t coord_fast_esep(cube_fast_t); 26_static_inline int64_t coord_fast_esep(cube_fast_t);
28 27
28_static_inline void copy_corners_fast(cube_fast_t *, cube_fast_t);
29_static_inline void copy_edges_fast(cube_fast_t *, cube_fast_t);
30_static_inline void set_eo_fast(cube_fast_t *, int64_t);
31
29_static_inline cube_fast_t 32_static_inline cube_fast_t
30fastcube( 33fastcube(
31 uint8_t c_ufr, 34 uint8_t c_ufr,
@@ -199,12 +202,6 @@ coord_fast_eo(cube_fast_t c)
199 return mask >> 17; 202 return mask >> 17;
200} 203}
201 204
202_static_inline void
203set_eo_fast(cube_fast_t *c, int64_t eo)
204{
205 /* TODO */
206}
207
208_static_inline int64_t 205_static_inline int64_t
209coord_fast_esep(cube_fast_t c) 206coord_fast_esep(cube_fast_t c)
210{ 207{
@@ -234,3 +231,40 @@ coord_fast_esep(cube_fast_t c)
234 231
235 return ret1 * 70 + ret2; 232 return ret1 * 70 + ret2;
236} 233}
234
235_static_inline void
236copy_corners_fast(cube_fast_t *dest, cube_fast_t src)
237{
238 *dest = _mm256_blend_epi32(*dest, src, 0x0F);
239}
240
241_static_inline void
242copy_edges_fast(cube_fast_t *dest, cube_fast_t src)
243{
244 *dest = _mm256_blend_epi32(*dest, src, 0xF0);
245}
246
247_static_inline void
248set_eo_fast(cube_fast_t *cube, int64_t eo)
249{
250 int64_t eo12, eotop, eobot;
251 __m256i veo;
252
253 eo12 = (eo << 1) + (_mm_popcnt_u64(eo) % 2);
254 eotop = (eo12 & (1 << 11)) << 17 |
255 (eo12 & (1 << 10)) << 10 |
256 (eo12 & (1 << 9)) << 3 |
257 (eo12 & (1 << 8)) >> 4;
258 eobot = (eo12 & (1 << 7)) << 53 |
259 (eo12 & (1 << 6)) << 46 |
260 (eo12 & (1 << 5)) << 39 |
261 (eo12 & (1 << 4)) << 32 |
262 (eo12 & (1 << 3)) << 25 |
263 (eo12 & (1 << 2)) << 18 |
264 (eo12 & (1 << 1)) << 11 |
265 (eo12 & 1) << 4;
266 veo = _mm256_set_epi64x(eotop, eobot, 0, 0);
267
268 *cube = _mm256_andnot_si256(_eo_avx2, *cube);
269 *cube = _mm256_or_si256(*cube, veo);
270}
diff --git a/src/cube_portable.h b/src/cube_portable.h
index fcd1d55..125c300 100644
--- a/src/cube_portable.h
+++ b/src/cube_portable.h
@@ -17,9 +17,12 @@ _static_inline int64_t coord_fast_co(cube_fast_t);
17_static_inline int64_t coord_fast_csep(cube_fast_t); 17_static_inline int64_t coord_fast_csep(cube_fast_t);
18_static_inline int64_t coord_fast_cocsep(cube_fast_t); 18_static_inline int64_t coord_fast_cocsep(cube_fast_t);
19_static_inline int64_t coord_fast_eo(cube_fast_t); 19_static_inline int64_t coord_fast_eo(cube_fast_t);
20_static_inline void set_eo_fast(cube_fast_t *, int64_t eo);
21_static_inline int64_t coord_fast_esep(cube_fast_t); 20_static_inline int64_t coord_fast_esep(cube_fast_t);
22 21
22_static_inline void copy_corners_fast(cube_fast_t *, cube_fast_t);
23_static_inline void copy_edges_fast(cube_fast_t *, cube_fast_t);
24_static_inline void set_eo_fast(cube_fast_t *, int64_t);
25
23_static_inline cube_fast_t 26_static_inline cube_fast_t
24fastcube( 27fastcube(
25 uint8_t c_ufr, 28 uint8_t c_ufr,
@@ -189,12 +192,6 @@ coord_fast_eo(cube_fast_t c)
189 return ret; 192 return ret;
190} 193}
191 194
192_static_inline void
193_set_eo_fast(cube_fast_t *cube, int64_t eo)
194{
195 /* TODO */
196}
197
198/* 195/*
199We encode the edge separation as a number from 0 to C(12,4)*C(8,4). 196We encode the edge separation as a number from 0 to C(12,4)*C(8,4).
200It can be seen as the composition of two "subset index" coordinates. 197It can be seen as the composition of two "subset index" coordinates.
@@ -229,3 +226,28 @@ coord_fast_esep(cube_fast_t c)
229 226
230 return ret1 * 70 + ret2; 227 return ret1 * 70 + ret2;
231} 228}
229
230_static_inline void
231copy_corners_fast(cube_fast_t *dest, cube_fast_t src)
232{
233 memcpy(&dest->corner, src.corner, sizeof(src.corner));
234}
235
236_static_inline void
237copy_edges_fast(cube_fast_t *dest, cube_fast_t src)
238{
239 memcpy(&dest->edge, src.edge, sizeof(src.edge));
240}
241
242_static_inline void
243set_eo_fast(cube_fast_t *cube, int64_t eo)
244{
245 int i, sum, flip;
246
247 for (sum = 0, i = 1; i < 12; i++, eo >>= 1) {
248 flip = eo % 2;
249 sum += flip;
250 cube->edge[i] = (cube->edge[i] & ~_eobit) | (_eobit * flip);
251 }
252 cube->edge[0] = (cube->edge[0] & ~_eobit) | (_eobit * (sum%2));
253}
diff --git a/src/solve_h48.h b/src/solve_h48.h
index e3e6de1..2fe1d69 100644
--- a/src/solve_h48.h
+++ b/src/solve_h48.h
@@ -88,16 +88,17 @@ invcoord_h48(
88 cube_fast_t ret; 88 cube_fast_t ret;
89 int64_t coclass, ee, esep, eo; 89 int64_t coclass, ee, esep, eo;
90 90
91 DBG_ASSERT(h <= 11, cubetofast(zero),
92 "invcoord_h48: h must be between 0 and 11\n");
93
91 coclass = i / H48_ESIZE; 94 coclass = i / H48_ESIZE;
92 ee = i % H48_ESIZE; 95 ee = i % H48_ESIZE;
93 esep = ee >> h; 96 esep = ee >> h;
94 eo = (ee & ((1<<h)-1)) << (11-h); 97 eo = (ee & ((1<<h)-1)) << (11-h);
95 98
96/* TODO: implement set_stuff methods 99 copy_corners_fast(&ret, crep[coclass]);
97 ret.c = crep[coclass]; 100 copy_edges_fast(&ret, erep[esep]);
98 ret.e = erep[esep];
99 set_eo_fast(&ret, eo); 101 set_eo_fast(&ret, eo);
100*/
101 102
102 return ret; 103 return ret;
103} 104}
diff --git a/test/075_set_eo/00_solved_0.in b/test/075_set_eo/00_solved_0.in
new file mode 100644
index 0000000..55bb6bf
--- /dev/null
+++ b/test/075_set_eo/00_solved_0.in
@@ -0,0 +1,2 @@
1UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
20
diff --git a/test/075_set_eo/00_solved_0.out b/test/075_set_eo/00_solved_0.out
new file mode 100644
index 0000000..dff224d
--- /dev/null
+++ b/test/075_set_eo/00_solved_0.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/075_set_eo/01_solved_1.in b/test/075_set_eo/01_solved_1.in
new file mode 100644
index 0000000..edd864e
--- /dev/null
+++ b/test/075_set_eo/01_solved_1.in
@@ -0,0 +1,2 @@
1UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
22047
diff --git a/test/075_set_eo/01_solved_1.out b/test/075_set_eo/01_solved_1.out
new file mode 100644
index 0000000..ec7594a
--- /dev/null
+++ b/test/075_set_eo/01_solved_1.out
@@ -0,0 +1 @@
UF1 UB1 DB1 DF1 UR1 UL1 DL1 DR1 FR1 FL1 BL1 BR1 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
diff --git a/test/075_set_eo/02_solved_other.in b/test/075_set_eo/02_solved_other.in
new file mode 100644
index 0000000..17e9b02
--- /dev/null
+++ b/test/075_set_eo/02_solved_other.in
@@ -0,0 +1,2 @@
1UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
220
diff --git a/test/075_set_eo/02_solved_other.out b/test/075_set_eo/02_solved_other.out
new file mode 100644
index 0000000..df73ef8
--- /dev/null
+++ b/test/075_set_eo/02_solved_other.out
@@ -0,0 +1 @@
UF0 UB0 DB0 DF1 UR0 UL1 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
diff --git a/test/075_set_eo/03_solved_firstlast.in b/test/075_set_eo/03_solved_firstlast.in
new file mode 100644
index 0000000..a16a192
--- /dev/null
+++ b/test/075_set_eo/03_solved_firstlast.in
@@ -0,0 +1,2 @@
1UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
21024
diff --git a/test/075_set_eo/03_solved_firstlast.out b/test/075_set_eo/03_solved_firstlast.out
new file mode 100644
index 0000000..8679be3
--- /dev/null
+++ b/test/075_set_eo/03_solved_firstlast.out
@@ -0,0 +1 @@
UF1 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR1 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
diff --git a/test/075_set_eo/10_scrambled_0.in b/test/075_set_eo/10_scrambled_0.in
new file mode 100644
index 0000000..55dccca
--- /dev/null
+++ b/test/075_set_eo/10_scrambled_0.in
@@ -0,0 +1,4 @@
1UL0 BL0 BR1 DL0 FR0 DF0 DB1 DR1 UB0 FL0 UF0 UR1 DFL0 UFR1 DBR1 UBR2 DBL2 DFR0 UFL1 UBL2
20
3
4// Scramble: U R D' L D' F L2 D L F B D2 B' L2 F U2 L2 D2 R2 L2 B'
diff --git a/test/075_set_eo/10_scrambled_0.out b/test/075_set_eo/10_scrambled_0.out
new file mode 100644
index 0000000..0eabd6e
--- /dev/null
+++ b/test/075_set_eo/10_scrambled_0.out
@@ -0,0 +1 @@
UL0 BL0 BR0 DL0 FR0 DF0 DB0 DR0 UB0 FL0 UF0 UR0 DFL0 UFR1 DBR1 UBR2 DBL2 DFR0 UFL1 UBL2
diff --git a/test/075_set_eo/11_scrambled_1.in b/test/075_set_eo/11_scrambled_1.in
new file mode 100644
index 0000000..0037a04
--- /dev/null
+++ b/test/075_set_eo/11_scrambled_1.in
@@ -0,0 +1,4 @@
1UL0 BL0 BR1 DL0 FR0 DF0 DB1 DR1 UB0 FL0 UF0 UR1 DFL0 UFR1 DBR1 UBR2 DBL2 DFR0 UFL1 UBL2
22047
3
4// Scramble: U R D' L D' F L2 D L F B D2 B' L2 F U2 L2 D2 R2 L2 B'
diff --git a/test/075_set_eo/11_scrambled_1.out b/test/075_set_eo/11_scrambled_1.out
new file mode 100644
index 0000000..843df0d
--- /dev/null
+++ b/test/075_set_eo/11_scrambled_1.out
@@ -0,0 +1 @@
UL1 BL1 BR1 DL1 FR1 DF1 DB1 DR1 UB1 FL1 UF1 UR1 DFL0 UFR1 DBR1 UBR2 DBL2 DFR0 UFL1 UBL2
diff --git a/test/075_set_eo/set_eo_tests.c b/test/075_set_eo/set_eo_tests.c
new file mode 100644
index 0000000..ef7215a
--- /dev/null
+++ b/test/075_set_eo/set_eo_tests.c
@@ -0,0 +1,38 @@
1#include "../test.h"
2
3int64_t coord_fast_eo(cube_fast_t);
4void set_eo_fast(cube_fast_t *, int64_t);
5cube_fast_t cubetofast(cube_t);
6cube_t fasttocube(cube_fast_t);
7
8int main(void) {
9 char str[STRLENMAX];
10 cube_t cube;
11 cube_fast_t fast;
12 int64_t eo;
13
14 fgets(str, STRLENMAX, stdin);
15 cube = readcube("H48", str);
16 fast = cubetofast(cube);
17 fgets(str, STRLENMAX, stdin);
18 eo = atoi(str);
19
20 set_eo_fast(&fast, eo);
21
22 cube = fasttocube(fast);
23 if (iserror(cube)) {
24 printf("Error setting EO\n");
25 } else if (!isconsistent(cube)) {
26 fprintf(stderr, "edges: ");
27 for (int i = 0; i < 12; i++) fprintf(stderr, "%d ", cube.edge[i]);
28 fprintf(stderr, "\n");
29 for (int i = 0; i < 8; i++) fprintf(stderr, "%d ", cube.corner[i]);
30 fprintf(stderr, "\n");
31 printf("Setting EO resulted in inconsistent cube\n");
32 } else {
33 writecube("H48", cube, str);
34 printf("%s\n", str);
35 }
36
37 return 0;
38}
diff --git a/test/076_copy_corners/00_solved_scrambled.in b/test/076_copy_corners/00_solved_scrambled.in
new file mode 100644
index 0000000..2ff0e6a
--- /dev/null
+++ b/test/076_copy_corners/00_solved_scrambled.in
@@ -0,0 +1,2 @@
1UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
2UL0 BL0 BR1 DL0 FR0 DF0 DB1 DR1 UB0 FL0 UF0 UR1 DFL0 UFR1 DBR1 UBR2 DBL2 DFR0 UFL1 UBL2
diff --git a/test/076_copy_corners/00_solved_scrambled.out b/test/076_copy_corners/00_solved_scrambled.out
new file mode 100644
index 0000000..9c53bcc
--- /dev/null
+++ b/test/076_copy_corners/00_solved_scrambled.out
@@ -0,0 +1 @@
UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 DFL0 UFR1 DBR1 UBR2 DBL2 DFR0 UFL1 UBL2
diff --git a/test/076_copy_corners/copy_corners_tests.c b/test/076_copy_corners/copy_corners_tests.c
new file mode 100644
index 0000000..fecf14a
--- /dev/null
+++ b/test/076_copy_corners/copy_corners_tests.c
@@ -0,0 +1,33 @@
1#include "../test.h"
2
3void copy_corners_fast(cube_fast_t *, cube_fast_t);
4cube_fast_t cubetofast(cube_t);
5cube_t fasttocube(cube_fast_t);
6
7int main(void) {
8 char str[STRLENMAX];
9 cube_t c1, c2;
10 cube_fast_t f1, f2;
11
12 fgets(str, STRLENMAX, stdin);
13 c1 = readcube("H48", str);
14 f1 = cubetofast(c1);
15
16 fgets(str, STRLENMAX, stdin);
17 c2 = readcube("H48", str);
18 f2 = cubetofast(c2);
19
20 copy_corners_fast(&f1, f2);
21
22 c1 = fasttocube(f1);
23 if (iserror(c1)) {
24 printf("Error setting EO\n");
25 } else if (!isconsistent(c1)) {
26 printf("Setting EO resulted in inconsistent cube\n");
27 } else {
28 writecube("H48", c1, str);
29 printf("%s\n", str);
30 }
31
32 return 0;
33}
diff --git a/test/077_copy_edges/00_solved_scrambled.in b/test/077_copy_edges/00_solved_scrambled.in
new file mode 100644
index 0000000..2ff0e6a
--- /dev/null
+++ b/test/077_copy_edges/00_solved_scrambled.in
@@ -0,0 +1,2 @@
1UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
2UL0 BL0 BR1 DL0 FR0 DF0 DB1 DR1 UB0 FL0 UF0 UR1 DFL0 UFR1 DBR1 UBR2 DBL2 DFR0 UFL1 UBL2
diff --git a/test/077_copy_edges/00_solved_scrambled.out b/test/077_copy_edges/00_solved_scrambled.out
new file mode 100644
index 0000000..3af84f4
--- /dev/null
+++ b/test/077_copy_edges/00_solved_scrambled.out
@@ -0,0 +1 @@
UL0 BL0 BR1 DL0 FR0 DF0 DB1 DR1 UB0 FL0 UF0 UR1 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
diff --git a/test/077_copy_edges/copy_edges_tests.c b/test/077_copy_edges/copy_edges_tests.c
new file mode 100644
index 0000000..c3e70a3
--- /dev/null
+++ b/test/077_copy_edges/copy_edges_tests.c
@@ -0,0 +1,33 @@
1#include "../test.h"
2
3void copy_edges_fast(cube_fast_t *, cube_fast_t);
4cube_fast_t cubetofast(cube_t);
5cube_t fasttocube(cube_fast_t);
6
7int main(void) {
8 char str[STRLENMAX];
9 cube_t c1, c2;
10 cube_fast_t f1, f2;
11
12 fgets(str, STRLENMAX, stdin);
13 c1 = readcube("H48", str);
14 f1 = cubetofast(c1);
15
16 fgets(str, STRLENMAX, stdin);
17 c2 = readcube("H48", str);
18 f2 = cubetofast(c2);
19
20 copy_edges_fast(&f1, f2);
21
22 c1 = fasttocube(f1);
23 if (iserror(c1)) {
24 printf("Error setting EO\n");
25 } else if (!isconsistent(c1)) {
26 printf("Setting EO resulted in inconsistent cube\n");
27 } else {
28 writecube("H48", c1, str);
29 printf("%s\n", str);
30 }
31
32 return 0;
33}
diff --git a/test/test b/test/test
new file mode 100755
index 0000000..3adee3a
--- /dev/null
+++ b/test/test
@@ -0,0 +1,41 @@
1#!/bin/sh
2
3detectsan() { cc -fsanitize=$1 -dM -E -x c - </dev/null | grep "SANITIZE"; }
4
5re="${TEST:-$@}"
6
7CC="cc -DDEBUG -std=c99 -pedantic -Wall -Wextra \
8 -Wno-unused-parameter -Wno-unused-function -g3 -D$CUBETYPE"
9
10[ "$CUBETYPE" = "CUBE_AVX2" ] && CC="$CC -mavx2"
11[ -n "$(detectsan address)" ] && CC="$CC -fsanitize=address"
12[ -n "$(detectsan undefined)" ] && CC="$CC -fsanitize=undefined"
13
14TESTBIN="test/run"
15TESTOUT="test/last.out"
16TESTERR="test/last.err"
17CUBEOBJ="debugcube.o"
18
19for t in test/*; do
20 if [ -n "$re" ] && [ -z "$(echo "$t" | grep "$re")" ]; then
21 continue
22 fi
23 if [ ! -d $t ]; then continue; fi
24 $CC -o $TESTBIN $t/*.c $CUBEOBJ || exit 1;
25 for cin in $t/*.in; do
26 c=$(echo "$cin" | sed 's/\.in//')
27 cout=$c.out
28 printf "$c: "
29 $TESTBIN < "$cin" > $TESTOUT 2> $TESTERR
30 if diff $cout $TESTOUT; then
31 printf "OK\n"
32 else
33 printf "Test failed! stderr:\n"
34 cat $TESTERR
35 exit 1
36 fi
37 done
38done
39
40echo "All tests passed!"
41rm -rf $TESTBIN $TESTOUT $TESTERR $CUBEOBJ
diff --git a/test/test.h b/test/test.h
index 3cbfd10..2086283 100644
--- a/test/test.h
+++ b/test/test.h
@@ -21,6 +21,7 @@ typedef cube_t cube_fast_t;
21/* Basic functions used in most tests */ 21/* Basic functions used in most tests */
22cube_t solvedcube(void); 22cube_t solvedcube(void);
23bool iserror(cube_t); 23bool iserror(cube_t);
24bool isconsistent(cube_t);
24bool issolvable(cube_t); 25bool issolvable(cube_t);
25bool issolved(cube_t); 26bool issolved(cube_t);
26cube_t readcube(char *, char *); 27cube_t readcube(char *, char *);

Generated with cgit - Back to sebastiano.tronto.net