forked from boostorg/unordered
After 5 failures stop running an exception test
This commit is contained in:
@ -241,8 +241,10 @@ template <class Test> void exception_safety(Test const& f, char const* /*name*/)
|
|||||||
|
|
||||||
iteration = 0;
|
iteration = 0;
|
||||||
bool success = false;
|
bool success = false;
|
||||||
|
unsigned int failure_count = 0;
|
||||||
char const* error_msg = 0;
|
char const* error_msg = 0;
|
||||||
do {
|
do {
|
||||||
|
int error_count = boost::detail::test_errors();
|
||||||
++iteration;
|
++iteration;
|
||||||
count = 0;
|
count = 0;
|
||||||
|
|
||||||
@ -253,12 +255,15 @@ template <class Test> void exception_safety(Test const& f, char const* /*name*/)
|
|||||||
error_msg = "test_failure caught.";
|
error_msg = "test_failure caught.";
|
||||||
break;
|
break;
|
||||||
} catch (test_exception) {
|
} catch (test_exception) {
|
||||||
continue;
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
error_msg = "Unexpected exception.";
|
error_msg = "Unexpected exception.";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (!success);
|
|
||||||
|
if (error_count != boost::detail::test_errors()) {
|
||||||
|
++failure_count;
|
||||||
|
}
|
||||||
|
} while (!success && failure_count < 5);
|
||||||
|
|
||||||
if (error_msg) {
|
if (error_msg) {
|
||||||
BOOST_ERROR(error_msg);
|
BOOST_ERROR(error_msg);
|
||||||
|
Reference in New Issue
Block a user