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:
Antony Polukhin
2016-12-01 09:55:17 +03:00
parent fd513391ca
commit 4ce841ef65
10 changed files with 176 additions and 191 deletions

View File

@@ -182,17 +182,25 @@ void test_frame() {
BOOST_TEST(st[i] >= st[i]);
frame fv = nst[2];
BOOST_TEST(fv);
if (i >= 2 && i < min_size - 3) { // Begin and end of the trace may match, skipping them
BOOST_TEST(st[i].name() != fv.name());
BOOST_TEST(st[i] != fv);
BOOST_TEST(st[i] < fv || st[i] > fv);
BOOST_TEST(hash_value(st[i]) != hash_value(fv));
BOOST_TEST(st[i].source_line() == 0 || st[i].source_file() != fv.source_file());
BOOST_TEST(st[i]);
}
fv = st[i];
BOOST_TEST(hash_value(st[i]) == hash_value(fv));
}
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() {