diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-07-14 21:28:37 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-07-14 21:28:37 +0200 |
| commit | 61e03f9f4eecf3d5811b11c44c9ef778f0a93bc7 (patch) | |
| tree | a7a6edc2e44689ed62472bdece1d9bf6a300419f /test/103_cocsep_ttrep | |
| parent | a016aa7f78c86c59bab3ae4970f8cc339186bc91 (diff) | |
| download | nissy-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.in | 0 | ||||
| -rw-r--r-- | test/103_cocsep_ttrep/00_all.out | 0 | ||||
| -rw-r--r-- | test/103_cocsep_ttrep/cocsep_ttrep_tests.c | 33 |
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 | |||
| 5 | uint8_t inverse_trans(uint8_t); | ||
| 6 | cube_t transform_corners(cube_t); | ||
| 7 | int64_t coord_cocsep(cube_t); | ||
| 8 | size_t gendata_cocsep(void *, uint64_t *, cube_t *); | ||
| 9 | |||
| 10 | void 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 | } | ||
