diff --git a/include/boost/detail/lightweight_test.hpp b/include/boost/detail/lightweight_test.hpp index ffa750d..8add322 100644 --- a/include/boost/detail/lightweight_test.hpp +++ b/include/boost/detail/lightweight_test.hpp @@ -24,6 +24,7 @@ // #include +#include #include namespace boost @@ -32,9 +33,26 @@ namespace boost namespace detail { +struct report_errors_reminder +{ + bool called_report_errors_function; + report_errors_reminder() : called_report_errors_function(false) {} + ~report_errors_reminder() + { + BOOST_ASSERT(called_report_errors_function); // verify report_errors() was called + } +}; + +inline report_errors_reminder& report_errors_remind() +{ + static report_errors_reminder r; + return r; +} + inline int & test_errors() { static int x = 0; + report_errors_remind(); return x; } @@ -68,6 +86,8 @@ template inline void test_eq_impl( char const * expr1, char co inline int report_errors() { + detail::report_errors_remind().called_report_errors_function = true; + int errors = detail::test_errors(); if( errors == 0 )