#ifdef TESTS_BUILD #include #include "../extern/catch.hpp" #include "../src/Library/Exceptions/CreatureException.hpp" TEST_CASE("When throwing exception, what() is readable", "[Utilities]") { bool hasCaught = false; try { THROW_CREATURE("foobar"); } catch (const ArbUt::Exception& e) { hasCaught = true; INFO(e.what()); REQUIRE(std::string(e.what()) == "[ExceptionTests.cpp:9] foobar"); } REQUIRE(hasCaught); } #endif