aboutsummaryrefslogtreecommitdiff
path: root/test/110_gendata_cocsep
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-07-17 08:54:44 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-07-17 08:54:44 +0200
commit270e5b0444f67781856bf80db51650af9cb89b0c (patch)
tree1f895ca8fdbf256dcdf550dd0a28ca99993efc08 /test/110_gendata_cocsep
parent2d0ab15ac1f81c76cb6bb31bbdad3d2ee339e062 (diff)
downloadnissy-core-270e5b0444f67781856bf80db51650af9cb89b0c.tar.gz
nissy-core-270e5b0444f67781856bf80db51650af9cb89b0c.zip
Renamed tests to make space for more coordinate tests
Diffstat (limited to 'test/110_gendata_cocsep')
-rw-r--r--test/110_gendata_cocsep/00_all.in0
-rw-r--r--test/110_gendata_cocsep/00_all.out13
-rw-r--r--test/110_gendata_cocsep/gendata_cocsep_tests.c27
3 files changed, 40 insertions, 0 deletions
diff --git a/test/110_gendata_cocsep/00_all.in b/test/110_gendata_cocsep/00_all.in
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/110_gendata_cocsep/00_all.in
diff --git a/test/110_gendata_cocsep/00_all.out b/test/110_gendata_cocsep/00_all.out
new file mode 100644
index 0000000..82eb6c2
--- /dev/null
+++ b/test/110_gendata_cocsep/00_all.out
@@ -0,0 +1,13 @@
11120256
2Classes: 3393
3Max value: 9
40: 1
51: 6
62: 63
73: 468
84: 3068
95: 15438
106: 53814
117: 71352
128: 8784
139: 96
diff --git a/test/110_gendata_cocsep/gendata_cocsep_tests.c b/test/110_gendata_cocsep/gendata_cocsep_tests.c
new file mode 100644
index 0000000..c1eef77
--- /dev/null
+++ b/test/110_gendata_cocsep/gendata_cocsep_tests.c
@@ -0,0 +1,27 @@
1#include "../test.h"
2
3#define BUF_SIZE 2000000
4
5size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *);
6int64_t readtableinfo(size_t, const unsigned char *, tableinfo_t *);
7
8void run(void) {
9 unsigned char buf[BUF_SIZE];
10 uint32_t i;
11 uint64_t selfsim[COCSEP_CLASSES];
12 cube_t rep[COCSEP_CLASSES];
13 size_t result;
14 tableinfo_t info;
15
16 result = gendata_cocsep(buf, selfsim, rep);
17 if (readtableinfo(BUF_SIZE, buf, &info) != NISSY_OK) {
18 printf("Error reading info from table\n");
19 return;
20 }
21
22 printf("%zu\n", result);
23 printf("Classes: %" PRIu64 "\n", info.classes);
24 printf("Max value: %" PRIu8 "\n", info.maxvalue);
25 for (i = 0; i < 10; i++)
26 printf("%" PRIu32 ": %" PRIu64 "\n", i, info.distribution[i]);
27}

Generated with cgit - Back to sebastiano.tronto.net