diff options
Diffstat (limited to 'test/050_compose/compose_tests.c')
| -rw-r--r-- | test/050_compose/compose_tests.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/050_compose/compose_tests.c b/test/050_compose/compose_tests.c new file mode 100644 index 0000000..d28b225 --- /dev/null +++ b/test/050_compose/compose_tests.c | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | cube_t compose(cube_t, cube_t); | ||
| 4 | |||
| 5 | int main() { | ||
| 6 | char str[STRLENMAX]; | ||
| 7 | cube_t c1, c2, c3; | ||
| 8 | |||
| 9 | fgets(str, STRLENMAX, stdin); | ||
| 10 | c1 = readcube("H48", str); | ||
| 11 | fgets(str, STRLENMAX, stdin); | ||
| 12 | c2 = readcube("H48", str); | ||
| 13 | |||
| 14 | c3 = compose(c1, c2); | ||
| 15 | |||
| 16 | if (iserror(c3)) { | ||
| 17 | printf("Error composing cubes\n"); | ||
| 18 | } else if (!issolvable(c3)) { | ||
| 19 | printf("Composed cube is not solvable\n"); | ||
| 20 | } else { | ||
| 21 | writecube("H48", c3, str); | ||
| 22 | printf("%s\n", str); | ||
| 23 | } | ||
| 24 | |||
| 25 | return 0; | ||
| 26 | } | ||
