diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-17 08:54:44 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-17 08:54:44 +0200 |
| commit | 270e5b0444f67781856bf80db51650af9cb89b0c (patch) | |
| tree | 1f895ca8fdbf256dcdf550dd0a28ca99993efc08 /test/111_cocsep_transform_invariant | |
| parent | 2d0ab15ac1f81c76cb6bb31bbdad3d2ee339e062 (diff) | |
| download | nissy-core-270e5b0444f67781856bf80db51650af9cb89b0c.tar.gz nissy-core-270e5b0444f67781856bf80db51650af9cb89b0c.zip | |
Renamed tests to make space for more coordinate tests
Diffstat (limited to 'test/111_cocsep_transform_invariant')
7 files changed, 34 insertions, 0 deletions
diff --git a/test/111_cocsep_transform_invariant/00_solved.in b/test/111_cocsep_transform_invariant/00_solved.in new file mode 100644 index 0000000..5aa6ba7 --- /dev/null +++ b/test/111_cocsep_transform_invariant/00_solved.in | |||
| @@ -0,0 +1 @@ | |||
| ABCDEFGH=ABCDEFGHIJKL=A | |||
diff --git a/test/111_cocsep_transform_invariant/00_solved.out b/test/111_cocsep_transform_invariant/00_solved.out new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/111_cocsep_transform_invariant/00_solved.out | |||
diff --git a/test/111_cocsep_transform_invariant/01_U.in b/test/111_cocsep_transform_invariant/01_U.in new file mode 100644 index 0000000..250d3a1 --- /dev/null +++ b/test/111_cocsep_transform_invariant/01_U.in | |||
| @@ -0,0 +1 @@ | |||
| FECDABGH=EFCDBAGHIJKL=A | |||
diff --git a/test/111_cocsep_transform_invariant/01_U.out b/test/111_cocsep_transform_invariant/01_U.out new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/111_cocsep_transform_invariant/01_U.out | |||
diff --git a/test/111_cocsep_transform_invariant/02_scrambled.in b/test/111_cocsep_transform_invariant/02_scrambled.in new file mode 100644 index 0000000..6bb8d86 --- /dev/null +++ b/test/111_cocsep_transform_invariant/02_scrambled.in | |||
| @@ -0,0 +1 @@ | |||
| APDMOKRF=WLHUDZKFIASB=A | |||
diff --git a/test/111_cocsep_transform_invariant/02_scrambled.out b/test/111_cocsep_transform_invariant/02_scrambled.out new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/111_cocsep_transform_invariant/02_scrambled.out | |||
diff --git a/test/111_cocsep_transform_invariant/cocsep_transform_invariant.c b/test/111_cocsep_transform_invariant/cocsep_transform_invariant.c new file mode 100644 index 0000000..5553fd1 --- /dev/null +++ b/test/111_cocsep_transform_invariant/cocsep_transform_invariant.c | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); | ||
| 4 | cube_t transform(cube_t, uint8_t); | ||
| 5 | int64_t coord_cocsep(cube_t); | ||
| 6 | |||
| 7 | void run(void) { | ||
| 8 | uint8_t t; | ||
| 9 | unsigned char buf[2000000]; | ||
| 10 | uint32_t *cocsepdata; | ||
| 11 | uint64_t selfsim[COCSEP_CLASSES]; | ||
| 12 | int64_t coord, tcoord; | ||
| 13 | char str[STRLENMAX]; | ||
| 14 | oriented_cube_t cube; | ||
| 15 | cube_t rep[COCSEP_CLASSES], transd; | ||
| 16 | |||
| 17 | fgets(str, STRLENMAX, stdin); | ||
| 18 | cube = readcube(str); | ||
| 19 | |||
| 20 | gendata_cocsep(buf, selfsim, rep); | ||
| 21 | cocsepdata = (uint32_t *)((char *)buf + INFOSIZE); | ||
| 22 | |||
| 23 | coord = (int64_t)COCLASS(cocsepdata[coord_cocsep(cube.cube)]); | ||
| 24 | for (t = 0; t < 48; t++) { | ||
| 25 | transd = transform(cube.cube, t); | ||
| 26 | tcoord = (int64_t)COCLASS(cocsepdata[coord_cocsep(transd)]); | ||
| 27 | if (coord != tcoord) | ||
| 28 | printf("Error: expected %" PRId64 | ||
| 29 | " but got %" PRId64 "\n", coord, tcoord); | ||
| 30 | } | ||
| 31 | } | ||
