aboutsummaryrefslogtreecommitdiff
path: root/tools/002_gendata_h48h0k2
diff options
context:
space:
mode:
Diffstat (limited to 'tools/002_gendata_h48h0k2')
-rw-r--r--tools/002_gendata_h48h0k2/gendata_h48h0k2.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/tools/002_gendata_h48h0k2/gendata_h48h0k2.c b/tools/002_gendata_h48h0k2/gendata_h48h0k2.c
index 2754f80..271d339 100644
--- a/tools/002_gendata_h48h0k2/gendata_h48h0k2.c
+++ b/tools/002_gendata_h48h0k2/gendata_h48h0k2.c
@@ -5,9 +5,6 @@
5#define OPTIONS "0;2;20" 5#define OPTIONS "0;2;20"
6#define LONGOPTIONS "h = 0, k = 2, max depth = 20" 6#define LONGOPTIONS "h = 0, k = 2, max depth = 20"
7 7
8#define COCSEPSIZE 1119792
9#define ETABLESIZE(h) (((3393 * 495 * 70) >> 2) << (size_t)(h))
10
11uint32_t expected[21] = { 8uint32_t expected[21] = {
12 /* Base value is 8 */ 9 /* Base value is 8 */
13 [0] = 5473562, 10 [0] = 5473562,
@@ -19,8 +16,6 @@ uint32_t expected[21] = {
19char *buf; 16char *buf;
20 17
21void run(void) { 18void run(void) {
22 uint32_t *h48info, x;
23 int i;
24 int64_t s; 19 int64_t s;
25 20
26 s = nissy_gendata("h48", OPTIONS, buf); 21 s = nissy_gendata("h48", OPTIONS, buf);
@@ -28,16 +23,12 @@ void run(void) {
28 if (s == -1) { 23 if (s == -1) {
29 printf("Error generating table\n"); 24 printf("Error generating table\n");
30 } else { 25 } else {
31 printf("Succesfully generated %" PRId64 " bytes. Table:\n", s); 26 nissy_datainfo(buf, write_stdout);
32 h48info = (uint32_t *)buf + 1 + (ETABLESIZE(HVALUE) + COCSEPSIZE) / 4; 27 printf("\n");
33 for (i = 0; i < 4; i++) { 28 printf("Succesfully generated %" PRId64 " bytes. "
34 x = h48info[i+1]; 29 "See above for details on the tables.\n", s);
35 printf("%d:\t%" PRIu32, i, x); 30
36 if (x != expected[i]) 31 /* TODO: check that the table is correct */
37 printf(" <--- Error! Expected: %" PRIu32,
38 expected[i]);
39 printf("\n");
40 }
41 } 32 }
42} 33}
43 34

Generated with cgit - Back to sebastiano.tronto.net