diff options
Diffstat (limited to 'test/115_gendata_eoesep/gendata_eoesep_tests.c')
| -rw-r--r-- | test/115_gendata_eoesep/gendata_eoesep_tests.c | 46 |
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 | /* | ||
| 2 | The test does not generate the full table. For reference, these are the values: | ||
| 3 | |||
| 4 | 0: 1 | ||
| 5 | 1: 1 | ||
| 6 | 2: 3 | ||
| 7 | 3: 23 | ||
| 8 | 4: 235 | ||
| 9 | 5: 2281 | ||
| 10 | 6: 22069 | ||
| 11 | 7: 182776 | ||
| 12 | 8: 767847 | ||
| 13 | 9: 617858 | ||
| 14 | 10: 8439 | ||
| 15 | 11: 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 | |||
| 26 | unsigned char buf[FULLSIZE]; | ||
| 27 | |||
| 28 | size_t gendata_eoesep(unsigned char [static FULLSIZE], uint8_t); | ||
| 29 | int64_t readtableinfo(size_t, const unsigned char *, tableinfo_t *); | ||
| 30 | |||
| 31 | void 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 | } | ||
