diff --git a/test/main.h b/test/main.h index 3f68c73eb..7fe147235 100644 --- a/test/main.h +++ b/test/main.h @@ -73,31 +73,47 @@ static std::vector ei_assert_list; } - #define assert(a) if (!(a)) { throw Eigen::ei_assert_exception();} \ - else if (Eigen::ei_push_assert) {ei_assert_list.push_back( std::string(EI_PP_MAKE_STRING(__FILE__)" ("EI_PP_MAKE_STRING(__LINE__)") : "#a) );} + #define assert(a) \ + if( (!(a)) && (!no_more_assert) ) \ + { \ + Eigen::no_more_assert = true; \ + throw Eigen::ei_assert_exception(); \ + } \ + else if (Eigen::ei_push_assert) \ + { \ + ei_assert_list.push_back(std::string(EI_PP_MAKE_STRING(__FILE__)" ("EI_PP_MAKE_STRING(__LINE__)") : "#a) ); \ + } - #define VERIFY_RAISES_ASSERT(a) {\ - try { \ - Eigen::ei_assert_list.clear(); \ - Eigen::ei_push_assert = true; \ - a; \ - Eigen::ei_push_assert = false; \ - std::cout << "One of the following asserts should have been raised:\n"; \ - for (uint ai=0 ; ai