File: chessserializationtest.h

package info (click to toggle)
tagua 1.0~alpha2-15
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 8,028 kB
  • ctags: 7,178
  • sloc: cpp: 26,149; ansic: 13,039; makefile: 182; ruby: 87; sh: 39
file content (54 lines) | stat: -rw-r--r-- 1,530 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef CHESSSERIALIZATIONTEST_H
#define CHESSSERIALIZATIONTEST_H

#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/TestCaller.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestFixture.h>
#include <cppunit/TestAssert.h>

#include "hlvariant/variantdata.h"
#include "hlvariant/chess/variant.h"

typedef HLVariant::Chess::Variant Chess;
typedef VariantData<Chess>::LegalityCheck ChessCheck;
typedef VariantData<Chess>::GameState ChessGameState;
typedef VariantData<Chess>::Serializer ChessSerializer;
typedef VariantData<Chess>::Piece ChessPiece;
typedef VariantData<Chess>::Move ChessMove;

class ChessSerializationTest : public CppUnit::TestFixture {
  CPPUNIT_TEST_SUITE(ChessSerializationTest);
  CPPUNIT_TEST(test_pawn);
  CPPUNIT_TEST(test_check);
  CPPUNIT_TEST(test_check_capture);
  CPPUNIT_TEST(test_promotion);
  CPPUNIT_TEST(test_promotion_capture);
  CPPUNIT_TEST(test_promotion_check);
  CPPUNIT_TEST(test_promotion_capture_check);
  CPPUNIT_TEST(test_castling_k);
  CPPUNIT_TEST(test_castling_q);
  
  CPPUNIT_TEST(regression_knight_king);
  CPPUNIT_TEST_SUITE_END();
private:
  ChessGameState* m_state;
  ChessCheck* m_check;
public:
  void setUp();
  void tearDown();

  void test_pawn();
  void test_check();
  void test_check_capture();
  void test_promotion();
  void test_promotion_capture();
  void test_promotion_check();
  void test_promotion_capture_check();
  void test_castling_k();
  void test_castling_q();
  
  void regression_knight_king();
};

#endif // CHESSSERIALIZATIONTEST_H