CreatureLib/tests/ExceptionTests.cpp

15 lines
385 B
C++
Raw Normal View History

#ifdef TESTS_BUILD
#include <cstring>
#include "../extern/catch.hpp"
#include "../src/Core/Exceptions/CreatureException.hpp"
TEST_CASE("When throwing exception, what() is readable", "[Utilities]") {
try {
throw CreatureException("foobar");
} catch (const CreatureException& e) {
INFO(e.what());
REQUIRE(strcmp(e.what(), "foobar") == 0);
}
}
#endif