copy_corners_tests.c (469B)
1 #include "../test.h" 2 3 void copy_corners(cube_t *, cube_t); 4 5 void run(void) { 6 char str[STRLENMAX]; 7 cube_t c1, c2; 8 9 fgets(str, STRLENMAX, stdin); 10 c1 = readcube("H48", str); 11 12 fgets(str, STRLENMAX, stdin); 13 c2 = readcube("H48", str); 14 15 copy_corners(&c1, c2); 16 17 if (iserror(c1)) { 18 printf("Error setting EO\n"); 19 } else if (!isconsistent(c1)) { 20 printf("Setting EO resulted in inconsistent cube\n"); 21 } else { 22 writecube("H48", c1, str); 23 printf("%s\n", str); 24 } 25 }