diff options
Diffstat (limited to 'test/080_solve_simple/solve_simple_tests.c')
| -rw-r--r-- | test/080_solve_simple/solve_simple_tests.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/test/080_solve_simple/solve_simple_tests.c b/test/080_solve_simple/solve_simple_tests.c new file mode 100644 index 0000000..4756dc0 --- /dev/null +++ b/test/080_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 | } | ||
