aboutsummaryrefslogtreecommitdiff
path: root/test/00_basic/basic_tests.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-09-08 18:28:30 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2023-09-08 18:28:30 +0200
commit4d08bf731a099de2d174c73489636e1a12935aee (patch)
treec751858cb6e33172c97a1123432f7c59d7d94d7e /test/00_basic/basic_tests.c
parentc5dfc897160bc9bbc6a91c77b5d58d421fd1cfe1 (diff)
downloadnissy-core-4d08bf731a099de2d174c73489636e1a12935aee.tar.gz
nissy-core-4d08bf731a099de2d174c73489636e1a12935aee.zip
New implementation, moved old to experiments/
Diffstat (limited to 'test/00_basic/basic_tests.c')
-rw-r--r--test/00_basic/basic_tests.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/test/00_basic/basic_tests.c b/test/00_basic/basic_tests.c
index cc2a55c..8c52941 100644
--- a/test/00_basic/basic_tests.c
+++ b/test/00_basic/basic_tests.c
@@ -4,16 +4,29 @@
4 4
5#include "../../src/cube.h" 5#include "../../src/cube.h"
6 6
7void
8check(cube_t cube, char *name)
9{
10 printf("%s is%s consistent\n", name, isconsistent(cube) ? "" : " NOT");
11 printf("%s is%s solved\n", name, issolved(cube) ? "" : " NOT");
12}
13
14void
15check2(cube_t cube1, char *name1, cube_t cube2, char *name2)
16{
17 printf("%s and %s are%s equal\n", name1, name2,
18 equal(cube1, cube2) ? "" : " NOT");
19}
20
7int main() { 21int main() {
8 cube_t z, s; 22 cube_t zero = (cube_t){0};
9 23
10 s = solvedcube; 24 check(solvedcube, "Solved");
11 printf("Solved %s consistent\n", isconsistent(s) ? "is" : "is NOT"); 25 check(zero, "Zero");
12 printf("Solved %s solved\n", issolved(s) ? "is" : "is NOT");
13 26
14 z = (cube_t){0}; 27 check2(solvedcube, "Solved", solvedcube, "Solved");
15 printf("Zero %s consistent\n", isconsistent(z) ? "is" : "is NOT"); 28 check2(solvedcube, "Solved", zero, "Zero");
16 printf("Zero %s solved\n", issolved(z) ? "is" : "is NOT"); 29 check2(zero, "Zero", solvedcube, "Solved");
17 30
18 return 0; 31 return 0;
19} 32}

Generated with cgit - Back to sebastiano.tronto.net