From 270e5b0444f67781856bf80db51650af9cb89b0c Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 17 Jul 2025 08:54:44 +0200 Subject: Renamed tests to make space for more coordinate tests --- test/091_getcube/00_solved_0.in | 4 ++++ test/091_getcube/00_solved_0.out | 1 + test/091_getcube/02_scrambled.in | 4 ++++ test/091_getcube/02_scrambled.out | 1 + test/091_getcube/getcube_tests.c | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 42 insertions(+) create mode 100644 test/091_getcube/00_solved_0.in create mode 100644 test/091_getcube/00_solved_0.out create mode 100644 test/091_getcube/02_scrambled.in create mode 100644 test/091_getcube/02_scrambled.out create mode 100644 test/091_getcube/getcube_tests.c (limited to 'test/091_getcube') diff --git a/test/091_getcube/00_solved_0.in b/test/091_getcube/00_solved_0.in new file mode 100644 index 0000000..44e0be8 --- /dev/null +++ b/test/091_getcube/00_solved_0.in @@ -0,0 +1,4 @@ +0 +0 +0 +0 diff --git a/test/091_getcube/00_solved_0.out b/test/091_getcube/00_solved_0.out new file mode 100644 index 0000000..5aa6ba7 --- /dev/null +++ b/test/091_getcube/00_solved_0.out @@ -0,0 +1 @@ +ABCDEFGH=ABCDEFGHIJKL=A diff --git a/test/091_getcube/02_scrambled.in b/test/091_getcube/02_scrambled.in new file mode 100644 index 0000000..b24bfbf --- /dev/null +++ b/test/091_getcube/02_scrambled.in @@ -0,0 +1,4 @@ +367124500 +450 +30807 +562 diff --git a/test/091_getcube/02_scrambled.out b/test/091_getcube/02_scrambled.out new file mode 100644 index 0000000..4dfa7b7 --- /dev/null +++ b/test/091_getcube/02_scrambled.out @@ -0,0 +1 @@ +OINUTCXB=JCRIEDAbVaGH=A diff --git a/test/091_getcube/getcube_tests.c b/test/091_getcube/getcube_tests.c new file mode 100644 index 0000000..07e621e --- /dev/null +++ b/test/091_getcube/getcube_tests.c @@ -0,0 +1,32 @@ +#include "../test.h" + +cube_t getcube(int64_t, int64_t, int64_t, int64_t); + +void run(void) { + char str[STRLENMAX]; + oriented_cube_t cube; + int64_t ep, eo, cp, co; + + fgets(str, STRLENMAX, stdin); + ep = atoll(str); + fgets(str, STRLENMAX, stdin); + eo = atoll(str); + fgets(str, STRLENMAX, stdin); + cp = atoll(str); + fgets(str, STRLENMAX, stdin); + co = atoll(str); + + cube = (oriented_cube_t) { + .cube = getcube(ep, eo, cp, co), + .orientation = 0 + }; + + if (iserror(cube)) { + printf("Error cube\n"); + } else if (!isconsistent(cube)) { + printf("Inconsistent cube\n"); + } else { + writecube(cube, NISSY_SIZE_CUBE, str); + printf("%s\n", str); + } +} -- cgit v1.3