aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/102_gendata_h48/00_all.in0
-rw-r--r--test/102_gendata_h48/00_all.out1
-rw-r--r--test/102_gendata_h48/00_h_0.in1
-rw-r--r--test/102_gendata_h48/00_h_0.out23
-rw-r--r--test/102_gendata_h48/gendata_h48_tests.c31
5 files changed, 49 insertions, 7 deletions
diff --git a/test/102_gendata_h48/00_all.in b/test/102_gendata_h48/00_all.in
deleted file mode 100644
index e69de29..0000000
--- a/test/102_gendata_h48/00_all.in
+++ /dev/null
diff --git a/test/102_gendata_h48/00_all.out b/test/102_gendata_h48/00_all.out
deleted file mode 100644
index deba01f..0000000
--- a/test/102_gendata_h48/00_all.out
+++ /dev/null
@@ -1 +0,0 @@
1something
diff --git a/test/102_gendata_h48/00_h_0.in b/test/102_gendata_h48/00_h_0.in
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/test/102_gendata_h48/00_h_0.in
@@ -0,0 +1 @@
0
diff --git a/test/102_gendata_h48/00_h_0.out b/test/102_gendata_h48/00_h_0.out
new file mode 100644
index 0000000..8c629f8
--- /dev/null
+++ b/test/102_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: 331
235: 3608
diff --git a/test/102_gendata_h48/gendata_h48_tests.c b/test/102_gendata_h48/gendata_h48_tests.c
index f918e4d..35e6f42 100644
--- a/test/102_gendata_h48/gendata_h48_tests.c
+++ b/test/102_gendata_h48/gendata_h48_tests.c
@@ -1,18 +1,37 @@
1#include "../test.h" 1#include "../test.h"
2 2
3#define H 0 3#define MAXH 1
4#define SIZE (120000000 << (H)) 4#define MAXDEPTH 5
5#define COCSEPSIZE 1119792
6#define ETABLESIZE(h) (((3393 * 495 * 70) >> 1) << (h))
7#define SIZE (60000000 << MAXH)
5 8
6uint32_t buf[SIZE]; 9uint32_t buf[SIZE/4];
7 10
8size_t gendata_h48(void *, uint8_t); 11size_t gendata_h48(void *, uint8_t, uint8_t);
9 12
10int main(void) { 13int main(void) {
14 char str[STRLENMAX];
15 uint8_t h, i;
16 uint32_t *h48info;
11 size_t result; 17 size_t result;
12 18
13 result = gendata_h48(buf, H); 19 fgets(str, STRLENMAX, stdin);
20 h = atoi(str);
21 result = gendata_h48(buf, h, MAXDEPTH);
22 h48info = buf + (ETABLESIZE(h) + COCSEPSIZE) / 4;
14 23
15 printf("nothing\n"); 24 printf("%zu\n\n", result);
25
26 printf("cocsepdata:\n");
27 printf("Classes: %" PRIu32 "\n", buf[COCSEPSIZE/4-12]);
28 printf("Max value: %" PRIu32 "\n", buf[COCSEPSIZE/4-11]);
29 for (i = 0; i < 10; i++)
30 printf("%" PRIu32 ": %" PRIu32 "\n", i, buf[COCSEPSIZE/4-10+i]);
31
32 printf("\nh48:\n");
33 for (i = 0; i < MAXDEPTH+1; i++)
34 printf("%" PRIu32 ": %" PRIu32 "\n", i, h48info[i+1]);
16 35
17 return 0; 36 return 0;
18} 37}

Generated with cgit - Back to sebastiano.tronto.net