aboutsummaryrefslogtreecommitdiff
path: root/test/100_gendata_cocsep/gendata_cocsep_tests.c
blob: 46b9443005222cc9db3eb18405236b51cd8d27f7 (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
#include "../test.h"

#define BUF_SIZE 2000000

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

void run(void) {
	unsigned char buf[BUF_SIZE];
	uint32_t i;
	uint64_t selfsim[COCSEP_CLASSES];
	cube_t rep[COCSEP_CLASSES];
	size_t result;
	tableinfo_t info;

	result = gendata_cocsep(buf, selfsim, rep);
	if (readtableinfo(BUF_SIZE, buf, &info) != NISSY_OK) {
		printf("Error reading info from table\n");
		return;
	}

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

Generated with cgit - Back to sebastiano.tronto.net