mirror of
https://github.com/boostorg/stacktrace.git
synced 2026-02-02 09:12:09 +00:00
Code deduplicated and simplified, added empty() functions and some explicit bool operators, speed-up and improved the output of the ostream operators, improved tests coverage
This commit is contained in:
@@ -21,12 +21,20 @@ void test_deeply_nested_namespaces() {
|
||||
void test_nested() {
|
||||
std::pair<stacktrace, stacktrace> res = foo2(15);
|
||||
|
||||
BOOST_TEST(!res.first);
|
||||
BOOST_TEST(res.first.size() == 0);
|
||||
BOOST_TEST(res.first.begin()->name() == "");
|
||||
BOOST_TEST(res.first.begin()->source_file() == "");
|
||||
BOOST_TEST(res.first.begin()->source_line() == 0);
|
||||
BOOST_TEST(!res.second);
|
||||
BOOST_TEST(res.second.size() == 0);
|
||||
BOOST_TEST(res.second.begin()->name() == "");
|
||||
BOOST_TEST(res.second.begin()->source_file() == "");
|
||||
BOOST_TEST(res.second.begin()->source_line() == 0);
|
||||
|
||||
BOOST_TEST(res.second[0].name() == "");
|
||||
BOOST_TEST(res.second[0].source_file() == "");
|
||||
BOOST_TEST(res.second[0].source_line() == 0);
|
||||
BOOST_TEST(res.second[0].address() == 0);
|
||||
|
||||
BOOST_TEST(res.second <= res.first);
|
||||
@@ -36,10 +44,18 @@ void test_nested() {
|
||||
BOOST_TEST(!(res.second > res.first));
|
||||
}
|
||||
|
||||
void test_empty_frame() {
|
||||
boost::stacktrace::frame empty_frame;
|
||||
BOOST_TEST(!empty_frame);
|
||||
BOOST_TEST(empty_frame.source_file() == "");
|
||||
BOOST_TEST(empty_frame.name() == "");
|
||||
BOOST_TEST(empty_frame.source_line() == 0);
|
||||
}
|
||||
|
||||
int main() {
|
||||
test_deeply_nested_namespaces();
|
||||
test_nested();
|
||||
test_empty_frame();
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user