extracted the assert equals to another file to

have mulitple test files
This commit is contained in:
Karma Riuk 2025-02-02 14:52:13 +01:00
parent 4792daf127
commit 53a0755547
2 changed files with 11 additions and 16 deletions

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; \
}