Added CustomBoard.
[tagua/yd.git] / tests / hlvariants / chesslegalitytest.h
blob1eff300065736ac57d10581c72d89ca9ad08cc7a
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"
12 // forward decl
13 namespace HLVariant {
14 template <typename Piece> class Board;
16 namespace Chess {
17 template <typename Board, typename Move> class GameState;
18 template <typename State> class LegalityCheck;
19 class Move;
20 class Piece;
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();
43 private:
44 ChessGameState* m_state;
45 ChessLegalityCheck* m_legality_check;
46 public:
47 void setUp();
48 void tearDown();
50 void test_movements();
51 void test_pseudolegal();
52 void test_simple_move();
53 void test_promotion();
54 void test_en_passant();
55 void test_castling();
56 void test_attack1();
57 void test_attack2();
58 void test_attack3();
59 void test_attack4();
62 #endif // CHESSGAMESTATETEST_H