Followup fixes

This commit is contained in:
Jeremy Rifkin 2024-11-11 22:41:58 -06:00
parent addaf02387
commit 5c9f5150fb
No known key found for this signature in database
GPG Key ID: 19AA8270105E8EB4
2 changed files with 4 additions and 1 deletions

View File

@ -42,7 +42,8 @@ TEST(FromCurrent, Basic) {
std::vector<int> line_numbers;
CPPTRACE_TRY {
line_numbers.insert(line_numbers.begin(), __LINE__ + 1);
stacktrace_from_current_1(line_numbers);
static volatile int tco_guard = stacktrace_from_current_1(line_numbers);
(void)tco_guard;
} CPPTRACE_CATCH(const std::runtime_error& e) {
EXPECT_EQ(e.what(), "foobar"sv);
const auto& trace = cpptrace::from_current_exception();
@ -124,6 +125,7 @@ TEST(FromCurrent, RawTrace) {
CPPTRACE_TRY {
line_numbers.insert(line_numbers.begin(), __LINE__ + 1);
static volatile int tco_guard = stacktrace_from_current_1(line_numbers);
(void)tco_guard;
} CPPTRACE_CATCH(const std::exception& e) {
EXPECT_EQ(e.what(), "foobar"sv);
const auto& raw_trace = cpptrace::raw_trace_from_current_exception();

View File

@ -43,6 +43,7 @@ TEST(FromCurrentZ, Basic) {
CPPTRACE_TRYZ {
line_numbers.insert(line_numbers.begin(), __LINE__ + 1);
static volatile int tco_guard = stacktrace_from_current_z_1(line_numbers);
(void)tco_guard;
} CPPTRACE_CATCHZ(const std::runtime_error& e) {
EXPECT_EQ(e.what(), "foobar"sv);
const auto& trace = cpptrace::from_current_exception();