chessCAMO
Protected Member Functions | Protected Attributes | List of all members
ChessTest Class Reference

This class describes a chess test for string or integer source and destination squares. It is used as a fixture to quickly set up tests without duplicating the code, by utilizing the overriden SetUp and TearDown functions. More...

Inheritance diagram for ChessTest:

Protected Member Functions

void SetUp (ifstream &myfile)
 Before a given test is executed, this sets up everything and initializes the variables Additionally, this performs the actual gameplay moves needed to obtain the final board representation. More...
 
void TearDown () override
 Post test operations are performed here, such as freeing dynamically allocated memory and clearing the cout flags. More...
 

Protected Attributes

Chess chess
 create the testing object More...
 
string src
 The source square of the piece to-be-moved. More...
 
string dest
 The destination square of the piece to-be-moved. More...
 
string fen_expected
 Expected FEN string for a given board representation before moves are made for it. More...
 
string fen_obtained
 Obtained FEN string for a given board representation after moves are made for it. More...
 

Detailed Description

This class describes a chess test for string or integer source and destination squares. It is used as a fixture to quickly set up tests without duplicating the code, by utilizing the overriden SetUp and TearDown functions.

Member Function Documentation

◆ SetUp()

void ChessTest::SetUp ( ifstream &  myfile)
inlineprotected

Before a given test is executed, this sets up everything and initializes the variables Additionally, this performs the actual gameplay moves needed to obtain the final board representation.

Parameters
myfileThe file to read moves from

◆ TearDown()

void ChessTest::TearDown ( )
inlineoverrideprotected

Post test operations are performed here, such as freeing dynamically allocated memory and clearing the cout flags.

Member Data Documentation

◆ chess

Chess ChessTest::chess
protected

create the testing object

◆ src

string ChessTest::src
protected

The source square of the piece to-be-moved.

Note
Coordinates are in [A1, H8] -> A1 is bottom left, H8 is top right

◆ dest

string ChessTest::dest
protected

The destination square of the piece to-be-moved.

Note
Coordinates are in [A1, H8] -> A1 is bottom left, H8 is top right

◆ fen_expected

string ChessTest::fen_expected
protected

Expected FEN string for a given board representation before moves are made for it.

◆ fen_obtained

string ChessTest::fen_obtained
protected

Obtained FEN string for a given board representation after moves are made for it.


The documentation for this class was generated from the following file: