Improves exception stack traces by including inlined functions, and displaying snippets of code.
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:
@@ -3,20 +3,14 @@
|
||||
#include "../src/Exception.hpp"
|
||||
using namespace ArbUt;
|
||||
|
||||
#ifndef WINDOWS
|
||||
__attribute__((optnone))
|
||||
#endif
|
||||
static void
|
||||
Thrower() {
|
||||
throw ArbUt::Exception("foobar");
|
||||
}
|
||||
static void Thrower() { throw ArbUt::Exception("foobar"); }
|
||||
|
||||
TEST_CASE("Throw exception get stack trace") {
|
||||
try {
|
||||
Thrower();
|
||||
} catch (const ArbUt::Exception& e) {
|
||||
REQUIRE(e.GetStacktrace(1) == "Stacktrace with depth 1: \n"
|
||||
"ExceptionTests.cpp[11] Thrower()\n");
|
||||
"ExceptionTests.cpp[6] static void Thrower() { throw ArbUt::Exception(\"foobar\"); }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user