diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-14 22:18:45 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-14 22:18:45 +0100 |
| commit | e0f38c7e42d9e48ac654f9dcedf8722ff1136106 (patch) | |
| tree | fc92f1dc8d0ade82541d216e05ba37b3ddc97ca3 /test/050_compose/compose_tests.c | |
| parent | ad9bdca9741b5f038610cbe0536131ab0dc7b511 (diff) | |
| download | nissy-core-e0f38c7e42d9e48ac654f9dcedf8722ff1136106.tar.gz nissy-core-e0f38c7e42d9e48ac654f9dcedf8722ff1136106.zip | |
Renamed tests, added tests for permsign
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 | } | ||
