aboutsummaryrefslogtreecommitdiff
path: root/test/000_basic/basic_tests.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-07-28 13:52:00 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-07-28 13:52:00 +0200
commit7f24b27652ee6fa84e38f181cea57f319af0c204 (patch)
tree269b15baf20c2ae4ed3bb1fdb052340311aa1981 /test/000_basic/basic_tests.c
parent9b248f3b46d5dc0e9522ed264ef71e422a5bc5a5 (diff)
downloadnissy-core-7f24b27652ee6fa84e38f181cea57f319af0c204.tar.gz
nissy-core-7f24b27652ee6fa84e38f181cea57f319af0c204.zip
Make failed assert exit immediately
Diffstat (limited to '')
-rw-r--r--test/000_basic/basic_tests.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/test/000_basic/basic_tests.c b/test/000_basic/basic_tests.c
deleted file mode 100644
index df38e88..0000000
--- a/test/000_basic/basic_tests.c
+++ /dev/null
@@ -1,33 +0,0 @@
1#include "../test.h"
2
3bool issolved(oriented_cube_t);
4bool equal(cube_t, cube_t);
5
6void
7check(oriented_cube_t cube, char *name)
8{
9 printf("%s is%s solvable\n", name, issolvable(cube) ? "" : " NOT");
10 printf("%s is%s solved\n", name, issolved(cube) ? "" : " NOT");
11}
12
13void
14check2(oriented_cube_t cube1, char *name1, oriented_cube_t cube2, char *name2)
15{
16 bool eq = equal(cube1.cube, cube2.cube) &&
17 cube1.orientation == cube2.orientation;
18 printf("%s and %s are%s equal\n", name1, name2, eq ? "" : " NOT");
19}
20
21void run(void) {
22 oriented_cube_t zero, solved;
23
24 memset(&zero, 0, sizeof(oriented_cube_t));
25 solved = solvedcube();
26
27 check(solved, "Solved");
28 check(zero, "Zero");
29
30 check2(solved, "Solved", solved, "Solved");
31 check2(solved, "Solved", zero, "Zero");
32 check2(zero, "Zero", solved, "Solved");
33}

Generated with cgit - Back to sebastiano.tronto.net