Skip to content

Commit 4352901

Browse files
committed
Move tests to their own function to ensure two stack frames
1 parent 2820ed3 commit 4352901

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/test.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,12 @@ void test_empty_basic_stacktrace() {
257257
BOOST_TEST(!(st > st_t(0, 0)));
258258
}
259259

260+
void test_stacktrace_limits()
261+
{
262+
BOOST_TEST_EQ(boost::stacktrace::stacktrace(0, 1).size(), 1);
263+
BOOST_TEST_EQ(boost::stacktrace::stacktrace(1, 1).size(), 1);
264+
}
265+
260266
int main() {
261267
test_deeply_nested_namespaces();
262268
test_frames_string_data_validity();
@@ -275,8 +281,8 @@ int main() {
275281
test_comparisons_base(make_some_stacktrace1(), make_some_stacktrace2());
276282

277283
test_nested<260>(false);
278-
BOOST_TEST(boost::stacktrace::stacktrace(0, 1).size() == 1);
279-
BOOST_TEST(boost::stacktrace::stacktrace(1, 1).size() == 1);
284+
285+
test_stacktrace_limits();
280286

281287
return boost::report_errors();
282288
}

0 commit comments

Comments
 (0)