From a1b2dacda6aeb7f39a7a75e13d6e7040da1b5675 Mon Sep 17 00:00:00 2001
From: Paolo Capriotti
Date: Mon, 30 Jul 2007 00:59:41 +0200
Subject: [PATCH] Added some legality checking tests.
---
tests/hlvariants/chesslegalitytest.cpp | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/tests/hlvariants/chesslegalitytest.cpp b/tests/hlvariants/chesslegalitytest.cpp
index 5232ee7..9d26352 100644
--- a/tests/hlvariants/chesslegalitytest.cpp
+++ b/tests/hlvariants/chesslegalitytest.cpp
@@ -21,6 +21,16 @@ void ChessLegalityTest::test_simple_move() {
ChessMove e3(Point(4, 6), Point(4, 3));
CPPUNIT_ASSERT(!m_legality_check->legal(e3));
+
+ ChessMove Nf3(Point(6, 7), Point(5, 5));
+ CPPUNIT_ASSERT(m_legality_check->legal(Nf3));
+
+ ChessMove Bc4(Point(5, 7), Point(2, 4));
+ CPPUNIT_ASSERT(!m_legality_check->legal(Bc4));
+
+ ChessMove tmp(Point(5, 7), Point(2, 4));
+ m_state->board().set(Point(4, 6), ChessPiece());
+ CPPUNIT_ASSERT(m_legality_check->legal(tmp));
}
--
2.11.4.GIT