diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-04-22 16:12:21 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-04-22 16:12:21 +0200 |
| commit | bab22e1946a656088804b61cf765461b48744971 (patch) | |
| tree | 43ae3798e5c2f4fc63e68df72d134e742fcaf834 /test/121_coorddata_dr | |
| parent | 93522effba2f200257141189de5925a23fca93b8 (diff) | |
| download | nissy-core-bab22e1946a656088804b61cf765461b48744971.tar.gz nissy-core-bab22e1946a656088804b61cf765461b48744971.zip | |
Update tests for oriented_cube_t
Diffstat (limited to 'test/121_coorddata_dr')
| -rw-r--r-- | test/121_coorddata_dr/coorddata_dr.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/121_coorddata_dr/coorddata_dr.c b/test/121_coorddata_dr/coorddata_dr.c index d7efcfb..e8407c8 100644 --- a/test/121_coorddata_dr/coorddata_dr.c +++ b/test/121_coorddata_dr/coorddata_dr.c | |||
| @@ -16,6 +16,7 @@ void run(void) { | |||
| 16 | unsigned char *data; | 16 | unsigned char *data; |
| 17 | size_t size; | 17 | size_t size; |
| 18 | cube_t cube; | 18 | cube_t cube; |
| 19 | oriented_cube_t oc; | ||
| 19 | uint64_t coord, coord2; | 20 | uint64_t coord, coord2; |
| 20 | 21 | ||
| 21 | size = coordinate_dr_gendata(NULL); | 22 | size = coordinate_dr_gendata(NULL); |
| @@ -25,7 +26,8 @@ void run(void) { | |||
| 25 | for (coord = 0; coord < BOUND; coord++) { | 26 | for (coord = 0; coord < BOUND; coord++) { |
| 26 | cube = coordinate_dr_cube(coord, data); | 27 | cube = coordinate_dr_cube(coord, data); |
| 27 | 28 | ||
| 28 | if (!isconsistent(cube)) { | 29 | oc = (oriented_cube_t) { .cube = cube, .orientation = 0 }; |
| 30 | if (!isconsistent(oc)) { | ||
| 29 | printf("Error: invcoord of %" PRId64 | 31 | printf("Error: invcoord of %" PRId64 |
| 30 | " is not consistent\n", coord); | 32 | " is not consistent\n", coord); |
| 31 | goto cleanup; | 33 | goto cleanup; |
| @@ -43,9 +45,10 @@ void run(void) { | |||
| 43 | } | 45 | } |
| 44 | 46 | ||
| 45 | if (!found) { | 47 | if (!found) { |
| 48 | oc = (oriented_cube_t){.cube = cube, .orientation = 0}; | ||
| 46 | printf("Error: invcoord of %" PRId64 " returns %" | 49 | printf("Error: invcoord of %" PRId64 " returns %" |
| 47 | PRId64 " with cube:\n", coord, coord2); | 50 | PRId64 " with cube:\n", coord, coord2); |
| 48 | writecube(cube, STRLENMAX, str); | 51 | writecube(oc, STRLENMAX, str); |
| 49 | printf("%s\n", str); | 52 | printf("%s\n", str); |
| 50 | goto cleanup; | 53 | goto cleanup; |
| 51 | } | 54 | } |
