aboutsummaryrefslogtreecommitdiff
path: root/test/120_gendata_eo/gendata_eo_tests.c
blob: 08c495ebc7d0211a9e959486672f5a0ad9699d71 (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
/*
Pruning table values (from nissy):
0: 1
1: 2
2: 25
3: 202
4: 620
5: 900
6: 285
7: 13
*/

#include "../test.h"

#define ISIZE 512
#define FULLSIZE (ISIZE + 1024)

unsigned char buf[FULLSIZE];

size_t gendata_coord_dispatch(const char *, unsigned char *);
bool readtableinfo(uint64_t, const unsigned char *, tableinfo_t *);

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

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

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

Generated with cgit - Back to sebastiano.tronto.net