Make CreatureException inherit from runtime_error.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-02-22 15:07:16 +01:00
parent 442d6cd5b1
commit be6b2778a5
2 changed files with 7 additions and 8 deletions

View File

@@ -4,12 +4,15 @@
#include "../src/Core/Exceptions/CreatureException.hpp"
TEST_CASE("When throwing exception, what() is readable", "[Utilities]") {
bool hasCaught = false;
try {
throw CreatureException("foobar");
} catch (const CreatureException& e) {
} catch (const std::exception& e) {
hasCaught = true;
INFO(e.what());
REQUIRE(strcmp(e.what(), "foobar") == 0);
}
REQUIRE(hasCaught);
}
#endif