From 72e018b066bd5cc3ce0181b43865a227e8b9b6ec Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 12 Apr 2024 20:22:01 +0200 Subject: Initial fork from H48 --- test/050_compose/compose_tests.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/050_compose/compose_tests.c (limited to 'test/050_compose/compose_tests.c') diff --git a/test/050_compose/compose_tests.c b/test/050_compose/compose_tests.c new file mode 100644 index 0000000..0ea4eff --- /dev/null +++ b/test/050_compose/compose_tests.c @@ -0,0 +1,26 @@ +#include "../test.h" + +cube_t compose(cube_t, cube_t); + +int main(void) { + char str[STRLENMAX]; + cube_t c1, c2, c3; + + fgets(str, STRLENMAX, stdin); + c1 = readcube("H48", str); + fgets(str, STRLENMAX, stdin); + c2 = readcube("H48", str); + + c3 = compose(c1, c2); + + if (iserror(c3)) { + printf("Error composing cubes\n"); + } else if (!issolvable(c3)) { + printf("Composed cube is not solvable\n"); + } else { + writecube("H48", c3, str); + printf("%s\n", str); + } + + return 0; +} -- cgit v1.3