Compare commits

...

4 Commits

Author SHA1 Message Date
Karma Riuk
139a5c7d8f fixed missing imports
Some checks are pending
pre-release / Pre Release (push) Waiting to run
2025-02-02 14:54:17 +01:00
Karma Riuk
3a2988d351 fixed permissions of fields 2025-02-02 14:53:17 +01:00
Karma Riuk
c758d1854f removed useless imports 2025-02-02 14:52:47 +01:00
Karma Riuk
53a0755547 extracted the assert equals to another file to
have mulitple test files
2025-02-02 14:52:13 +01:00
4 changed files with 14 additions and 19 deletions

View File

@ -1,6 +1,4 @@
#include <cctype>
#include <ios>
#include <iostream>
#include <map>
#include <string>
@ -25,7 +23,7 @@ enum CastleRights {
};
class Board {
public: // make this private after debugging
private:
int squares[64] = {Piece::None};
Colour turn;
int castle_rights;

View File

@ -1,5 +1,7 @@
#include "board.cpp"
#include <iostream>
int main(int argc, char* argv[]) {
std::string pos =
"rnbq1k1r/pp1Pbppp/2p5/8/2B5/8/PPP1NnPP/RNBQK2R w KQ - 1 8";

View File

@ -1,20 +1,5 @@
#include "../board.cpp"
#define IS_TRUE(x) \
{ \
if (!(x)) \
std::cout << __FUNCTION__ << " failed on line " << __LINE__ \
<< std::endl; \
}
#define ASSERT_EQUALS(expected, actual) \
{ \
if (expected != actual) \
std::cout << "Expected: " << std::endl \
<< '\t' << expected << std::endl \
<< "Got: " << std::endl \
<< '\t' << actual << std::endl; \
}
#include "lib.cpp"
int main() {
std::string pos = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR";

10
cpp/tests/lib.cpp Normal file
View File

@ -0,0 +1,10 @@
#pragma once
#define ASSERT_EQUALS(expected, actual) \
{ \
if (expected != actual) \
std::cout << "Expected: " << std::endl \
<< '\t' << expected << std::endl \
<< "Got: " << std::endl \
<< '\t' << actual << std::endl; \
}