aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--TODO.txt1
-rw-r--r--old/benchmark/results/results-2023-10-31-18-54-37.txt32
-rw-r--r--old/benchmark/results/results-2023-10-31-19-13-49.txt32
-rw-r--r--old/benchmark/results/results-2023-11-01-20-55-21.txt32
-rw-r--r--old/benchmark/results/results-2023-11-03-23-08-50.txt18
-rw-r--r--old/benchmark/results/results-2023-11-03-23-10-40.txt32
-rw-r--r--old/benchmark/results/results-2023-11-04-10-22-43.txt32
-rw-r--r--old/benchmark/results/results-2023-11-04-10-23-11.txt32
-rw-r--r--old/benchmark/results/results-2023-11-04-10-23-43.txt32
-rw-r--r--old/benchmark/results/results-2023-11-04-10-24-08.txt32
-rw-r--r--old/benchmark/results/results-2023-11-04-10-52-05.txt32
-rw-r--r--old/benchmark/results/results-2023-11-04-10-53-06.txt32
-rw-r--r--old/benchmark/results/results-2023-11-04-10-57-46.txt32
-rw-r--r--old/benchmark/results/results-2023-11-10-15-49-45.txt28
-rw-r--r--old/benchmark/results/results.txt28
-rw-r--r--test/00_basic/basic_tests.c13
-rw-r--r--test/010_io_H48_read_write/io_H48_tests.c12
-rw-r--r--test/011_io_SRC_write/io_SRC_tests.c12
-rw-r--r--test/012_io_AVX_write/io_AVX_tests.c15
-rw-r--r--test/020_move/move_tests.c13
-rw-r--r--test/030_inverse_cube/inverse_tests.c12
-rw-r--r--test/040_compose/compose_tests.c12
-rw-r--r--test/050_transform/transform_tests.c12
-rw-r--r--test/061_coord_eo/coord_eo_tests.c10
-rw-r--r--test/070_solve_simple/solve_simple_tests.c38
-rw-r--r--test/test.h21
27 files changed, 56 insertions, 542 deletions
diff --git a/.gitignore b/.gitignore
index 7991e49..ec1e51b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
1config.mk 1config.mk
2benchmark/results 2benchmark/results
3old/benchmark/results
3benchmark/run 4benchmark/run
4test/*/runtest 5test/*/runtest
5test/run 6test/run
diff --git a/TODO.txt b/TODO.txt
index 0767358..bdf7686 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -21,6 +21,7 @@ See the sections below for details
21 21
22## Small change 22## Small change
23 23
24* solve tests: make smaller, split
24* add lots of tests for things that were static, now visible 25* add lots of tests for things that were static, now visible
25 26
26## Solving 27## Solving
diff --git a/old/benchmark/results/results-2023-10-31-18-54-37.txt b/old/benchmark/results/results-2023-10-31-18-54-37.txt
deleted file mode 100644
index c0f84e5..0000000
--- a/old/benchmark/results/results-2023-10-31-18-54-37.txt
+++ /dev/null
@@ -1,32 +0,0 @@
1Benchmarks settings:
2MOVES: 100000000
3TRANS: 100000000
4COMP: 100000000
5INV: 100000000
6
7> moves: setting up benchmark...
8> moves: running benchmark...
9> moves: resulting cube, first piece: UR0
10> moves: 3.5626s
11
12> trans: setting up benchmark...
13> trans: running benchmark...
14> trans: resulting cube, first piece: UF0
15> trans: 9.9028s
16
17> comp: setting up benchmark...
18> comp: running benchmark...
19> comp: resulting cube, first piece: UF0
20> comp: 2.9944s
21
22> inv: setting up benchmark...
23> inv: running benchmark...
24> comp: resulting cube, first piece: DB0
25> inv: 2.6475s
26
27Benchmark summary:
28moves: 100000000 moves in 3.5626s (28.0697 MTPS)
29trans: 100000000 trans in 9.9028s (10.0981 MTPS)
30comp: 100000000 comps in 2.9944s (33.3956 MCPS)
31inv: 100000000 invs in 2.6475s (37.7714 MIPS)
32Total time: 19.1073
diff --git a/old/benchmark/results/results-2023-10-31-19-13-49.txt b/old/benchmark/results/results-2023-10-31-19-13-49.txt
deleted file mode 100644
index b0716f1..0000000
--- a/old/benchmark/results/results-2023-10-31-19-13-49.txt
+++ /dev/null
@@ -1,32 +0,0 @@
1Benchmarks settings:
2MOVES: 100000000
3TRANS: 100000000
4COMP: 100000000
5INV: 100000000
6
7> moves: setting up benchmark...
8> moves: running benchmark...
9> moves: resulting cube, first piece: UF0
10> moves: 3.5096s
11
12> trans: setting up benchmark...
13> trans: running benchmark...
14> trans: resulting cube, first piece: UF0
15> trans: 9.8367s
16
17> comp: setting up benchmark...
18> comp: running benchmark...
19> comp: resulting cube, first piece: UF0
20> comp: 2.9693s
21
22> inv: setting up benchmark...
23> inv: running benchmark...
24> comp: resulting cube, first piece: FL0
25> inv: 2.6227s
26
27Benchmark summary:
28moves: 100000000 moves in 3.5096s (28.4930 MTPS)
29trans: 100000000 trans in 9.8367s (10.1660 MTPS)
30comp: 100000000 comps in 2.9693s (33.6784 MCPS)
31inv: 100000000 invs in 2.6227s (38.1283 MIPS)
32Total time: 18.9383
diff --git a/old/benchmark/results/results-2023-11-01-20-55-21.txt b/old/benchmark/results/results-2023-11-01-20-55-21.txt
deleted file mode 100644
index adf1fd8..0000000
--- a/old/benchmark/results/results-2023-11-01-20-55-21.txt
+++ /dev/null
@@ -1,32 +0,0 @@
1Benchmarks settings:
2MOVES: 100000000
3TRANS: 100000000
4COMP: 100000000
5INV: 100000000
6
7> moves: setting up benchmark...
8> moves: running benchmark...
9> moves: resulting cube, first piece: BL1
10> moves: 3.6556s
11
12> trans: setting up benchmark...
13> trans: running benchmark...
14> trans: resulting cube, first piece: UF0
15> trans: 7.5844s
16
17> comp: setting up benchmark...
18> comp: running benchmark...
19> comp: resulting cube, first piece: UF0
20> comp: 3.0103s
21
22> inv: setting up benchmark...
23> inv: running benchmark...
24> comp: resulting cube, first piece: DL0
25> inv: 2.6601s
26
27Benchmark summary:
28moves: 100000000 moves in 3.6556s (27.3556 MTPS)
29trans: 100000000 trans in 7.5844s (13.1850 MTPS)
30comp: 100000000 comps in 3.0103s (33.2191 MCPS)
31inv: 100000000 invs in 2.6601s (37.5929 MIPS)
32Total time: 16.9103
diff --git a/old/benchmark/results/results-2023-11-03-23-08-50.txt b/old/benchmark/results/results-2023-11-03-23-08-50.txt
deleted file mode 100644
index 12e2aa6..0000000
--- a/old/benchmark/results/results-2023-11-03-23-08-50.txt
+++ /dev/null
@@ -1,18 +0,0 @@
1Benchmarks settings:
2MOVES: 100000000
3TRANS: 100000000
4COMP: 100000000
5INV: 100000000
6
7> moves: setting up benchmark...
8> moves: running benchmark...
9> moves: resulting cube, first piece: ERR
10> moves: 6.6791s
11
12> trans: setting up benchmark...
13> trans: running benchmark...
14> trans: resulting cube, first piece: ERR
15> trans: 6.6844s
16
17> comp: setting up benchmark...
18> comp: running benchmark...
diff --git a/old/benchmark/results/results-2023-11-03-23-10-40.txt b/old/benchmark/results/results-2023-11-03-23-10-40.txt
deleted file mode 100644
index 5be1c1f..0000000
--- a/old/benchmark/results/results-2023-11-03-23-10-40.txt
+++ /dev/null
@@ -1,32 +0,0 @@
1Benchmarks settings:
2MOVES: 100000000
3TRANS: 100000000
4COMP: 100000000
5INV: 100000000
6
7> moves: setting up benchmark...
8> moves: running benchmark...
9> moves: resulting cube, first piece: BL1
10> moves: 1.6354s
11
12> trans: setting up benchmark...
13> trans: running benchmark...
14> trans: resulting cube, first piece: ERR
15> trans: 1.9863s
16
17> comp: setting up benchmark...
18> comp: running benchmark...
19> comp: resulting cube, first piece: UF0
20> comp: 0.3505s
21
22> inv: setting up benchmark...
23> inv: running benchmark...
24> comp: resulting cube, first piece: DL1
25> inv: 0.7249s
26
27Benchmark summary:
28moves: 100000000 moves in 1.6354s (61.1463 MTPS)
29trans: 100000000 trans in 1.9863s (50.3458 MTPS)
30comp: 100000000 comps in 0.3505s (285.3105 MCPS)
31inv: 100000000 invs in 0.7249s (137.9488 MIPS)
32Total time: 4.6971
diff --git a/old/benchmark/results/results-2023-11-04-10-22-43.txt b/old/benchmark/results/results-2023-11-04-10-22-43.txt
deleted file mode 100644
index 7a2c483..0000000
--- a/old/benchmark/results/results-2023-11-04-10-22-43.txt
+++ /dev/null
@@ -1,32 +0,0 @@
1Benchmarks settings:
2MOVES: 100000000
3TRANS: 100000000
4COMP: 100000000
5INV: 100000000
6
7> moves: setting up benchmark...
8> moves: running benchmark...
9> moves: resulting cube, first piece: UF0
10> moves: 1.3535s
11
12> trans: setting up benchmark...
13> trans: running benchmark...
14> trans: resulting cube, first piece: UF0
15> trans: 1.6526s
16
17> comp: setting up benchmark...
18> comp: running benchmark...
19> comp: resulting cube, first piece: UR0
20> comp: 0.2848s
21
22> inv: setting up benchmark...
23> inv: running benchmark...
24> comp: resulting cube, first piece: DF0
25> inv: 0.6598s
26
27Benchmark summary:
28moves: 100000000 moves in 1.3535s (73.8828 MTPS)
29trans: 100000000 trans in 1.6526s (60.5112 MTPS)
30comp: 100000000 comps in 0.2848s (351.1409 MCPS)
31inv: 100000000 invs in 0.6598s (151.5679 MIPS)
32Total time: 3.9506
diff --git a/old/benchmark/results/results-2023-11-04-10-23-11.txt b/old/benchmark/results/results-2023-11-04-10-23-11.txt
deleted file mode 100644
index f3a60de..0000000
--- a/old/benchmark/results/results-2023-11-04-10-23-11.txt
+++ /dev/null
@@ -1,32 +0,0 @@
1Benchmarks settings:
2MOVES: 100000000
3TRANS: 100000000
4COMP: 100000000
5INV: 100000000
6
7> moves: setting up benchmark...
8> moves: running benchmark...
9> moves: resulting cube, first piece: UL1
10> moves: 1.3463s
11
12> trans: setting up benchmark...
13> trans: running benchmark...
14> trans: resulting cube, first piece: UF0
15> trans: 1.6303s
16
17> comp: setting up benchmark...
18> comp: running benchmark...
19> comp: resulting cube, first piece: UF0
20> comp: 0.2881s
21
22> inv: setting up benchmark...
23> inv: running benchmark...
24> comp: resulting cube, first piece: UF0
25> inv: 0.6853s
26
27Benchmark summary:
28moves: 100000000 moves in 1.3463s (74.2803 MTPS)
29trans: 100000000 trans in 1.6303s (61.3400 MTPS)
30comp: 100000000 comps in 0.2881s (347.0564 MCPS)
31inv: 100000000 invs in 0.6853s (145.9211 MIPS)
32Total time: 3.9499
diff --git a/old/benchmark/results/results-2023-11-04-10-23-43.txt b/old/benchmark/results/results-2023-11-04-10-23-43.txt
deleted file mode 100644
index e1f557c..0000000
--- a/old/benchmark/results/results-2023-11-04-10-23-43.txt
+++ /dev/null
@@ -1,32 +0,0 @@
1Benchmarks settings:
2MOVES: 100000000
3TRANS: 100000000
4COMP: 100000000
5INV: 100000000
6
7> moves: setting up benchmark...
8> moves: running benchmark...
9> moves: resulting cube, first piece: UF0
10> moves: 1.3434s
11
12> trans: setting up benchmark...
13> trans: running benchmark...
14> trans: resulting cube, first piece: UF0
15> trans: 1.6439s
16
17> comp: setting up benchmark...
18> comp: running benchmark...
19> comp: resulting cube, first piece: UR1
20> comp: 0.2872s
21
22> inv: setting up benchmark...
23> inv: running benchmark...
24> comp: resulting cube, first piece: DF0
25> inv: 0.6646s
26
27Benchmark summary:
28moves: 100000000 moves in 1.3434s (74.4399 MTPS)
29trans: 100000000 trans in 1.6439s (60.8320 MTPS)
30comp: 100000000 comps in 0.2872s (348.1848 MCPS)
31inv: 100000000 invs in 0.6646s (150.4726 MIPS)
32Total time: 3.9390
diff --git a/old/benchmark/results/results-2023-11-04-10-24-08.txt b/old/benchmark/results/results-2023-11-04-10-24-08.txt
deleted file mode 100644
index 46eb403..0000000
--- a/old/benchmark/results/results-2023-11-04-10-24-08.txt
+++ /dev/null
@@ -1,32 +0,0 @@
1Benchmarks settings:
2MOVES: 100000000
3TRANS: 100000000
4COMP: 100000000
5INV: 100000000
6
7> moves: setting up benchmark...
8> moves: running benchmark...
9> moves: resulting cube, first piece: UF0
10> moves: 1.3330s
11
12> trans: setting up benchmark...
13> trans: running benchmark...
14> trans: resulting cube, first piece: UF0
15> trans: 1.6094s
16
17> comp: setting up benchmark...
18> comp: running benchmark...
19> comp: resulting cube, first piece: UF0
20> comp: 0.2827s
21
22> inv: setting up benchmark...
23> inv: running benchmark...
24> comp: resulting cube, first piece: BL0
25> inv: 0.6527s
26
27Benchmark summary:
28moves: 100000000 moves in 1.3330s (75.0200 MTPS)
29trans: 100000000 trans in 1.6094s (62.1335 MTPS)
30comp: 100000000 comps in 0.2827s (353.7582 MCPS)
31inv: 100000000 invs in 0.6527s (153.2026 MIPS)
32Total time: 3.8778
diff --git a/old/benchmark/results/results-2023-11-04-10-52-05.txt b/old/benchmark/results/results-2023-11-04-10-52-05.txt
deleted file mode 100644
index 597eddf..0000000
--- a/old/benchmark/results/results-2023-11-04-10-52-05.txt
+++ /dev/null
@@ -1,32 +0,0 @@
1Benchmarks settings:
2MOVES: 100000000
3TRANS: 100000000
4COMP: 100000000
5INV: 100000000
6
7> moves: setting up benchmark...
8> moves: running benchmark...
9> moves: resulting cube, first piece: UL0
10> moves: 3.6559s
11
12> trans: setting up benchmark...
13> trans: running benchmark...
14> trans: resulting cube, first piece: UF0
15> trans: 7.9072s
16
17> comp: setting up benchmark...
18> comp: running benchmark...
19> comp: resulting cube, first piece: BL1
20> comp: 3.3698s
21
22> inv: setting up benchmark...
23> inv: running benchmark...
24> comp: resulting cube, first piece: FL1
25> inv: 2.6933s
26
27Benchmark summary:
28moves: 100000000 moves in 3.6559s (27.3528 MTPS)
29trans: 100000000 trans in 7.9072s (12.6467 MTPS)
30comp: 100000000 comps in 3.3698s (29.6755 MCPS)
31inv: 100000000 invs in 2.6933s (37.1296 MIPS)
32Total time: 17.6262
diff --git a/old/benchmark/results/results-2023-11-04-10-53-06.txt b/old/benchmark/results/results-2023-11-04-10-53-06.txt
deleted file mode 100644
index 8543d81..0000000
--- a/old/benchmark/results/results-2023-11-04-10-53-06.txt
+++ /dev/null
@@ -1,32 +0,0 @@
1Benchmarks settings:
2MOVES: 100000000
3TRANS: 100000000
4COMP: 100000000
5INV: 100000000
6
7> moves: setting up benchmark...
8> moves: running benchmark...
9> moves: resulting cube, first piece: UR1
10> moves: 1.3554s
11
12> trans: setting up benchmark...
13> trans: running benchmark...
14> trans: resulting cube, first piece: UF0
15> trans: 1.6302s
16
17> comp: setting up benchmark...
18> comp: running benchmark...
19> comp: resulting cube, first piece: UF0
20> comp: 0.2880s
21
22> inv: setting up benchmark...
23> inv: running benchmark...
24> comp: resulting cube, first piece: DR1
25> inv: 0.6567s
26
27Benchmark summary:
28moves: 100000000 moves in 1.3554s (73.7816 MTPS)
29trans: 100000000 trans in 1.6302s (61.3423 MTPS)
30comp: 100000000 comps in 0.2880s (347.2758 MCPS)
31inv: 100000000 invs in 0.6567s (152.2870 MIPS)
32Total time: 3.9302
diff --git a/old/benchmark/results/results-2023-11-04-10-57-46.txt b/old/benchmark/results/results-2023-11-04-10-57-46.txt
deleted file mode 100644
index 1ad4579..0000000
--- a/old/benchmark/results/results-2023-11-04-10-57-46.txt
+++ /dev/null
@@ -1,32 +0,0 @@
1Benchmarks settings:
2MOVES: 100000000
3TRANS: 100000000
4COMP: 100000000
5INV: 100000000
6
7> moves: setting up benchmark...
8> moves: running benchmark...
9> moves: resulting cube, first piece: UL0
10> moves: 1.3518s
11
12> trans: setting up benchmark...
13> trans: running benchmark...
14> trans: resulting cube, first piece: UF0
15> trans: 1.6350s
16
17> comp: setting up benchmark...
18> comp: running benchmark...
19> comp: resulting cube, first piece: UF0
20> comp: 0.3039s
21
22> inv: setting up benchmark...
23> inv: running benchmark...
24> comp: resulting cube, first piece: UR1
25> inv: 0.6681s
26
27Benchmark summary:
28moves: 100000000 moves in 1.3518s (73.9734 MTPS)
29trans: 100000000 trans in 1.6350s (61.1621 MTPS)
30comp: 100000000 comps in 0.3039s (329.0593 MCPS)
31inv: 100000000 invs in 0.6681s (149.6737 MIPS)
32Total time: 3.9589
diff --git a/old/benchmark/results/results-2023-11-10-15-49-45.txt b/old/benchmark/results/results-2023-11-10-15-49-45.txt
deleted file mode 100644
index 6c64bc8..0000000
--- a/old/benchmark/results/results-2023-11-10-15-49-45.txt
+++ /dev/null
@@ -1,28 +0,0 @@
1Benchmarks settings:
2MOVES: 100000000
3TRANS: 100000000
4COMPOSE: 100000000
5INVERSE: 100000000
6
7> moves: running benchmark...
8> moves: resulting cube, first piece: UB0
9> moves: 0.0097s
10
11> trans: running benchmark...
12> trans: resulting cube, first piece: DB0
13> trans: 20.1464s
14
15> compose: running benchmark...
16> compose: resulting cube, first piece: ERR
17> compose: 3.7322s
18
19> inverse: running benchmark...
20> inverse: resulting cube, first piece: DB0
21> inverse: 2.1003s
22
23Benchmark summary:
24moves: 100000000 moves in 0.0097s (10259.5134 MTPS)
25trans: 100000000 transformations in 20.1464s (4.9637 MTPS)
26compose: 100000000 compositions in 3.7322s (26.7940 MCPS)
27inverse: 100000000 inverses in 2.1003s (47.6116 MIPS)
28Total time: 25.9886
diff --git a/old/benchmark/results/results.txt b/old/benchmark/results/results.txt
deleted file mode 100644
index 6c64bc8..0000000
--- a/old/benchmark/results/results.txt
+++ /dev/null
@@ -1,28 +0,0 @@
1Benchmarks settings:
2MOVES: 100000000
3TRANS: 100000000
4COMPOSE: 100000000
5INVERSE: 100000000
6
7> moves: running benchmark...
8> moves: resulting cube, first piece: UB0
9> moves: 0.0097s
10
11> trans: running benchmark...
12> trans: resulting cube, first piece: DB0
13> trans: 20.1464s
14
15> compose: running benchmark...
16> compose: resulting cube, first piece: ERR
17> compose: 3.7322s
18
19> inverse: running benchmark...
20> inverse: resulting cube, first piece: DB0
21> inverse: 2.1003s
22
23Benchmark summary:
24moves: 100000000 moves in 0.0097s (10259.5134 MTPS)
25trans: 100000000 transformations in 20.1464s (4.9637 MTPS)
26compose: 100000000 compositions in 3.7322s (26.7940 MCPS)
27inverse: 100000000 inverses in 2.1003s (47.6116 MIPS)
28Total time: 25.9886
diff --git a/test/00_basic/basic_tests.c b/test/00_basic/basic_tests.c
index af0f2cd..17f1b2b 100644
--- a/test/00_basic/basic_tests.c
+++ b/test/00_basic/basic_tests.c
@@ -1,13 +1,7 @@
1#include <stdbool.h> 1#include "../test.h"
2#include <stdint.h>
3#include <stdio.h>
4#include <string.h>
5 2
6#ifdef CUBE_AVX2 3bool issolved(cube_t);
7#include <immintrin.h> 4bool equal(cube_t, cube_t);
8#endif
9
10#include "../../cube.h"
11 5
12void 6void
13check(cube_t cube, char *name) 7check(cube_t cube, char *name)
@@ -19,7 +13,6 @@ check(cube_t cube, char *name)
19void 13void
20check2(cube_t cube1, char *name1, cube_t cube2, char *name2) 14check2(cube_t cube1, char *name1, cube_t cube2, char *name2)
21{ 15{
22fprintf(stderr, "check2 %s %s\n", name1, name2);
23 printf("%s and %s are%s equal\n", name1, name2, 16 printf("%s and %s are%s equal\n", name1, name2,
24 equal(cube1, cube2) ? "" : " NOT"); 17 equal(cube1, cube2) ? "" : " NOT");
25} 18}
diff --git a/test/010_io_H48_read_write/io_H48_tests.c b/test/010_io_H48_read_write/io_H48_tests.c
index 70d1a91..71df1e7 100644
--- a/test/010_io_H48_read_write/io_H48_tests.c
+++ b/test/010_io_H48_read_write/io_H48_tests.c
@@ -1,14 +1,4 @@
1#include <stdbool.h> 1#include "../test.h"
2#include <stdint.h>
3#include <stdio.h>
4
5#ifdef CUBE_AVX2
6#include <immintrin.h>
7#endif
8
9#include "../../cube.h"
10
11#define STRLENMAX 10000
12 2
13int main() { 3int main() {
14 char *c, str[STRLENMAX]; 4 char *c, str[STRLENMAX];
diff --git a/test/011_io_SRC_write/io_SRC_tests.c b/test/011_io_SRC_write/io_SRC_tests.c
index c2d10f6..5ae3d99 100644
--- a/test/011_io_SRC_write/io_SRC_tests.c
+++ b/test/011_io_SRC_write/io_SRC_tests.c
@@ -1,14 +1,4 @@
1#include <stdbool.h> 1#include "../test.h"
2#include <stdint.h>
3#include <stdio.h>
4
5#ifdef CUBE_AVX2
6#include <immintrin.h>
7#endif
8
9#include "../../cube.h"
10
11#define STRLENMAX 10000
12 2
13int main() { 3int main() {
14 char *c, str[STRLENMAX]; 4 char *c, str[STRLENMAX];
diff --git a/test/012_io_AVX_write/io_AVX_tests.c b/test/012_io_AVX_write/io_AVX_tests.c
index cbe6ef0..7dc944e 100644
--- a/test/012_io_AVX_write/io_AVX_tests.c
+++ b/test/012_io_AVX_write/io_AVX_tests.c
@@ -1,15 +1,12 @@
1#include <stdbool.h> 1#include "../test.h"
2#include <stdint.h>
3#include <stdio.h>
4
5#ifdef CUBE_AVX2
6#include <immintrin.h>
7#endif
8
9#include "../../cube.h"
10 2
11#define STRLENMAX 10000 3#define STRLENMAX 10000
12 4
5bool iserror(cube_t);
6bool issolvable(cube_t);
7cube_t readcube(char *, char *);
8void writecube(char *, cube_t, char *);
9
13int main() { 10int main() {
14 char *c, str[STRLENMAX]; 11 char *c, str[STRLENMAX];
15 cube_t cube; 12 cube_t cube;
diff --git a/test/020_move/move_tests.c b/test/020_move/move_tests.c
index 9e414cc..dde4c4e 100644
--- a/test/020_move/move_tests.c
+++ b/test/020_move/move_tests.c
@@ -1,15 +1,6 @@
1#include <stdbool.h> 1#include "../test.h"
2#include <stdint.h>
3#include <stdio.h>
4 2
5#ifdef CUBE_AVX2 3cube_t applymoves(cube_t, char *);
6#include <immintrin.h>
7#endif
8
9#include "../../cube.h"
10
11#define STRLENMAX 10000
12#define MOVESMAX 1000
13 4
14int main() { 5int main() {
15 char movestr[STRLENMAX], cubestr[STRLENMAX]; 6 char movestr[STRLENMAX], cubestr[STRLENMAX];
diff --git a/test/030_inverse_cube/inverse_tests.c b/test/030_inverse_cube/inverse_tests.c
index 9151e42..d6d47ba 100644
--- a/test/030_inverse_cube/inverse_tests.c
+++ b/test/030_inverse_cube/inverse_tests.c
@@ -1,14 +1,6 @@
1#include <stdbool.h> 1#include "../test.h"
2#include <stdint.h>
3#include <stdio.h>
4 2
5#ifdef CUBE_AVX2 3cube_t inverse(cube_t);
6#include <immintrin.h>
7#endif
8
9#include "../../cube.h"
10
11#define STRLENMAX 10000
12 4
13int main() { 5int main() {
14 char str[STRLENMAX]; 6 char str[STRLENMAX];
diff --git a/test/040_compose/compose_tests.c b/test/040_compose/compose_tests.c
index c9c11af..d28b225 100644
--- a/test/040_compose/compose_tests.c
+++ b/test/040_compose/compose_tests.c
@@ -1,14 +1,6 @@
1#include <stdbool.h> 1#include "../test.h"
2#include <stdint.h>
3#include <stdio.h>
4 2
5#ifdef CUBE_AVX2 3cube_t compose(cube_t, cube_t);
6#include <immintrin.h>
7#endif
8
9#include "../../cube.h"
10
11#define STRLENMAX 10000
12 4
13int main() { 5int main() {
14 char str[STRLENMAX]; 6 char str[STRLENMAX];
diff --git a/test/050_transform/transform_tests.c b/test/050_transform/transform_tests.c
index e22a4a1..c1bc5af 100644
--- a/test/050_transform/transform_tests.c
+++ b/test/050_transform/transform_tests.c
@@ -1,14 +1,6 @@
1#include <stdbool.h> 1#include "../test.h"
2#include <stdint.h>
3#include <stdio.h>
4 2
5#ifdef CUBE_AVX2 3cube_t applytrans(cube_t, char *);
6#include <immintrin.h>
7#endif
8
9#include "../../cube.h"
10
11#define STRLENMAX 10000
12 4
13int main() { 5int main() {
14 char cubestr[STRLENMAX], transtr[STRLENMAX]; 6 char cubestr[STRLENMAX], transtr[STRLENMAX];
diff --git a/test/061_coord_eo/coord_eo_tests.c b/test/061_coord_eo/coord_eo_tests.c
index bd3db8a..2dfba92 100644
--- a/test/061_coord_eo/coord_eo_tests.c
+++ b/test/061_coord_eo/coord_eo_tests.c
@@ -1,15 +1,5 @@
1#include <stdbool.h>
2#include <inttypes.h>
3#include <stdio.h>
4
5#ifdef CUBE_AVX2
6#include <immintrin.h>
7#endif
8
9#include "../test.h" 1#include "../test.h"
10 2
11#define STRLENMAX 10000
12
13int64_t coord_fast_eo(cube_fast_t); 3int64_t coord_fast_eo(cube_fast_t);
14cube_fast_t cubetofast(cube_t); 4cube_fast_t cubetofast(cube_t);
15 5
diff --git a/test/070_solve_simple/solve_simple_tests.c b/test/070_solve_simple/solve_simple_tests.c
index 14a1674..4756dc0 100644
--- a/test/070_solve_simple/solve_simple_tests.c
+++ b/test/070_solve_simple/solve_simple_tests.c
@@ -1,33 +1,25 @@
1#include <stdbool.h> 1#include "../test.h"
2#include <stdint.h>
3#include <stdio.h>
4#include <stdlib.h>
5#include <string.h>
6 2
7#ifdef CUBE_AVX2 3int64_t solve(cube_t, char *, char *, char *, int8_t, int8_t, int64_t, int8_t,
8#include <immintrin.h> 4 void *, char *);
9#endif
10
11#include "../../cube.h"
12
13#define S 10000
14 5
15int main() { 6int main() {
16 char cubestr[S], solverstr[S], optionsstr[S], nisstypestr[S]; 7 char cubestr[STRLENMAX], solverstr[STRLENMAX], optionsstr[STRLENMAX];
17 char minmovesstr[S], maxmovesstr[S], maxsolsstr[S], optimalstr[S]; 8 char nisstypestr[STRLENMAX], minmovesstr[STRLENMAX];
18 char solutionsstr[S]; 9 char maxmovesstr[STRLENMAX], maxsolsstr[STRLENMAX];
10 char optimalstr[STRLENMAX], solutionsstr[STRLENMAX];
19 cube_t cube; 11 cube_t cube;
20 int64_t maxsols; 12 int64_t maxsols;
21 int8_t minmoves, maxmoves, optimal; 13 int8_t minmoves, maxmoves, optimal;
22 14
23 fgets(cubestr, S, stdin); 15 fgets(cubestr, STRLENMAX, stdin);
24 fgets(solverstr, S, stdin); 16 fgets(solverstr, STRLENMAX, stdin);
25 fgets(optionsstr, S, stdin); 17 fgets(optionsstr, STRLENMAX, stdin);
26 fgets(nisstypestr, S, stdin); 18 fgets(nisstypestr, STRLENMAX, stdin);
27 fgets(minmovesstr, S, stdin); 19 fgets(minmovesstr, STRLENMAX, stdin);
28 fgets(maxmovesstr, S, stdin); 20 fgets(maxmovesstr, STRLENMAX, stdin);
29 fgets(maxsolsstr, S, stdin); 21 fgets(maxsolsstr, STRLENMAX, stdin);
30 fgets(optimalstr, S, stdin); 22 fgets(optimalstr, STRLENMAX, stdin);
31 23
32 solverstr[strcspn(solverstr, "\n")] = 0; 24 solverstr[strcspn(solverstr, "\n")] = 0;
33 optionsstr[strcspn(optionsstr, "\n")] = 0; 25 optionsstr[strcspn(optionsstr, "\n")] = 0;
diff --git a/test/test.h b/test/test.h
index 607a52d..7c5400e 100644
--- a/test/test.h
+++ b/test/test.h
@@ -1,7 +1,26 @@
1#include "../cube.h" 1#include <inttypes.h>
2#include <stdbool.h>
3#include <stdio.h>
4#include <stdlib.h>
5#include <string.h>
6
7#define STRLENMAX 10000
8
9typedef struct {
10 uint8_t corner[8];
11 uint8_t edge[12];
12} cube_t;
2 13
3#ifdef CUBE_AVX2 14#ifdef CUBE_AVX2
15#include <immintrin.h>
4typedef __m256i cube_fast_t; 16typedef __m256i cube_fast_t;
5#else 17#else
6typedef cube_t cube_fast_t; 18typedef cube_t cube_fast_t;
7#endif 19#endif
20
21/* Basic functions used in most tests */
22cube_t solvedcube(void);
23bool iserror(cube_t);
24bool issolvable(cube_t);
25cube_t readcube(char *, char *);
26void writecube(char *, cube_t, char *);

Generated with cgit - Back to sebastiano.tronto.net