]> git.draconx.ca Git - rrace.git/blobdiff - tests/game.at
Bump dxcommon to pull in testsuite fixes.
[rrace.git] / tests / game.at
index 76c802a5beb9072783c092cf1cc604f38d266eb6..7defcdb15ff737dec5c6b7bc40b815e6afcf8b23 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright © 2022 Nick Bowler
+# Copyright © 2022-2023 Nick Bowler
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -47,6 +47,8 @@ below(0)    below(1)    below(2)    below(3)    below(4)
 
 AT_CLEANUP
 
+TEST_TAP_SIMPLE([board_rect], [boardrect], [], [board])
+
 AT_SETUP([game_do_move zigzag])
 
 AT_CHECK([boardmove m4_do(
@@ -627,3 +629,35 @@ AT_DATA([expout],
 AT_CHECK([checkgoal <boards.dat >result.dat && cat result.dat], [0], [expout])
 
 AT_CLEANUP
+
+AT_SETUP([game_overlay_goal])
+
+AT_DATA([boards.dat], [dnl
+0 0 0  0  0  0
+0 0 0 -1  0  0
+0 0 0  0 -1  0
+0 0 0  0  0 -1
+1ffffff 1ffffff 1ffffff 0 0 0
+])
+
+AT_DATA([expout], [dnl
+0000000 0000000 0000000
+00739c0 0000000 0000000
+0000000 00739c0 0000000
+0000000 0000000 00739c0
+1f8c63f 1f8c63f 1f8c63f
+])
+
+AT_CHECK([overlaygoal <boards.dat >result.dat && cat result.dat],
+  [0], [expout])
+
+AT_CLEANUP
+
+# Basic check that we get different initial games if we run the program
+# multiple times in sequence.
+AT_SETUP([game_reset initial seed])
+
+AT_CHECK([initboard >a && initboard >b && initboard >c])
+AT_CHECK([diff a b || diff b c || diff a c || exit 42], [42], [ignore-nolog])
+
+AT_CLEANUP