Skip to content

Commit

Permalink
Move tests to their own function to ensure two stack frames
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Jun 21, 2024
1 parent 2820ed3 commit 4352901
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,12 @@ void test_empty_basic_stacktrace() {
BOOST_TEST(!(st > st_t(0, 0)));
}

void test_stacktrace_limits()
{
BOOST_TEST_EQ(boost::stacktrace::stacktrace(0, 1).size(), 1);
BOOST_TEST_EQ(boost::stacktrace::stacktrace(1, 1).size(), 1);
}

int main() {
test_deeply_nested_namespaces();
test_frames_string_data_validity();
Expand All @@ -275,8 +281,8 @@ int main() {
test_comparisons_base(make_some_stacktrace1(), make_some_stacktrace2());

test_nested<260>(false);
BOOST_TEST(boost::stacktrace::stacktrace(0, 1).size() == 1);
BOOST_TEST(boost::stacktrace::stacktrace(1, 1).size() == 1);

test_stacktrace_limits();

return boost::report_errors();
}

0 comments on commit 4352901

Please sign in to comment.