gendata_eoesep_tests.c (852B)
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 char buf[FULLSIZE]; 27 28 size_t gendata_eoesep(char [static FULLSIZE], uint8_t); 29 bool readtableinfo(uint64_t, const 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): %zu\n", info.classes); 44 for (i = 0; i <= DEPTH; i++) 45 printf("%" PRIu32 ": %" PRIu64 "\n", i, info.distribution[i]); 46 }