diff --git a/cpp/tests/fen.cpp b/cpp/tests/fen.cpp index 857e917..17f41e3 100644 --- a/cpp/tests/fen.cpp +++ b/cpp/tests/fen.cpp @@ -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"; diff --git a/cpp/tests/lib.cpp b/cpp/tests/lib.cpp new file mode 100644 index 0000000..82db6bb --- /dev/null +++ b/cpp/tests/lib.cpp @@ -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; \ + }