| 19 | |
| 20 | |
| 21 | void main_test_loop() { |
| 22 | std::size_t loops = 100; |
| 23 | int Depth = 25; |
| 24 | |
| 25 | boost::optional<std::pair<stacktrace, stacktrace> > ethalon; |
| 26 | std::stringstream ss_ethalon; |
| 27 | |
| 28 | while (--loops) { |
| 29 | std::pair<stacktrace, stacktrace> res = function_from_library(Depth, function_from_main_translation_unit); |
| 30 | if (ethalon) { |
| 31 | BOOST_TEST(res == *ethalon); |
| 32 | |
| 33 | std::stringstream ss; |
| 34 | ss << res.first; |
| 35 | BOOST_TEST(ss.str() == ss_ethalon.str()); |
| 36 | } else { |
| 37 | ethalon = res; |
| 38 | ss_ethalon << ethalon->first; |
| 39 | } |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | int main() { |
| 44 | const auto t = std::chrono::steady_clock::now(); |