aboutsummaryrefslogtreecommitdiff
path: root/test/111_gendata_h48_h0
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-07-14 21:28:37 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-07-14 21:28:37 +0200
commit61e03f9f4eecf3d5811b11c44c9ef778f0a93bc7 (patch)
treea7a6edc2e44689ed62472bdece1d9bf6a300419f /test/111_gendata_h48_h0
parenta016aa7f78c86c59bab3ae4970f8cc339186bc91 (diff)
downloadnissy-core-61e03f9f4eecf3d5811b11c44c9ef778f0a93bc7.tar.gz
nissy-core-61e03f9f4eecf3d5811b11c44c9ef778f0a93bc7.zip
Found a sneaky bug (it's all a mess now)
Diffstat (limited to 'test/111_gendata_h48_h0')
-rw-r--r--test/111_gendata_h48_h0/00_h_0.in0
-rw-r--r--test/111_gendata_h48_h0/00_h_0.out23
-rw-r--r--test/111_gendata_h48_h0/gendata_h48_tests.c33
3 files changed, 56 insertions, 0 deletions
diff --git a/test/111_gendata_h48_h0/00_h_0.in b/test/111_gendata_h48_h0/00_h_0.in
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/111_gendata_h48_h0/00_h_0.in
diff --git a/test/111_gendata_h48_h0/00_h_0.out b/test/111_gendata_h48_h0/00_h_0.out
new file mode 100644
index 0000000..cc5cf9b
--- /dev/null
+++ b/test/111_gendata_h48_h0/00_h_0.out
@@ -0,0 +1,23 @@
159903605
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: 329
235: 3587
diff --git a/test/111_gendata_h48_h0/gendata_h48_tests.c b/test/111_gendata_h48_h0/gendata_h48_tests.c
new file mode 100644
index 0000000..e9de3c0
--- /dev/null
+++ b/test/111_gendata_h48_h0/gendata_h48_tests.c
@@ -0,0 +1,33 @@
1#include "../test.h"
2
3#define MAXDEPTH 5
4#define COCSEPSIZE 1119792
5#define ETABLESIZE ((3393 * 495 * 70) >> 1)
6
7int64_t gendata_h48h0k4(void *, uint8_t);
8
9void run(void) {
10 char str[STRLENMAX];
11 uint8_t i;
12 uint32_t *buf, *h48info;
13 size_t result;
14
15 fgets(str, STRLENMAX, stdin);
16 buf = (uint32_t *)malloc(sizeof(uint32_t) * 60000000);
17 result = gendata_h48h0k4(buf, MAXDEPTH);
18 h48info = buf + (ETABLESIZE + COCSEPSIZE) / 4;
19
20 printf("%zu\n\n", result);
21
22 printf("cocsepdata:\n");
23 printf("Classes: %" PRIu32 "\n", buf[COCSEPSIZE/4-12]);
24 printf("Max value: %" PRIu32 "\n", buf[COCSEPSIZE/4-11]);
25 for (i = 0; i < 10; i++)
26 printf("%" PRIu32 ": %" PRIu32 "\n", i, buf[COCSEPSIZE/4-10+i]);
27
28 printf("\nh48:\n");
29 for (i = 0; i < MAXDEPTH+1; i++)
30 printf("%" PRIu32 ": %" PRIu32 "\n", i, h48info[i+1]);
31
32 free(buf);
33}

Generated with cgit - Back to sebastiano.tronto.net