aboutsummaryrefslogtreecommitdiff
path: root/test/050_transform/transform_tests.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/050_transform/transform_tests.c')
-rw-r--r--test/050_transform/transform_tests.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/test/050_transform/transform_tests.c b/test/050_transform/transform_tests.c
index 30d62da..e22a4a1 100644
--- a/test/050_transform/transform_tests.c
+++ b/test/050_transform/transform_tests.c
@@ -11,30 +11,22 @@
11#define STRLENMAX 10000 11#define STRLENMAX 10000
12 12
13int main() { 13int main() {
14 char str[STRLENMAX]; 14 char cubestr[STRLENMAX], transtr[STRLENMAX];
15 trans_t t;
16 cube_t cube; 15 cube_t cube;
17 16
18 fgets(str, STRLENMAX, stdin); 17 fgets(transtr, STRLENMAX, stdin);
19 t = readtrans(str); 18 fgets(cubestr, STRLENMAX, stdin);
19 cube = readcube("H48", cubestr);
20 20
21 if (t >= 48) { 21 cube = applytrans(cube, transtr);
22 printf("Error reading trans\n");
23 return 1;
24 }
25
26 fgets(str, STRLENMAX, stdin);
27 cube = readcube(H48, str);
28
29 cube = transform(cube, t);
30 22
31 if (iserror(cube)) { 23 if (iserror(cube)) {
32 printf("Error transforming cube\n"); 24 printf("Error transforming cube\n");
33 } else if (!issolvable(cube)) { 25 } else if (!issolvable(cube)) {
34 printf("Transformed cube is not solvable\n"); 26 printf("Transformed cube is not solvable\n");
35 } else { 27 } else {
36 writecube(H48, cube, str); 28 writecube("H48", cube, cubestr);
37 printf("%s\n", str); 29 printf("%s\n", cubestr);
38 } 30 }
39 31
40 return 0; 32 return 0;

Generated with cgit - Back to sebastiano.tronto.net