aboutsummaryrefslogtreecommitdiff
path: root/test/115_gendata_eoesep/gendata_eoesep_tests.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/115_gendata_eoesep/gendata_eoesep_tests.c')
-rw-r--r--test/115_gendata_eoesep/gendata_eoesep_tests.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/115_gendata_eoesep/gendata_eoesep_tests.c b/test/115_gendata_eoesep/gendata_eoesep_tests.c
new file mode 100644
index 0000000..7ed9778
--- /dev/null
+++ b/test/115_gendata_eoesep/gendata_eoesep_tests.c
@@ -0,0 +1,46 @@
1/*
2The test does not generate the full table. For reference, these are the values:
3
40: 1
51: 1
62: 3
73: 23
84: 235
95: 2281
106: 22069
117: 182776
128: 767847
139: 617858
1410: 8439
1511: 3
16*/
17
18#include "../test.h"
19
20#define DEPTH 6
21#define EMAX (495*70)
22#define CL 782
23#define ISIZE 512
24#define FULLSIZE (ISIZE + (CL*1024) + (4*EMAX))
25
26unsigned char buf[FULLSIZE];
27
28size_t gendata_eoesep(unsigned char [static FULLSIZE], uint8_t);
29int64_t readtableinfo(size_t, const unsigned char *, tableinfo_t *);
30
31void run(void) {
32 uint32_t i;
33 size_t result;
34 tableinfo_t info;
35
36 result = gendata_eoesep(buf, DEPTH);
37 if (readtableinfo(FULLSIZE, buf, &info) != NISSY_OK) {
38 printf("Error reading info from table\n");
39 return;
40 }
41
42 printf("%zu\n", result);
43 printf("Classes (ESEP only): %" PRIu64 "\n", info.classes);
44 for (i = 0; i <= DEPTH; i++)
45 printf("%" PRIu32 ": %" PRIu64 "\n", i, info.distribution[i]);
46}

Generated with cgit - Back to sebastiano.tronto.net