aboutsummaryrefslogtreecommitdiff
path: root/test/103_cocsep_ttrep
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-07-14 21:28:37 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-07-14 21:28:37 +0200
commit61e03f9f4eecf3d5811b11c44c9ef778f0a93bc7 (patch)
treea7a6edc2e44689ed62472bdece1d9bf6a300419f /test/103_cocsep_ttrep
parenta016aa7f78c86c59bab3ae4970f8cc339186bc91 (diff)
downloadnissy-core-61e03f9f4eecf3d5811b11c44c9ef778f0a93bc7.tar.gz
nissy-core-61e03f9f4eecf3d5811b11c44c9ef778f0a93bc7.zip
Found a sneaky bug (it's all a mess now)
Diffstat (limited to 'test/103_cocsep_ttrep')
-rw-r--r--test/103_cocsep_ttrep/00_all.in0
-rw-r--r--test/103_cocsep_ttrep/00_all.out0
-rw-r--r--test/103_cocsep_ttrep/cocsep_ttrep_tests.c33
3 files changed, 33 insertions, 0 deletions
diff --git a/test/103_cocsep_ttrep/00_all.in b/test/103_cocsep_ttrep/00_all.in
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/103_cocsep_ttrep/00_all.in
diff --git a/test/103_cocsep_ttrep/00_all.out b/test/103_cocsep_ttrep/00_all.out
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/103_cocsep_ttrep/00_all.out
diff --git a/test/103_cocsep_ttrep/cocsep_ttrep_tests.c b/test/103_cocsep_ttrep/cocsep_ttrep_tests.c
new file mode 100644
index 0000000..78f8014
--- /dev/null
+++ b/test/103_cocsep_ttrep/cocsep_ttrep_tests.c
@@ -0,0 +1,33 @@
1#include "../test.h"
2
3#define COCSEP_CLASSES 3393
4
5uint8_t inverse_trans(uint8_t);
6cube_t transform_corners(cube_t);
7int64_t coord_cocsep(cube_t);
8size_t gendata_cocsep(void *, uint64_t *, cube_t *);
9
10void run(void) {
11 uint8_t t, tinv;
12 uint32_t buf[300000], tt;
13 uint64_t selfsim[COCSEP_CLASSES];
14 int64_t i, j;
15 cube_t rep[COCSEP_CLASSES], c, d;
16
17 gendata_cocsep(buf, selfsim, rep);
18
19 for (i = 0; i < COCSEP_CLASSES; i++) {
20 c = rep[i];
21 for (t = 0; t < 48; t++) {
22 tinv = inverse_trans(t);
23 d = transform_corners(c);
24 j = coord_cocsep(d);
25 tt = (buf[j] & (0xFF << 8)) >> 8;
26 if (tt != tinv)
27 printf("cocsep %" PRId64 " <- %" PRId64 ": "
28 "expected t %" PRIu8 " (inverse of %"
29 PRIu8 "), got %" PRIu32 "\n",
30 i, j, tinv, t, tt);
31 }
32 }
33}

Generated with cgit - Back to sebastiano.tronto.net