1 #ifndef CHESSGAMESTATETEST_H
2 #define CHESSGAMESTATETEST_H
4 #include <cppunit/extensions/HelperMacros.h>
5 #include <cppunit/TestCaller.h>
6 #include <cppunit/TestResult.h>
7 #include <cppunit/TestFixture.h>
8 #include <cppunit/TestAssert.h>
10 #include "hlvariant/customboard.h"
14 template <typename Piece
> class Board
;
17 template <typename Board
, typename Move
> class GameState
;
18 template <typename State
> class LegalityCheck
;
24 typedef HLVariant::Chess::Move ChessMove
;
25 typedef HLVariant::Chess::Piece ChessPiece
;
26 typedef HLVariant::CustomBoard
<8, 8, ChessPiece
> Chessboard
;
27 typedef HLVariant::Chess::GameState
<Chessboard
, ChessMove
> ChessGameState
;
28 typedef HLVariant::Chess::LegalityCheck
<ChessGameState
> ChessLegalityCheck
;
30 class ChessLegalityTest
: public CppUnit::TestFixture
{
31 CPPUNIT_TEST_SUITE(ChessLegalityTest
);
32 CPPUNIT_TEST(test_movements
);
33 CPPUNIT_TEST(test_pseudolegal
);
34 CPPUNIT_TEST(test_simple_move
);
35 CPPUNIT_TEST(test_promotion
);
36 CPPUNIT_TEST(test_en_passant
);
37 CPPUNIT_TEST(test_castling
);
38 CPPUNIT_TEST(test_attack1
);
39 CPPUNIT_TEST(test_attack2
);
40 CPPUNIT_TEST(test_attack3
);
41 CPPUNIT_TEST(test_attack4
);
42 CPPUNIT_TEST_SUITE_END();
44 ChessGameState
* m_state
;
45 ChessLegalityCheck
* m_legality_check
;
50 void test_movements();
51 void test_pseudolegal();
52 void test_simple_move();
53 void test_promotion();
54 void test_en_passant();
62 #endif // CHESSGAMESTATETEST_H