diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-03-28 16:48:03 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-03-28 16:48:03 +0100 |
| commit | 50fedbdbf98bcf01bcd95259ac5a93ae108b3c68 (patch) | |
| tree | 87cee7aa1cf7fcc465809b718bf9efa6e1f1b7b6 | |
| parent | 5d0dce810cede2acb0c98aa113e3f568209a97b1 (diff) | |
| download | nissy-core-50fedbdbf98bcf01bcd95259ac5a93ae108b3c68.tar.gz nissy-core-50fedbdbf98bcf01bcd95259ac5a93ae108b3c68.zip | |
Make invcoord_co test more comprehensive
Diffstat (limited to '')
29 files changed, 22 insertions, 41 deletions
diff --git a/test/079_invcoord_co/00_all.in b/test/079_invcoord_co/00_all.in new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/079_invcoord_co/00_all.in | |||
diff --git a/test/079_invcoord_co/00_all.out b/test/079_invcoord_co/00_all.out new file mode 100644 index 0000000..d6109db --- /dev/null +++ b/test/079_invcoord_co/00_all.out | |||
| @@ -0,0 +1 @@ | |||
| All good | |||
diff --git a/test/079_invcoord_co/00_solved.in b/test/079_invcoord_co/00_solved.in deleted file mode 100644 index 573541a..0000000 --- a/test/079_invcoord_co/00_solved.in +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 0 | ||
diff --git a/test/079_invcoord_co/00_solved.out b/test/079_invcoord_co/00_solved.out deleted file mode 100644 index 573541a..0000000 --- a/test/079_invcoord_co/00_solved.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 0 | ||
diff --git a/test/079_invcoord_co/01_U.in b/test/079_invcoord_co/01_U.in deleted file mode 100644 index 573541a..0000000 --- a/test/079_invcoord_co/01_U.in +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 0 | ||
diff --git a/test/079_invcoord_co/01_U.out b/test/079_invcoord_co/01_U.out deleted file mode 100644 index 573541a..0000000 --- a/test/079_invcoord_co/01_U.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 0 | ||
diff --git a/test/079_invcoord_co/02_U2.in b/test/079_invcoord_co/02_U2.in deleted file mode 100644 index 573541a..0000000 --- a/test/079_invcoord_co/02_U2.in +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 0 | ||
diff --git a/test/079_invcoord_co/02_U2.out b/test/079_invcoord_co/02_U2.out deleted file mode 100644 index 573541a..0000000 --- a/test/079_invcoord_co/02_U2.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 0 | ||
diff --git a/test/079_invcoord_co/03_U3.in b/test/079_invcoord_co/03_U3.in deleted file mode 100644 index 573541a..0000000 --- a/test/079_invcoord_co/03_U3.in +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 0 | ||
diff --git a/test/079_invcoord_co/03_U3.out b/test/079_invcoord_co/03_U3.out deleted file mode 100644 index 573541a..0000000 --- a/test/079_invcoord_co/03_U3.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 0 | ||
diff --git a/test/079_invcoord_co/04_D.in b/test/079_invcoord_co/04_D.in deleted file mode 100644 index 573541a..0000000 --- a/test/079_invcoord_co/04_D.in +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 0 | ||
diff --git a/test/079_invcoord_co/04_D.out b/test/079_invcoord_co/04_D.out deleted file mode 100644 index 573541a..0000000 --- a/test/079_invcoord_co/04_D.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 0 | ||
diff --git a/test/079_invcoord_co/07_R.in b/test/079_invcoord_co/07_R.in deleted file mode 100644 index 1f3d8a7..0000000 --- a/test/079_invcoord_co/07_R.in +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 1028 | ||
diff --git a/test/079_invcoord_co/07_R.out b/test/079_invcoord_co/07_R.out deleted file mode 100644 index 1f3d8a7..0000000 --- a/test/079_invcoord_co/07_R.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 1028 | ||
diff --git a/test/079_invcoord_co/08_R2.in b/test/079_invcoord_co/08_R2.in deleted file mode 100644 index 573541a..0000000 --- a/test/079_invcoord_co/08_R2.in +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 0 | ||
diff --git a/test/079_invcoord_co/08_R2.out b/test/079_invcoord_co/08_R2.out deleted file mode 100644 index 573541a..0000000 --- a/test/079_invcoord_co/08_R2.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 0 | ||
diff --git a/test/079_invcoord_co/10_L.in b/test/079_invcoord_co/10_L.in deleted file mode 100644 index f96ac06..0000000 --- a/test/079_invcoord_co/10_L.in +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 105 | ||
diff --git a/test/079_invcoord_co/10_L.out b/test/079_invcoord_co/10_L.out deleted file mode 100644 index f96ac06..0000000 --- a/test/079_invcoord_co/10_L.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 105 | ||
diff --git a/test/079_invcoord_co/13_F.in b/test/079_invcoord_co/13_F.in deleted file mode 100644 index 86868c5..0000000 --- a/test/079_invcoord_co/13_F.in +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 1630 | ||
diff --git a/test/079_invcoord_co/13_F.out b/test/079_invcoord_co/13_F.out deleted file mode 100644 index 86868c5..0000000 --- a/test/079_invcoord_co/13_F.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 1630 | ||
diff --git a/test/079_invcoord_co/14_F2.in b/test/079_invcoord_co/14_F2.in deleted file mode 100644 index 573541a..0000000 --- a/test/079_invcoord_co/14_F2.in +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 0 | ||
diff --git a/test/079_invcoord_co/14_F2.out b/test/079_invcoord_co/14_F2.out deleted file mode 100644 index 573541a..0000000 --- a/test/079_invcoord_co/14_F2.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 0 | ||
diff --git a/test/079_invcoord_co/16_B.in b/test/079_invcoord_co/16_B.in deleted file mode 100644 index 1c599d4..0000000 --- a/test/079_invcoord_co/16_B.in +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 516 | ||
diff --git a/test/079_invcoord_co/16_B.out b/test/079_invcoord_co/16_B.out deleted file mode 100644 index 1c599d4..0000000 --- a/test/079_invcoord_co/16_B.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 516 | ||
diff --git a/test/079_invcoord_co/17_B2.in b/test/079_invcoord_co/17_B2.in deleted file mode 100644 index 573541a..0000000 --- a/test/079_invcoord_co/17_B2.in +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 0 | ||
diff --git a/test/079_invcoord_co/17_B2.out b/test/079_invcoord_co/17_B2.out deleted file mode 100644 index 573541a..0000000 --- a/test/079_invcoord_co/17_B2.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 0 | ||
diff --git a/test/079_invcoord_co/20_scrambled.in b/test/079_invcoord_co/20_scrambled.in deleted file mode 100644 index 6943e4d..0000000 --- a/test/079_invcoord_co/20_scrambled.in +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 957 | ||
diff --git a/test/079_invcoord_co/20_scrambled.out b/test/079_invcoord_co/20_scrambled.out deleted file mode 100644 index 6943e4d..0000000 --- a/test/079_invcoord_co/20_scrambled.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | 957 | ||
diff --git a/test/079_invcoord_co/invcoord_co_tests.c b/test/079_invcoord_co/invcoord_co_tests.c index c3bf90e..9f7c3d5 100644 --- a/test/079_invcoord_co/invcoord_co_tests.c +++ b/test/079_invcoord_co/invcoord_co_tests.c | |||
| @@ -1,28 +1,34 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | #define POW_3_7 2187 | ||
| 4 | |||
| 3 | int64_t coord_co(cube_t); | 5 | int64_t coord_co(cube_t); |
| 4 | cube_t invcoord_co(int64_t); | 6 | cube_t invcoord_co(int64_t); |
| 5 | 7 | ||
| 6 | void run(void) { | 8 | void run(void) { |
| 7 | char str[STRLENMAX]; | ||
| 8 | cube_t cube; | 9 | cube_t cube; |
| 9 | int64_t coord; | 10 | int64_t coord, coord2; |
| 10 | 11 | ||
| 11 | fgets(str, STRLENMAX, stdin); | 12 | /* Test all possible values for CO coordinate */ |
| 12 | coord = atoll(str); | 13 | for (coord = 0; coord < POW_3_7; coord++) { |
| 14 | cube = invcoord_co(coord); | ||
| 13 | 15 | ||
| 14 | cube = invcoord_co(coord); | 16 | if (!isconsistent(cube)) { |
| 17 | printf("Not consistent\n"); | ||
| 18 | return; | ||
| 19 | } | ||
| 20 | if (!issolvable(cube)) { | ||
| 21 | printf("Not solvable\n"); | ||
| 22 | return; | ||
| 23 | } | ||
| 15 | 24 | ||
| 16 | if (!isconsistent(cube)) { | 25 | coord2 = coord_co(cube); |
| 17 | printf("Not consistent\n"); | 26 | if (coord != coord2) { |
| 18 | return; | 27 | printf("Error: invcoord of %" PRId64 |
| 19 | } | 28 | " returns %" PRId64 "\n", coord, coord2); |
| 20 | if (!issolvable(cube)) { | 29 | return; |
| 21 | printf("Not solvable\n"); | 30 | } |
| 22 | return; | ||
| 23 | } | 31 | } |
| 24 | 32 | ||
| 25 | coord = coord_co(cube); | 33 | printf("All good\n"); |
| 26 | |||
| 27 | printf("%" PRId64 "\n", coord); | ||
| 28 | } | 34 | } |
