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/101_cocsep_transform_invariant | |
| 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/101_cocsep_transform_invariant')
7 files changed, 36 insertions, 0 deletions
diff --git a/test/101_cocsep_transform_invariant/00_solved.in b/test/101_cocsep_transform_invariant/00_solved.in new file mode 100644 index 0000000..dff224d --- /dev/null +++ b/test/101_cocsep_transform_invariant/00_solved.in | |||
| @@ -0,0 +1 @@ | |||
| UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0 | |||
diff --git a/test/101_cocsep_transform_invariant/00_solved.out b/test/101_cocsep_transform_invariant/00_solved.out new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/101_cocsep_transform_invariant/00_solved.out | |||
diff --git a/test/101_cocsep_transform_invariant/01_U.in b/test/101_cocsep_transform_invariant/01_U.in new file mode 100644 index 0000000..b5b36ad --- /dev/null +++ b/test/101_cocsep_transform_invariant/01_U.in | |||
| @@ -0,0 +1 @@ | |||
| UR0 UL0 DB0 DF0 UB0 UF0 DL0 DR0 FR0 FL0 BL0 BR0 UBR0 UFL0 DFL0 DBR0 UFR0 UBL0 DFR0 DBL0 | |||
diff --git a/test/101_cocsep_transform_invariant/01_U.out b/test/101_cocsep_transform_invariant/01_U.out new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/101_cocsep_transform_invariant/01_U.out | |||
diff --git a/test/101_cocsep_transform_invariant/02_scrambled.in b/test/101_cocsep_transform_invariant/02_scrambled.in new file mode 100644 index 0000000..f6e1f48 --- /dev/null +++ b/test/101_cocsep_transform_invariant/02_scrambled.in | |||
| @@ -0,0 +1 @@ | |||
| DL1 BR0 DR0 UR1 DF0 FL1 BL0 UL0 FR0 UF0 DB1 UB0 UFR0 DBL1 DBR0 UFL1 DFR1 DFL1 UBL2 UBR0 | |||
diff --git a/test/101_cocsep_transform_invariant/02_scrambled.out b/test/101_cocsep_transform_invariant/02_scrambled.out new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/101_cocsep_transform_invariant/02_scrambled.out | |||
diff --git a/test/101_cocsep_transform_invariant/cocsep_transform_invariant.c b/test/101_cocsep_transform_invariant/cocsep_transform_invariant.c new file mode 100644 index 0000000..b0286e5 --- /dev/null +++ b/test/101_cocsep_transform_invariant/cocsep_transform_invariant.c | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | #define COCLASS_MASK (UINT32_C(0xFFFF) << UINT32_C(16)) | ||
| 4 | #define COCLASS(x) (((x) & COCLASS_MASK) >> UINT32_C(16)) | ||
| 5 | |||
| 6 | #define COCSEP_CLASSES 3393 | ||
| 7 | |||
| 8 | size_t gendata_cocsep(void *, uint64_t *, cube_t *); | ||
| 9 | cube_t transform(cube_t, uint8_t); | ||
| 10 | int64_t coord_cocsep(cube_t); | ||
| 11 | |||
| 12 | void run(void) { | ||
| 13 | uint8_t t; | ||
| 14 | uint32_t buf[300000]; | ||
| 15 | uint64_t selfsim[COCSEP_CLASSES]; | ||
| 16 | int64_t coord, tcoord; | ||
| 17 | char str[STRLENMAX]; | ||
| 18 | cube_t cube, transd, rep[COCSEP_CLASSES]; | ||
| 19 | |||
| 20 | fgets(str, STRLENMAX, stdin); | ||
| 21 | cube = readcube("H48", str); | ||
| 22 | |||
| 23 | gendata_cocsep(buf, selfsim, rep); | ||
| 24 | |||
| 25 | coord = (int64_t)COCLASS(buf[coord_cocsep(cube)]); | ||
| 26 | for (t = 0; t < 48; t++) { | ||
| 27 | transd = transform(cube, t); | ||
| 28 | tcoord = (int64_t)COCLASS(buf[coord_cocsep(transd)]); | ||
| 29 | if (coord != tcoord) | ||
| 30 | printf("Error: expected %" PRId64 | ||
| 31 | " but got %" PRId64 "\n", coord, tcoord); | ||
| 32 | } | ||
| 33 | } | ||
