diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-08-01 16:52:44 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-08-01 16:52:44 +0200 |
| commit | 1bd4691d9cc46ec75adbe899b289a1ebc5460721 (patch) | |
| tree | ea71166e05d399e57a13d6e3d7d96d4737f8f7bd /test/082_invcoord_epe | |
| parent | 0844b0ecd00bd6d68a7bafaeae0ee3d420db8ff6 (diff) | |
| download | nissy-core-1bd4691d9cc46ec75adbe899b289a1ebc5460721.tar.gz nissy-core-1bd4691d9cc46ec75adbe899b289a1ebc5460721.zip | |
Added CPEPE coordinate in preparation of full DRFIN solver
Diffstat (limited to 'test/082_invcoord_epe')
| -rw-r--r-- | test/082_invcoord_epe/00_all.in | 0 | ||||
| -rw-r--r-- | test/082_invcoord_epe/00_all.out | 1 | ||||
| -rw-r--r-- | test/082_invcoord_epe/invcoord_epe_tests.c | 32 |
3 files changed, 33 insertions, 0 deletions
diff --git a/test/082_invcoord_epe/00_all.in b/test/082_invcoord_epe/00_all.in new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/082_invcoord_epe/00_all.in | |||
diff --git a/test/082_invcoord_epe/00_all.out b/test/082_invcoord_epe/00_all.out new file mode 100644 index 0000000..d6109db --- /dev/null +++ b/test/082_invcoord_epe/00_all.out | |||
| @@ -0,0 +1 @@ | |||
| All good | |||
diff --git a/test/082_invcoord_epe/invcoord_epe_tests.c b/test/082_invcoord_epe/invcoord_epe_tests.c new file mode 100644 index 0000000..69c3c50 --- /dev/null +++ b/test/082_invcoord_epe/invcoord_epe_tests.c | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | #define FACT_4 24 | ||
| 4 | |||
| 5 | uint64_t coord_epe(cube_t); | ||
| 6 | cube_t invcoord_epe(uint64_t); | ||
| 7 | |||
| 8 | void run(void) { | ||
| 9 | oriented_cube_t cube; | ||
| 10 | uint64_t coord, coord2; | ||
| 11 | |||
| 12 | cube.orientation = 0; | ||
| 13 | |||
| 14 | /* Test all possible values for CP coordinate */ | ||
| 15 | for (coord = 0; coord < FACT_4; coord++) { | ||
| 16 | cube.cube = invcoord_epe(coord); | ||
| 17 | |||
| 18 | if (!isconsistent(cube)) { | ||
| 19 | printf("Not consistent\n"); | ||
| 20 | return; | ||
| 21 | } | ||
| 22 | |||
| 23 | coord2 = coord_epe(cube.cube); | ||
| 24 | if (coord != coord2) { | ||
| 25 | printf("Error: invcoord of %" PRIu64 | ||
| 26 | " returns %" PRIu64 "\n", coord, coord2); | ||
| 27 | return; | ||
| 28 | } | ||
| 29 | } | ||
| 30 | |||
| 31 | printf("All good\n"); | ||
| 32 | } | ||
