Support new exception type with stack trace.
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:
21
tests/ExceptionTests.cpp
Normal file
21
tests/ExceptionTests.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifdef TESTS_BUILD
|
||||
#include "../extern/catch.hpp"
|
||||
#include "../src/Exception.hpp"
|
||||
using namespace ArbUt;
|
||||
|
||||
TEST_CASE("Throw exception, get stack trace") {
|
||||
try {
|
||||
throw ArbUt::Exception("foobar");
|
||||
}
|
||||
catch (const ArbUt::Exception& e) {
|
||||
REQUIRE(e.GetStacktrace() ==
|
||||
"ExceptionTests.cpp[8] ____C_A_T_C_H____T_E_S_T____0()\n"
|
||||
"catch.hpp[14036] Catch::TestInvokerAsFunction::invoke() const\n"
|
||||
"catch.hpp[13929] Catch::TestCase::invoke() const\n"
|
||||
"catch.hpp[12791] Catch::RunContext::invokeActiveTestCase()\n"
|
||||
"catch.hpp[12756] Catch::RunContext::runCurrentTest(std::__cxx11::basic_string<char, ...\n"
|
||||
"catch.hpp[12525] Catch::RunContext::runTest(Catch::TestCase const&)\n");
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user