18 lines
492 B
C++
18 lines
492 B
C++
#ifdef TESTS_BUILD
|
|
#include "../extern/doctest.hpp"
|
|
#include "../src/Exception.hpp"
|
|
using namespace ArbUt;
|
|
|
|
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[6] static void Thrower() { throw ArbUt::Exception(\"foobar\"); }\n");
|
|
}
|
|
}
|
|
|
|
#endif |