diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-14 22:42:08 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-14 22:42:08 +0100 |
| commit | d5e7698d0c7ecb61fe49263982f750c053147089 (patch) | |
| tree | 5a6c16f28bbec007665f4b85e5c96344dd4ed617 /test/090_solve_simple | |
| parent | e0f38c7e42d9e48ac654f9dcedf8722ff1136106 (diff) | |
| download | nissy-core-d5e7698d0c7ecb61fe49263982f750c053147089.tar.gz nissy-core-d5e7698d0c7ecb61fe49263982f750c053147089.zip | |
Added tests allowednext
Diffstat (limited to 'test/090_solve_simple')
| -rw-r--r-- | test/090_solve_simple/01_U_U3.in | 8 | ||||
| -rw-r--r-- | test/090_solve_simple/01_U_U3.out | 1 | ||||
| -rw-r--r-- | test/090_solve_simple/02_MUMU_alloptimal.in | 8 | ||||
| -rw-r--r-- | test/090_solve_simple/02_MUMU_alloptimal.out | 4 | ||||
| -rw-r--r-- | test/090_solve_simple/solve_simple_tests.c | 50 |
5 files changed, 71 insertions, 0 deletions
diff --git a/test/090_solve_simple/01_U_U3.in b/test/090_solve_simple/01_U_U3.in new file mode 100644 index 0000000..c0f7930 --- /dev/null +++ b/test/090_solve_simple/01_U_U3.in | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | UR0 UL0 DB0 DF0 UB0 UF0 DL0 DR0 FR0 FL0 BL0 BR0 UBR0 UFL0 DFL0 DBR0 UFR0 UBL0 DFR0 DBL0 | ||
| 2 | simple | ||
| 3 | |||
| 4 | normal | ||
| 5 | 0 | ||
| 6 | 3 | ||
| 7 | 3 | ||
| 8 | -1 | ||
diff --git a/test/090_solve_simple/01_U_U3.out b/test/090_solve_simple/01_U_U3.out new file mode 100644 index 0000000..ca934b4 --- /dev/null +++ b/test/090_solve_simple/01_U_U3.out | |||
| @@ -0,0 +1 @@ | |||
| U' | |||
diff --git a/test/090_solve_simple/02_MUMU_alloptimal.in b/test/090_solve_simple/02_MUMU_alloptimal.in new file mode 100644 index 0000000..f97c95f --- /dev/null +++ b/test/090_solve_simple/02_MUMU_alloptimal.in | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | UB0 DF0 DB0 UF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0 | ||
| 2 | simple | ||
| 3 | |||
| 4 | normal | ||
| 5 | 0 | ||
| 6 | -1 | ||
| 7 | 10 | ||
| 8 | 0 | ||
diff --git a/test/090_solve_simple/02_MUMU_alloptimal.out b/test/090_solve_simple/02_MUMU_alloptimal.out new file mode 100644 index 0000000..06cd521 --- /dev/null +++ b/test/090_solve_simple/02_MUMU_alloptimal.out | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | U2 R' L F2 R L' | ||
| 2 | R U2 R' L F2 L' | ||
| 3 | R L' U2 R' L F2 | ||
| 4 | L' U2 R' L F2 R | ||
diff --git a/test/090_solve_simple/solve_simple_tests.c b/test/090_solve_simple/solve_simple_tests.c new file mode 100644 index 0000000..4756dc0 --- /dev/null +++ b/test/090_solve_simple/solve_simple_tests.c | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | int64_t solve(cube_t, char *, char *, char *, int8_t, int8_t, int64_t, int8_t, | ||
| 4 | void *, char *); | ||
| 5 | |||
| 6 | int main() { | ||
| 7 | char cubestr[STRLENMAX], solverstr[STRLENMAX], optionsstr[STRLENMAX]; | ||
| 8 | char nisstypestr[STRLENMAX], minmovesstr[STRLENMAX]; | ||
| 9 | char maxmovesstr[STRLENMAX], maxsolsstr[STRLENMAX]; | ||
| 10 | char optimalstr[STRLENMAX], solutionsstr[STRLENMAX]; | ||
| 11 | cube_t cube; | ||
| 12 | int64_t maxsols; | ||
| 13 | int8_t minmoves, maxmoves, optimal; | ||
| 14 | |||
| 15 | fgets(cubestr, STRLENMAX, stdin); | ||
| 16 | fgets(solverstr, STRLENMAX, stdin); | ||
| 17 | fgets(optionsstr, STRLENMAX, stdin); | ||
| 18 | fgets(nisstypestr, STRLENMAX, stdin); | ||
| 19 | fgets(minmovesstr, STRLENMAX, stdin); | ||
| 20 | fgets(maxmovesstr, STRLENMAX, stdin); | ||
| 21 | fgets(maxsolsstr, STRLENMAX, stdin); | ||
| 22 | fgets(optimalstr, STRLENMAX, stdin); | ||
| 23 | |||
| 24 | solverstr[strcspn(solverstr, "\n")] = 0; | ||
| 25 | optionsstr[strcspn(optionsstr, "\n")] = 0; | ||
| 26 | nisstypestr[strcspn(nisstypestr, "\n")] = 0; | ||
| 27 | |||
| 28 | cube = readcube("H48", cubestr); | ||
| 29 | minmoves = atoi(minmovesstr); | ||
| 30 | maxmoves = atoi(maxmovesstr); | ||
| 31 | maxsols = atoi(maxsolsstr); | ||
| 32 | optimal = atoi(optimalstr); | ||
| 33 | |||
| 34 | solve( | ||
| 35 | cube, | ||
| 36 | solverstr, | ||
| 37 | optionsstr, | ||
| 38 | nisstypestr, | ||
| 39 | minmoves, | ||
| 40 | maxmoves, | ||
| 41 | maxsols, | ||
| 42 | optimal, | ||
| 43 | NULL, | ||
| 44 | solutionsstr | ||
| 45 | ); | ||
| 46 | |||
| 47 | printf("%s", solutionsstr); | ||
| 48 | |||
| 49 | return 0; | ||
| 50 | } | ||
