aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/090_tables_readwrite/tables_readwrite_tests.c20
-rw-r--r--test/100_gendata_cocsep/gendata_cocsep_tests.c21
-rw-r--r--test/101_cocsep_transform_invariant/cocsep_transform_invariant.c6
-rw-r--r--test/102_cocsep_selfsim/cocsep_selfsim_tests.c3
-rw-r--r--test/103_cocsep_selfsim_distribution/cocsep_selfsim_distribution_tests.c5
-rw-r--r--test/104_cocsep_ttrep/cocsep_ttrep_tests.c10
-rw-r--r--test/110_coord_invcoord_h48/coord_invcoord_h48_tests.c3
-rw-r--r--test/111_h48map/h48map_tests.c13
-rw-r--r--test/112_gendata_h48short/gendata_h48short_tests.c29
-rw-r--r--test/test.h5
10 files changed, 9 insertions, 106 deletions
diff --git a/test/090_tables_readwrite/tables_readwrite_tests.c b/test/090_tables_readwrite/tables_readwrite_tests.c
index 73c4e21..9238207 100644
--- a/test/090_tables_readwrite/tables_readwrite_tests.c
+++ b/test/090_tables_readwrite/tables_readwrite_tests.c
@@ -1,25 +1,5 @@
1#include "../test.h" 1#include "../test.h"
2 2
3#define INFOSIZE 512
4#define INFO_SOLVER_STRLEN 100
5#define INFO_DISTRIBUTION_LEN 21
6
7typedef struct {
8 uint64_t distribution[INFO_DISTRIBUTION_LEN];
9 uint64_t type;
10 uint64_t infosize;
11 uint64_t fullsize;
12 uint64_t hash;
13 uint64_t entries;
14 uint64_t classes;
15 uint64_t next;
16 char solver[INFO_SOLVER_STRLEN];
17 uint8_t h48h;
18 uint8_t bits;
19 uint8_t base;
20 uint8_t maxvalue;
21} tableinfo_t;
22
23bool readtableinfo(const void *, tableinfo_t *); 3bool readtableinfo(const void *, tableinfo_t *);
24bool writetableinfo(const tableinfo_t *, void *); 4bool writetableinfo(const tableinfo_t *, void *);
25 5
diff --git a/test/100_gendata_cocsep/gendata_cocsep_tests.c b/test/100_gendata_cocsep/gendata_cocsep_tests.c
index 62f52fb..296df28 100644
--- a/test/100_gendata_cocsep/gendata_cocsep_tests.c
+++ b/test/100_gendata_cocsep/gendata_cocsep_tests.c
@@ -1,26 +1,5 @@
1#include "../test.h" 1#include "../test.h"
2 2
3#define INFOSIZE 512
4#define INFO_SOLVER_STRLEN 100
5#define INFO_DISTRIBUTION_LEN 21
6#define COCSEP_CLASSES 3393
7
8typedef struct {
9 uint64_t distribution[INFO_DISTRIBUTION_LEN];
10 uint64_t type;
11 uint64_t infosize;
12 uint64_t fullsize;
13 uint64_t hash;
14 uint64_t entries;
15 uint64_t classes; /* Used only by cocsepdata, for now */
16 uint64_t next;
17 char solver[INFO_SOLVER_STRLEN];
18 uint8_t h48h;
19 uint8_t bits;
20 uint8_t base;
21 uint8_t maxvalue;
22} tableinfo_t;
23
24size_t gendata_cocsep(void *, uint64_t *, cube_t *); 3size_t gendata_cocsep(void *, uint64_t *, cube_t *);
25bool readtableinfo(const void *, tableinfo_t *); 4bool readtableinfo(const void *, tableinfo_t *);
26 5
diff --git a/test/101_cocsep_transform_invariant/cocsep_transform_invariant.c b/test/101_cocsep_transform_invariant/cocsep_transform_invariant.c
index 67f70a5..853586a 100644
--- a/test/101_cocsep_transform_invariant/cocsep_transform_invariant.c
+++ b/test/101_cocsep_transform_invariant/cocsep_transform_invariant.c
@@ -1,11 +1,5 @@
1#include "../test.h" 1#include "../test.h"
2 2
3#define COCLASS_MASK (UINT32_C(0xFFFF) << UINT32_C(16))
4#define COCLASS(x) (((x) & COCLASS_MASK) >> UINT32_C(16))
5
6#define INFOSIZE 512
7#define COCSEP_CLASSES 3393
8
9size_t gendata_cocsep(void *, uint64_t *, cube_t *); 3size_t gendata_cocsep(void *, uint64_t *, cube_t *);
10cube_t transform(cube_t, uint8_t); 4cube_t transform(cube_t, uint8_t);
11int64_t coord_cocsep(cube_t); 5int64_t coord_cocsep(cube_t);
diff --git a/test/102_cocsep_selfsim/cocsep_selfsim_tests.c b/test/102_cocsep_selfsim/cocsep_selfsim_tests.c
index 490952a..dd778aa 100644
--- a/test/102_cocsep_selfsim/cocsep_selfsim_tests.c
+++ b/test/102_cocsep_selfsim/cocsep_selfsim_tests.c
@@ -7,9 +7,6 @@
7 */ 7 */
8#include "../test.h" 8#include "../test.h"
9 9
10#define COCSEP_CLASSES 3393
11#define INFOSIZE 512
12
13size_t gendata_cocsep(void *, uint64_t *, cube_t *); 10size_t gendata_cocsep(void *, uint64_t *, cube_t *);
14int64_t coord_cocsep(cube_t); 11int64_t coord_cocsep(cube_t);
15 12
diff --git a/test/103_cocsep_selfsim_distribution/cocsep_selfsim_distribution_tests.c b/test/103_cocsep_selfsim_distribution/cocsep_selfsim_distribution_tests.c
index 84e3fd8..a907317 100644
--- a/test/103_cocsep_selfsim_distribution/cocsep_selfsim_distribution_tests.c
+++ b/test/103_cocsep_selfsim_distribution/cocsep_selfsim_distribution_tests.c
@@ -1,7 +1,5 @@
1#include "../test.h" 1#include "../test.h"
2 2
3#define COCSEP_CLASSES 3393
4
5size_t gendata_cocsep(void *, uint64_t *, cube_t *); 3size_t gendata_cocsep(void *, uint64_t *, cube_t *);
6int64_t coord_cocsep(cube_t); 4int64_t coord_cocsep(cube_t);
7 5
@@ -19,8 +17,7 @@ int bcount(uint64_t x) {
19void run(void) { 17void run(void) {
20 char buf[2000000]; 18 char buf[2000000];
21 int size[65], tot, j; 19 int size[65], tot, j;
22 int64_t i; 20 uint64_t i, selfsim[COCSEP_CLASSES], sim;
23 uint64_t selfsim[COCSEP_CLASSES], sim;
24 cube_t rep[COCSEP_CLASSES]; 21 cube_t rep[COCSEP_CLASSES];
25 22
26 memset(size, 0, 65 * sizeof(int)); 23 memset(size, 0, 65 * sizeof(int));
diff --git a/test/104_cocsep_ttrep/cocsep_ttrep_tests.c b/test/104_cocsep_ttrep/cocsep_ttrep_tests.c
index efe5a26..0b853c3 100644
--- a/test/104_cocsep_ttrep/cocsep_ttrep_tests.c
+++ b/test/104_cocsep_ttrep/cocsep_ttrep_tests.c
@@ -1,11 +1,5 @@
1#include "../test.h" 1#include "../test.h"
2 2
3#define TTREP_MASK (UINT32_C(0xFF) << UINT32_C(8))
4#define TTREP(x) (((x) & TTREP_MASK) >> UINT32_C(8))
5
6#define COCSEP_CLASSES 3393
7#define INFOSIZE 512
8
9uint8_t inverse_trans(uint8_t); 3uint8_t inverse_trans(uint8_t);
10cube_t transform_corners(cube_t, uint8_t); 4cube_t transform_corners(cube_t, uint8_t);
11int64_t coord_cocsep(cube_t); 5int64_t coord_cocsep(cube_t);
@@ -15,8 +9,8 @@ void run(void) {
15 uint8_t t; 9 uint8_t t;
16 char buf[2000000]; 10 char buf[2000000];
17 uint32_t *cocsepdata, tt; 11 uint32_t *cocsepdata, tt;
18 uint64_t selfsim[COCSEP_CLASSES]; 12 uint64_t i, selfsim[COCSEP_CLASSES];
19 int64_t i, j, k, l; 13 int64_t j, k, l;
20 cube_t rep[COCSEP_CLASSES], c, d; 14 cube_t rep[COCSEP_CLASSES], c, d;
21 15
22 gendata_cocsep(buf, selfsim, rep); 16 gendata_cocsep(buf, selfsim, rep);
diff --git a/test/110_coord_invcoord_h48/coord_invcoord_h48_tests.c b/test/110_coord_invcoord_h48/coord_invcoord_h48_tests.c
index 1fcbabd..025ff2b 100644
--- a/test/110_coord_invcoord_h48/coord_invcoord_h48_tests.c
+++ b/test/110_coord_invcoord_h48/coord_invcoord_h48_tests.c
@@ -1,8 +1,5 @@
1#include "../test.h" 1#include "../test.h"
2 2
3#define COCSEP_CLASSES 3393
4#define INFOSIZE 512
5
6size_t gendata_cocsep(void *, uint64_t *, cube_t *); 3size_t gendata_cocsep(void *, uint64_t *, cube_t *);
7int64_t coord_h48(cube_t, const uint32_t *, uint8_t); 4int64_t coord_h48(cube_t, const uint32_t *, uint8_t);
8cube_t invcoord_h48(int64_t, const cube_t *, uint8_t); 5cube_t invcoord_h48(int64_t, const cube_t *, uint8_t);
diff --git a/test/111_h48map/h48map_tests.c b/test/111_h48map/h48map_tests.c
index d70bc3a..7fdfb3d 100644
--- a/test/111_h48map/h48map_tests.c
+++ b/test/111_h48map/h48map_tests.c
@@ -1,20 +1,7 @@
1#include "../test.h" 1#include "../test.h"
2 2
3#define MAP_KEYSHIFT UINT64_C(40)
4#define MAXPOS 1000 3#define MAXPOS 1000
5 4
6typedef struct {
7 uint64_t n;
8 uint64_t capacity;
9 uint64_t randomizer;
10 uint64_t *table;
11} h48map_t;
12
13typedef struct {
14 uint64_t key;
15 uint64_t val;
16} kvpair_t;
17
18void h48map_create(h48map_t *, uint64_t, uint64_t); 5void h48map_create(h48map_t *, uint64_t, uint64_t);
19void h48map_destroy(h48map_t *); 6void h48map_destroy(h48map_t *);
20void h48map_insertmin(h48map_t *, uint64_t, uint64_t); 7void h48map_insertmin(h48map_t *, uint64_t, uint64_t);
diff --git a/test/112_gendata_h48short/gendata_h48short_tests.c b/test/112_gendata_h48short/gendata_h48short_tests.c
index fb432d3..b6ff00e 100644
--- a/test/112_gendata_h48short/gendata_h48short_tests.c
+++ b/test/112_gendata_h48short/gendata_h48short_tests.c
@@ -1,33 +1,6 @@
1#include "../test.h" 1#include "../test.h"
2 2
3#define COCSEP_CLASSES 3393 3#define MAXPOS 200
4#define INFOSIZE 512
5#define MAXPOS 200
6
7typedef struct {
8 uint64_t n;
9 uint64_t capacity;
10 uint64_t randomizer;
11 uint64_t *table;
12 uint32_t *info;
13 uint32_t *cocsepdata;
14 uint32_t *h48data;
15 uint64_t selfsim[COCSEP_CLASSES];
16 cube_t crep[COCSEP_CLASSES];
17} h48map_t;
18
19typedef struct {
20 uint64_t key;
21 uint64_t val;
22} kvpair_t;
23
24typedef struct {
25 uint8_t maxdepth;
26 const uint32_t *cocsepdata;
27 const cube_t *crep;
28 const uint64_t *selfsim;
29 h48map_t *map;
30} gendata_h48short_arg_t;
31 4
32void h48map_create(h48map_t *, uint64_t, uint64_t); 5void h48map_create(h48map_t *, uint64_t, uint64_t);
33void h48map_destroy(h48map_t *); 6void h48map_destroy(h48map_t *);
diff --git a/test/test.h b/test/test.h
index d7658cb..b90a399 100644
--- a/test/test.h
+++ b/test/test.h
@@ -1,6 +1,7 @@
1#define TEST_H 1#define TEST_H
2 2
3#include <inttypes.h> 3#include <inttypes.h>
4#include <pthread.h>
4#include <stdarg.h> 5#include <stdarg.h>
5#include <stdbool.h> 6#include <stdbool.h>
6#include <stdio.h> 7#include <stdio.h>
@@ -8,6 +9,10 @@
8#include <string.h> 9#include <string.h>
9 10
10#include "../src/arch/arch.h" 11#include "../src/arch/arch.h"
12#include "../src/solvers/tables_types_macros.h"
13#include "../src/solvers/h48/coordinate_macros.h"
14#include "../src/solvers/h48/map_types_macros.h"
15#include "../src/solvers/h48/gendata_types_macros.h"
11 16
12#define STRLENMAX 10000 17#define STRLENMAX 10000
13 18

Generated with cgit - Back to sebastiano.tronto.net