aboutsummaryrefslogtreecommitdiff
path: root/test/105_gendata_eoesep/gendata_eoesep_tests.c
blob: 0c22d7f1a16c1f0bc1667eb231fbc51822e16c3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
The test does not generate the full table. For reference, these are the values:

0: 1
1: 1
2: 3
3: 23
4: 235
5: 2281
6: 22069
7: 182776
8: 767847
9: 617858
10: 8439
11: 3
*/

#include "../test.h"

#define DEPTH 6
#define EMAX (495*70)
#define CL 782
#define ISIZE 512
#define FULLSIZE (ISIZE + (CL*1024) + (4*EMAX))

unsigned char buf[FULLSIZE];

size_t gendata_eoesep(unsigned char [static FULLSIZE], uint8_t);
bool readtableinfo(uint64_t, const unsigned char *, tableinfo_t *);

void run(void) {
	uint32_t i;
	size_t result;
	tableinfo_t info;

	result = gendata_eoesep(buf, DEPTH);
	if (readtableinfo(FULLSIZE, buf, &info) != NISSY_OK) {
		printf("Error reading info from table\n");
		return;
	}

	printf("%zu\n", result);
	printf("Classes (ESEP only): %zu\n", info.classes);
	for (i = 0; i <= DEPTH; i++)
		printf("%" PRIu32 ": %" PRIu64 "\n", i, info.distribution[i]);
}

Generated with cgit - Back to sebastiano.tronto.net