From e0f38c7e42d9e48ac654f9dcedf8722ff1136106 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 14 Nov 2023 22:18:45 +0100 Subject: Renamed tests, added tests for permsign --- test/030_move/move_tests.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/030_move/move_tests.c (limited to 'test/030_move/move_tests.c') diff --git a/test/030_move/move_tests.c b/test/030_move/move_tests.c new file mode 100644 index 0000000..dde4c4e --- /dev/null +++ b/test/030_move/move_tests.c @@ -0,0 +1,25 @@ +#include "../test.h" + +cube_t applymoves(cube_t, char *); + +int main() { + char movestr[STRLENMAX], cubestr[STRLENMAX]; + cube_t cube; + + fgets(movestr, STRLENMAX, stdin); + fgets(cubestr, STRLENMAX, stdin); + cube = readcube("H48", cubestr); + + cube = applymoves(cube, movestr); + + if (iserror(cube)) { + printf("Error moving cube\n"); + } else if (!issolvable(cube)) { + printf("Moved cube is not solvable\n"); + } else { + writecube("H48", cube, cubestr); + printf("%s\n", cubestr); + } + + return 0; +} -- cgit v1.3