From 086a06fe3d84ac8b2e74c824e05f9d23f0b292ab Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 22 Dec 2025 18:07:06 +0100 Subject: Added tests for copy_co, renamed some tests --- test/078_copy_edges/00_solved_scrambled.in | 2 ++ test/078_copy_edges/00_solved_scrambled.out | 1 + test/078_copy_edges/copy_edges_tests.c | 25 +++++++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 test/078_copy_edges/00_solved_scrambled.in create mode 100644 test/078_copy_edges/00_solved_scrambled.out create mode 100644 test/078_copy_edges/copy_edges_tests.c (limited to 'test/078_copy_edges') diff --git a/test/078_copy_edges/00_solved_scrambled.in b/test/078_copy_edges/00_solved_scrambled.in new file mode 100644 index 0000000..38c1566 --- /dev/null +++ b/test/078_copy_edges/00_solved_scrambled.in @@ -0,0 +1,2 @@ +ABCDEFGH=ABCDEFGHIJKL=A +CILVXGMR=FKbGIDSXBJAU=A diff --git a/test/078_copy_edges/00_solved_scrambled.out b/test/078_copy_edges/00_solved_scrambled.out new file mode 100644 index 0000000..0d38603 --- /dev/null +++ b/test/078_copy_edges/00_solved_scrambled.out @@ -0,0 +1 @@ +ABCDEFGH=FKbGIDSXBJAU=A diff --git a/test/078_copy_edges/copy_edges_tests.c b/test/078_copy_edges/copy_edges_tests.c new file mode 100644 index 0000000..f3b0589 --- /dev/null +++ b/test/078_copy_edges/copy_edges_tests.c @@ -0,0 +1,25 @@ +#include "../test.h" + +void copy_edges(cube_t *, cube_t); + +void run(void) { + char str[STRLENMAX]; + oriented_cube_t c1, c2; + + fgets(str, STRLENMAX, stdin); + c1 = readcube(str); + + fgets(str, STRLENMAX, stdin); + c2 = readcube(str); + + copy_edges(&c1.cube, c2.cube); + + if (iserror(c1)) { + printf("Error setting EO\n"); + } else if (!isconsistent(c1)) { + printf("Setting EO resulted in inconsistent cube\n"); + } else { + writecube(c1, NISSY_SIZE_CUBE, str); + printf("%s\n", str); + } +} -- cgit v1.3