aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/120_gendata_h48h0k4/00_h_0.in2
-rw-r--r--test/120_gendata_h48h0k4/00_h_0.out22
-rw-r--r--test/120_gendata_h48h0k4/gendata_h48h0k4_tests.c84
3 files changed, 0 insertions, 108 deletions
diff --git a/test/120_gendata_h48h0k4/00_h_0.in b/test/120_gendata_h48h0k4/00_h_0.in
deleted file mode 100644
index 661d826..0000000
--- a/test/120_gendata_h48h0k4/00_h_0.in
+++ /dev/null
@@ -1,2 +0,0 @@
14
20
diff --git a/test/120_gendata_h48h0k4/00_h_0.out b/test/120_gendata_h48h0k4/00_h_0.out
deleted file mode 100644
index 6ca64de..0000000
--- a/test/120_gendata_h48h0k4/00_h_0.out
+++ /dev/null
@@ -1,22 +0,0 @@
159904493
2
3cocsepdata:
4Classes: 3393
5Max value: 9
60: 1
71: 6
82: 63
93: 468
104: 3068
115: 15438
126: 53814
137: 71352
148: 8784
159: 96
16
17h48:
180: 1
191: 1
202: 4
213: 34
224: 331
diff --git a/test/120_gendata_h48h0k4/gendata_h48h0k4_tests.c b/test/120_gendata_h48h0k4/gendata_h48h0k4_tests.c
deleted file mode 100644
index 7c5b441..0000000
--- a/test/120_gendata_h48h0k4/gendata_h48h0k4_tests.c
+++ /dev/null
@@ -1,84 +0,0 @@
1#include "../test.h"
2
3#define COCSEP_CLASSES 3393
4#define INFOSIZE 512
5#define INFO_SOLVER_STRLEN 100
6#define INFO_DISTRIBUTION_LEN 21
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
24typedef struct {
25 uint8_t h;
26 uint8_t k;
27 uint8_t base;
28 uint8_t maxdepth;
29 tableinfo_t info;
30 void *buf;
31 void *h48buf;
32 uint32_t *cocsepdata;
33 uint64_t selfsim[COCSEP_CLASSES];
34 cube_t crep[COCSEP_CLASSES];
35} gendata_h48_arg_t;
36
37int64_t gendata_h48(gendata_h48_arg_t *);
38bool readtableinfo(const void *, tableinfo_t *);
39
40void run(void) {
41 char str[STRLENMAX];
42 uint8_t i;
43 gendata_h48_arg_t arg;
44 size_t result, sz;
45 tableinfo_t cinfo, hinfo;
46 void *h48buf;
47
48 fgets(str, STRLENMAX, stdin);
49 arg.maxdepth = atoi(str);
50 fgets(str, STRLENMAX, stdin);
51 arg.h = atoi(str);
52 arg.k = 4;
53
54 sz = gendata_h48(&arg); /* With buf = NULL returns data size */
55 arg.buf = malloc(sz);
56
57 result = gendata_h48(&arg);
58
59 if (!readtableinfo(arg.buf, &cinfo)) {
60 printf("Error reading cocsep info\n");
61 goto end;
62 }
63
64 h48buf = (char *)arg.buf + cinfo.next;
65 if (!readtableinfo(h48buf, &hinfo)) {
66 printf("Error reading h48 info\n");
67 goto end;
68 }
69
70 printf("%zu\n\n", result);
71
72 printf("cocsepdata:\n");
73 printf("Classes: %" PRIu64 "\n", cinfo.classes);
74 printf("Max value: %" PRIu8 "\n", cinfo.maxvalue);
75 for (i = 0; i <= cinfo.maxvalue; i++)
76 printf("%" PRIu32 ": %" PRIu64 "\n", i, cinfo.distribution[i]);
77
78 printf("\nh48:\n");
79 for (i = 0; i <= hinfo.maxvalue; i++)
80 printf("%" PRIu32 ": %" PRIu64 "\n", i, hinfo.distribution[i]);
81
82end:
83 free(arg.buf);
84}

Generated with cgit - Back to sebastiano.tronto.net