aboutsummaryrefslogtreecommitdiff
path: root/test/104_cocsep_ttrep
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-07-15 09:15:35 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-07-15 09:15:35 +0200
commit67c35b638c04ab7a860aac0c166936e9481633c9 (patch)
tree5b05ac7936a9c97085dc21af0704b508c54bad71 /test/104_cocsep_ttrep
parent6c896b0e619f83b0337d20f92b14e26fcd550b42 (diff)
downloadnissy-core-67c35b638c04ab7a860aac0c166936e9481633c9.tar.gz
nissy-core-67c35b638c04ab7a860aac0c166936e9481633c9.zip
Added test for selfsim distribution
Diffstat (limited to 'test/104_cocsep_ttrep')
-rw-r--r--test/104_cocsep_ttrep/00_all.in0
-rw-r--r--test/104_cocsep_ttrep/00_all.out0
-rw-r--r--test/104_cocsep_ttrep/cocsep_ttrep_tests.c36
3 files changed, 36 insertions, 0 deletions
diff --git a/test/104_cocsep_ttrep/00_all.in b/test/104_cocsep_ttrep/00_all.in
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/104_cocsep_ttrep/00_all.in
diff --git a/test/104_cocsep_ttrep/00_all.out b/test/104_cocsep_ttrep/00_all.out
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/104_cocsep_ttrep/00_all.out
diff --git a/test/104_cocsep_ttrep/cocsep_ttrep_tests.c b/test/104_cocsep_ttrep/cocsep_ttrep_tests.c
new file mode 100644
index 0000000..f0da151
--- /dev/null
+++ b/test/104_cocsep_ttrep/cocsep_ttrep_tests.c
@@ -0,0 +1,36 @@
1#include "../test.h"
2
3#define COCSEP_CLASSES 3393
4#define TTREP_MASK (UINT32_C(0xFF) << UINT32_C(8))
5#define TTREP(x) (((x) & TTREP_MASK) >> UINT32_C(8))
6
7uint8_t inverse_trans(uint8_t);
8cube_t transform_corners(cube_t, uint8_t);
9int64_t coord_cocsep(cube_t);
10size_t gendata_cocsep(void *, uint64_t *, cube_t *);
11
12void run(void) {
13 uint8_t t;
14 uint32_t buf[300000], tt;
15 uint64_t selfsim[COCSEP_CLASSES];
16 int64_t i, j, k, l;
17 cube_t rep[COCSEP_CLASSES], c, d;
18
19 gendata_cocsep(buf, selfsim, rep);
20
21 for (i = 0; i < COCSEP_CLASSES; i++) {
22 c = rep[i];
23 for (t = 0; t < 48; t++) {
24 d = transform_corners(c, t);
25 j = coord_cocsep(d);
26 tt = TTREP(buf[j]);
27 d = transform_corners(d, tt);
28 k = coord_cocsep(d);
29 l = coord_cocsep(c);
30 if (k != l)
31 printf("cocsep %" PRId64 " (%" PRId64 "): "
32 "%" PRId64 " ttrep %" PRIu8
33 " -> %" PRId64 "\n", i, l, j, tt, k);
34 }
35 }
36}

Generated with cgit - Back to sebastiano.tronto.net