aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/102_gendata_h48/01_h_1.in1
-rw-r--r--test/102_gendata_h48/01_h_1.out23
-rw-r--r--test/102_gendata_h48/gendata_h48_tests.c8
3 files changed, 27 insertions, 5 deletions
diff --git a/test/102_gendata_h48/01_h_1.in b/test/102_gendata_h48/01_h_1.in
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/test/102_gendata_h48/01_h_1.in
@@ -0,0 +1 @@
1
diff --git a/test/102_gendata_h48/01_h_1.out b/test/102_gendata_h48/01_h_1.out
new file mode 100644
index 0000000..56b7066
--- /dev/null
+++ b/test/102_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: 377
235: 4113
diff --git a/test/102_gendata_h48/gendata_h48_tests.c b/test/102_gendata_h48/gendata_h48_tests.c
index 35e6f42..9d96e75 100644
--- a/test/102_gendata_h48/gendata_h48_tests.c
+++ b/test/102_gendata_h48/gendata_h48_tests.c
@@ -1,23 +1,20 @@
1#include "../test.h" 1#include "../test.h"
2 2
3#define MAXH 1
4#define MAXDEPTH 5 3#define MAXDEPTH 5
5#define COCSEPSIZE 1119792 4#define COCSEPSIZE 1119792
6#define ETABLESIZE(h) (((3393 * 495 * 70) >> 1) << (h)) 5#define ETABLESIZE(h) (((3393 * 495 * 70) >> 1) << (h))
7#define SIZE (60000000 << MAXH)
8
9uint32_t buf[SIZE/4];
10 6
11size_t gendata_h48(void *, uint8_t, uint8_t); 7size_t gendata_h48(void *, uint8_t, uint8_t);
12 8
13int main(void) { 9int main(void) {
14 char str[STRLENMAX]; 10 char str[STRLENMAX];
15 uint8_t h, i; 11 uint8_t h, i;
16 uint32_t *h48info; 12 uint32_t *buf, *h48info;
17 size_t result; 13 size_t result;
18 14
19 fgets(str, STRLENMAX, stdin); 15 fgets(str, STRLENMAX, stdin);
20 h = atoi(str); 16 h = atoi(str);
17 buf = (uint32_t *)malloc(sizeof(uint32_t) * (60000000 << h));
21 result = gendata_h48(buf, h, MAXDEPTH); 18 result = gendata_h48(buf, h, MAXDEPTH);
22 h48info = buf + (ETABLESIZE(h) + COCSEPSIZE) / 4; 19 h48info = buf + (ETABLESIZE(h) + COCSEPSIZE) / 4;
23 20
@@ -33,5 +30,6 @@ int main(void) {
33 for (i = 0; i < MAXDEPTH+1; i++) 30 for (i = 0; i < MAXDEPTH+1; i++)
34 printf("%" PRIu32 ": %" PRIu32 "\n", i, h48info[i+1]); 31 printf("%" PRIu32 ": %" PRIu32 "\n", i, h48info[i+1]);
35 32
33 free(buf);
36 return 0; 34 return 0;
37} 35}

Generated with cgit - Back to sebastiano.tronto.net