aboutsummaryrefslogtreecommitdiff
path: root/test/103_gendata_h48
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-05-27 12:04:53 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-05-27 12:04:53 +0200
commit49b9c4a516f72e03d53277075f4580e2df8f0e63 (patch)
treedea68649391d14d63a96e742b450c59681ac4305 /test/103_gendata_h48
parentfde8dfa9df8df1e3d42a9a8840836e33817cd498 (diff)
downloadnissy-core-49b9c4a516f72e03d53277075f4580e2df8f0e63.tar.gz
nissy-core-49b9c4a516f72e03d53277075f4580e2df8f0e63.zip
Some type fixes and some cleanup
Diffstat (limited to 'test/103_gendata_h48')
-rw-r--r--test/103_gendata_h48/00_h_0.in1
-rw-r--r--test/103_gendata_h48/00_h_0.out23
-rw-r--r--test/103_gendata_h48/01_h_1.in1
-rw-r--r--test/103_gendata_h48/01_h_1.out23
-rw-r--r--test/103_gendata_h48/gendata_h48_tests.c35
5 files changed, 83 insertions, 0 deletions
diff --git a/test/103_gendata_h48/00_h_0.in b/test/103_gendata_h48/00_h_0.in
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/test/103_gendata_h48/00_h_0.in
@@ -0,0 +1 @@
0
diff --git a/test/103_gendata_h48/00_h_0.out b/test/103_gendata_h48/00_h_0.out
new file mode 100644
index 0000000..db6e121
--- /dev/null
+++ b/test/103_gendata_h48/00_h_0.out
@@ -0,0 +1,23 @@
159903545
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/103_gendata_h48/01_h_1.in b/test/103_gendata_h48/01_h_1.in
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/test/103_gendata_h48/01_h_1.in
@@ -0,0 +1 @@
1
diff --git a/test/103_gendata_h48/01_h_1.out b/test/103_gendata_h48/01_h_1.out
new file mode 100644
index 0000000..456305d
--- /dev/null
+++ b/test/103_gendata_h48/01_h_1.out
@@ -0,0 +1,23 @@
1118687270
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: 375
235: 4078
diff --git a/test/103_gendata_h48/gendata_h48_tests.c b/test/103_gendata_h48/gendata_h48_tests.c
new file mode 100644
index 0000000..f0910cc
--- /dev/null
+++ b/test/103_gendata_h48/gendata_h48_tests.c
@@ -0,0 +1,35 @@
1#include "../test.h"
2
3#define MAXDEPTH 5
4#define COCSEPSIZE 1119792
5#define ETABLESIZE(h) (((3393 * 495 * 70) >> 1) << (size_t)(h))
6
7size_t gendata_h48(void *, uint8_t, uint8_t);
8
9int main(void) {
10 char str[STRLENMAX];
11 uint8_t h, i;
12 uint32_t *buf, *h48info;
13 size_t result;
14
15 fgets(str, STRLENMAX, stdin);
16 h = atoi(str);
17 buf = (uint32_t *)malloc(sizeof(uint32_t) * (60000000 << h));
18 result = gendata_h48(buf, h, MAXDEPTH);
19 h48info = buf + (ETABLESIZE(h) + COCSEPSIZE) / 4;
20
21 printf("%zu\n\n", result);
22
23 printf("cocsepdata:\n");
24 printf("Classes: %" PRIu32 "\n", buf[COCSEPSIZE/4-12]);
25 printf("Max value: %" PRIu32 "\n", buf[COCSEPSIZE/4-11]);
26 for (i = 0; i < 10; i++)
27 printf("%" PRIu32 ": %" PRIu32 "\n", i, buf[COCSEPSIZE/4-10+i]);
28
29 printf("\nh48:\n");
30 for (i = 0; i < MAXDEPTH+1; i++)
31 printf("%" PRIu32 ": %" PRIu32 "\n", i, h48info[i+1]);
32
33 free(buf);
34 return 0;
35}

Generated with cgit - Back to sebastiano.tronto.net