Make CreatureException inherit from runtime_error.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user