From f5d9fe6211bd397deb0ac19b634f551edfa0f6b8 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Sun, 30 Jan 2022 20:19:02 +0100 Subject: Initialize project --- tests/stockfish.cpp | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 tests/stockfish.cpp (limited to 'tests/stockfish.cpp') diff --git a/tests/stockfish.cpp b/tests/stockfish.cpp new file mode 100644 index 0000000..3b1c9e5 --- /dev/null +++ b/tests/stockfish.cpp @@ -0,0 +1,145 @@ +#include "UCI.hpp" +#include + +#define LATENCY 2000 + +using namespace uciadapter; + +TEST_CASE("Stockfish Initialisation", "[stockfish/init]") { + // Using bad engine path shoud raise an exception + REQUIRE_THROWS([&]() { UCI("./random_path_zlkdejdlk"); }()); + REQUIRE_NOTHROW([&]() { UCI("./stockfish_engine"); }()); + + UCI u("./stockfish_engine"); + REQUIRE(u.GetName() == "Stockfish 14.1"); + REQUIRE(u.GetAuthor() == "the Stockfish developers (see AUTHORS file)"); + + std::vector