aboutsummaryrefslogtreecommitdiff
path: root/test/112_gendata_h48short
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-07-17 08:54:44 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-07-17 08:54:44 +0200
commit270e5b0444f67781856bf80db51650af9cb89b0c (patch)
tree1f895ca8fdbf256dcdf550dd0a28ca99993efc08 /test/112_gendata_h48short
parent2d0ab15ac1f81c76cb6bb31bbdad3d2ee339e062 (diff)
downloadnissy-core-270e5b0444f67781856bf80db51650af9cb89b0c.tar.gz
nissy-core-270e5b0444f67781856bf80db51650af9cb89b0c.zip
Renamed tests to make space for more coordinate tests
Diffstat (limited to 'test/112_gendata_h48short')
-rw-r--r--test/112_gendata_h48short/00_depth_1.in28
-rw-r--r--test/112_gendata_h48short/00_depth_1.out3
-rw-r--r--test/112_gendata_h48short/01_depth_3.in3
-rw-r--r--test/112_gendata_h48short/01_depth_3.out40
-rw-r--r--test/112_gendata_h48short/gendata_h48short_tests.c61
5 files changed, 0 insertions, 135 deletions
diff --git a/test/112_gendata_h48short/00_depth_1.in b/test/112_gendata_h48short/00_depth_1.in
deleted file mode 100644
index c86f15b..0000000
--- a/test/112_gendata_h48short/00_depth_1.in
+++ /dev/null
@@ -1,28 +0,0 @@
173
2157
31
4
5For longer test:
6
720000003
820000023
98
10
11Short h48: generating depth 0
12found 1
13Short h48: generating depth 1
14found 1
15Short h48: generating depth 2
16found 4
17Short h48: generating depth 3
18found 34
19Short h48: generating depth 4
20found 333
21Short h48: generating depth 5
22found 3815
23Short h48: generating depth 6
24found 45382
25Short h48: generating depth 7
26found 548562
27Short h48: generating depth 8
28found 6839723
diff --git a/test/112_gendata_h48short/00_depth_1.out b/test/112_gendata_h48short/00_depth_1.out
deleted file mode 100644
index b0dba31..0000000
--- a/test/112_gendata_h48short/00_depth_1.out
+++ /dev/null
@@ -1,3 +0,0 @@
12
20 0
371075840 1
diff --git a/test/112_gendata_h48short/01_depth_3.in b/test/112_gendata_h48short/01_depth_3.in
deleted file mode 100644
index 920e70a..0000000
--- a/test/112_gendata_h48short/01_depth_3.in
+++ /dev/null
@@ -1,3 +0,0 @@
173
2157
33
diff --git a/test/112_gendata_h48short/01_depth_3.out b/test/112_gendata_h48short/01_depth_3.out
deleted file mode 100644
index dbce376..0000000
--- a/test/112_gendata_h48short/01_depth_3.out
+++ /dev/null
@@ -1,40 +0,0 @@
140
20 0
370981632 3
471075840 1
571086080 3
6142067712 2
7218789888 3
8218884096 2
9283879424 2
10283899904 3
11283953152 3
12283973632 2
13360548808 3
14360835072 3
15473668032 3
16473956352 3
17499869696 3
18500011008 3
19598679552 3
20599109185 3
21662171648 3
22662601226 3
23724818316 3
24725106688 3
25790513664 3
26790607872 3
27904991108 3
28926726144 3
29928729088 3
301009662340 3
311088755203 3
321171758595 3
331206452224 3
341206480896 3
351277360128 3
361277454336 3
371403695492 3
381403697540 3
391403736452 3
401403738500 3
diff --git a/test/112_gendata_h48short/gendata_h48short_tests.c b/test/112_gendata_h48short/gendata_h48short_tests.c
deleted file mode 100644
index 0de9408..0000000
--- a/test/112_gendata_h48short/gendata_h48short_tests.c
+++ /dev/null
@@ -1,61 +0,0 @@
1#include "../test.h"
2
3#define MAXPOS 200
4
5void h48map_create(h48map_t [static 1], uint64_t, uint64_t);
6void h48map_destroy(h48map_t [static 1]);
7kvpair_t h48map_nextkvpair(h48map_t [static 1], uint64_t [static 1]);
8size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *);
9uint64_t gendata_h48short(gendata_h48short_arg_t [static 1]);
10
11char str[STRLENMAX];
12
13int compare(const void *x, const void *y) {
14 uint64_t a = ((kvpair_t *)x)->key;
15 uint64_t b = ((kvpair_t *)y)->key;
16
17 if (a > b) return 1;
18 if (a == b) return 0;
19 return -1;
20}
21
22uint64_t readl(void) {
23 fgets(str, STRLENMAX, stdin);
24 return atoll(str);
25}
26
27void run(void) {
28 unsigned char buf[2000000];
29 h48map_t map;
30 uint64_t i, j, capacity, randomizer, selfsim[COCSEP_CLASSES];
31 kvpair_t kv, b[MAXPOS];
32 gendata_h48short_arg_t arg;
33 cube_t crep[COCSEP_CLASSES];
34
35 capacity = readl();
36 randomizer = readl();
37 arg.maxdepth = readl();
38 arg.crep = crep;
39 arg.selfsim = selfsim;
40 arg.map = &map;
41
42 h48map_create(&map, capacity, randomizer);
43 gendata_cocsep(buf, selfsim, crep);
44 arg.cocsepdata = (uint32_t *)((char *)buf + INFOSIZE);
45 gendata_h48short(&arg);
46
47 i = 0;
48 for (kv = h48map_nextkvpair(&map, &i), j = 0;
49 i != map.capacity && j < MAXPOS;
50 kv = h48map_nextkvpair(&map, &i)
51 ) {
52 b[j++] = kv;
53 }
54 qsort(b, j, sizeof(kvpair_t), compare);
55
56 printf("%" PRIu64 "\n", map.n);
57 for (i = 0; i < j; i++)
58 printf("%" PRIu64 " %" PRIu64 "\n", b[i].key, b[i].val);
59
60 h48map_destroy(&map);
61}

Generated with cgit - Back to sebastiano.tronto.net