]> git.draconx.ca Git - rrace.git/blobdiff - tests/game.at
Combine x11_redraw_icon and x11_redraw_goal.
[rrace.git] / tests / game.at
index bfd98190aec8e465cd85a8cea9bd236425babe4b..4d367afd9a1e3f4ced0cb0f650fb52a97681158b 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
+AT_SETUP([board bitmap functions])
+
+AT_CHECK([boardbit], [0],
+[[left(0)     left(1)     left(2)     left(3)     left(4)
+ @....       @@...       @@@..       @@@@.       @@@@@
+ @....       @@...       @@@..       @@@@.       @@@@@
+ @....       @@...       @@@..       @@@@.       @@@@@
+ @....       @@...       @@@..       @@@@.       @@@@@
+ @....       @@...       @@@..       @@@@.       @@@@@
+
+right(0)    right(1)    right(2)    right(3)    right(4)
+ @@@@@       .@@@@       ..@@@       ...@@       ....@
+ @@@@@       .@@@@       ..@@@       ...@@       ....@
+ @@@@@       .@@@@       ..@@@       ...@@       ....@
+ @@@@@       .@@@@       ..@@@       ...@@       ....@
+ @@@@@       .@@@@       ..@@@       ...@@       ....@
+
+above(0)    above(1)    above(2)    above(3)    above(4)
+ @@@@@       @@@@@       @@@@@       @@@@@       @@@@@
+ .....       @@@@@       @@@@@       @@@@@       @@@@@
+ .....       .....       @@@@@       @@@@@       @@@@@
+ .....       .....       .....       @@@@@       @@@@@
+ .....       .....       .....       .....       @@@@@
+
+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(
@@ -563,3 +599,33 @@ grep -v '^ok' out], [0], [1..200
 ])
 
 AT_CLEANUP
+
+AT_SETUP([game_check_goal])
+
+AT_DATA([boards.dat],
+[[0 0 0 0 0 0
+1f8c63f 1f8c63f 1f8c63f 0000 0000 0000
+1f8c63f 1f8c63f 1f8c63f ffff 0000 0000
+1f8c63f 1f8c63f 1f8c63f 0000 ffff 0000
+1f8c63f 1f8c63f 1f8c63f 0000 0000 ffff
+00739c0 1f8c63f 1f8c63f ffff 0000 0000
+1f8c63f 00739c0 1f8c63f 0000 ffff 0000
+1f8c63f 1f8c63f 00739c0 0000 0000 ffff
+0000000 0000000 0000000 0001 0020 0400
+]])
+
+AT_DATA([expout],
+[[00000
+00000
+739c0
+739c0
+739c0
+00000
+00000
+00000
+10840
+]])
+
+AT_CHECK([checkgoal <boards.dat >result.dat && cat result.dat], [0], [expout])
+
+AT_CLEANUP