From 950f3f27b1bbd883767ae282be25414e04f11465 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 5 Aug 2025 10:13:43 +0200 Subject: Added build target to run solvetests --- tools/solvetest.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/solvetest.h b/tools/solvetest.h index 4c72ca5..75f7aab 100644 --- a/tools/solvetest.h +++ b/tools/solvetest.h @@ -95,23 +95,24 @@ void run(void) { for (i = 0; s[i].scramble[0]; i++) { printf("\n%d. %s\n", i, s[i].scramble); - /* Multiple solutions */ if (nissy_applymoves(NISSY_SOLVED_CUBE, s[i].scramble, cube) - == -1) { + == NISSY_ERROR_INVALID_MOVES) { printf("Invalid scramble\n"); - continue; + exit(1); } + nissy_solve(cube, solver, NISSFLAG, MINMOVES, MAXMOVES, MAXSOLUTIONS, OPTIMAL, 0, size, buf, SOL_BUFFER_LEN, sol, stats, NULL, NULL); + if (check_all(sol, s[i].solutions)) { printf("All solutions are correct\n"); } else { printf("Error!\n"); printf("Found solution(s):\n%s", sol); printf("Valid solution(s):\n%s", s[i].solutions); - return; + exit(1); } } -- cgit v1.3