Further work on better exceptions.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -133,7 +133,7 @@ TEST_CASE("Script Aggregator properly iterates when empty.", "[Battling, Scripti
|
||||
auto vec = ArbUt::List<ScriptWrapper>{};
|
||||
auto aggr = ScriptAggregator(vec);
|
||||
while (aggr.HasNext()) {
|
||||
throw CreatureException("Aggregator returned a script, but should have been empty.");
|
||||
THROW_CREATURE("Aggregator returned a script, but should have been empty.");
|
||||
}
|
||||
CHECK(ran == 0);
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
TEST_CASE("When throwing exception, what() is readable", "[Utilities]") {
|
||||
bool hasCaught = false;
|
||||
try {
|
||||
throw CreatureException("foobar");
|
||||
THROW_CREATURE("foobar");
|
||||
} catch (const std::exception& e) {
|
||||
hasCaught = true;
|
||||
INFO(e.what());
|
||||
REQUIRE(strcmp(e.what(), "foobar") == 0);
|
||||
REQUIRE(std::string(e.what()) == "[ExceptionTests.cpp:9] foobar");
|
||||
}
|
||||
REQUIRE(hasCaught);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user