diff --git a/test/exception/assign_exception_tests.cpp b/test/exception/assign_exception_tests.cpp index 515d8bb6..60d1e162 100644 --- a/test/exception/assign_exception_tests.cpp +++ b/test/exception/assign_exception_tests.cpp @@ -105,7 +105,8 @@ struct assign_test5 : assign_base assign_test5() : assign_base(5, 60, 0, 0, 1.0, 0.1) {} }; -RUN_EXCEPTION_TESTS( +EXCEPTION_TESTS( (self_assign_test1)(self_assign_test2) (assign_test1)(assign_test2)(assign_test3)(assign_test4)(assign_test5), CONTAINER_SEQ) +RUN_TESTS() \ No newline at end of file diff --git a/test/exception/constructor_exception_tests.cpp b/test/exception/constructor_exception_tests.cpp index 9657bae0..27ea4b84 100644 --- a/test/exception/constructor_exception_tests.cpp +++ b/test/exception/constructor_exception_tests.cpp @@ -159,7 +159,7 @@ struct copy_range_construct_test : public range, objects } }; -RUN_EXCEPTION_TESTS( +EXCEPTION_TESTS( (construct_test1) (construct_test2) (construct_test3) @@ -174,3 +174,4 @@ RUN_EXCEPTION_TESTS( (input_range_construct_test) (copy_range_construct_test), CONTAINER_SEQ) +RUN_TESTS() \ No newline at end of file diff --git a/test/exception/copy_exception_tests.cpp b/test/exception/copy_exception_tests.cpp index 57d17fac..723d0d4d 100644 --- a/test/exception/copy_exception_tests.cpp +++ b/test/exception/copy_exception_tests.cpp @@ -64,6 +64,7 @@ struct copy_with_allocator_test : public test::exception_base } }; -RUN_EXCEPTION_TESTS( +EXCEPTION_TESTS( (copy_test1)(copy_test2)(copy_test3)(copy_with_allocator_test), CONTAINER_SEQ) +RUN_TESTS() \ No newline at end of file diff --git a/test/exception/erase_exception_tests.cpp b/test/exception/erase_exception_tests.cpp index f761fcc3..745bf8a4 100644 --- a/test/exception/erase_exception_tests.cpp +++ b/test/exception/erase_exception_tests.cpp @@ -49,6 +49,7 @@ struct erase_by_key_test1 : public erase_test_base } }; -RUN_EXCEPTION_TESTS( +EXCEPTION_TESTS( (erase_by_key_test1), CONTAINER_SEQ) +RUN_TESTS() \ No newline at end of file diff --git a/test/exception/insert_exception_tests.cpp b/test/exception/insert_exception_tests.cpp index 464a0ff5..51f2b534 100644 --- a/test/exception/insert_exception_tests.cpp +++ b/test/exception/insert_exception_tests.cpp @@ -243,4 +243,5 @@ struct insert_test_rehash3 : public insert_test_base #endif -RUN_EXCEPTION_TESTS(ALL_TESTS, CONTAINER_SEQ) +EXCEPTION_TESTS(ALL_TESTS, CONTAINER_SEQ) +RUN_TESTS() \ No newline at end of file diff --git a/test/exception/rehash_exception_tests.cpp b/test/exception/rehash_exception_tests.cpp index 0426e589..1be79864 100644 --- a/test/exception/rehash_exception_tests.cpp +++ b/test/exception/rehash_exception_tests.cpp @@ -79,7 +79,7 @@ struct rehash_test4 : rehash_test_base void run(T& x) const { x.rehash(0); } }; -RUN_EXCEPTION_TESTS( +EXCEPTION_TESTS( (rehash_test0)(rehash_test1)(rehash_test2)(rehash_test3)(rehash_test4), CONTAINER_SEQ) - +RUN_TESTS() \ No newline at end of file diff --git a/test/exception/swap_exception_tests.cpp b/test/exception/swap_exception_tests.cpp index 39e59494..6e1331ea 100644 --- a/test/exception/swap_exception_tests.cpp +++ b/test/exception/swap_exception_tests.cpp @@ -118,7 +118,8 @@ struct swap_test4 : swap_base swap_test4() : swap_base(10, 10, 1, 2) {} }; -RUN_EXCEPTION_TESTS( +EXCEPTION_TESTS( (self_swap_test1)(self_swap_test2) (swap_test1)(swap_test2)(swap_test3)(swap_test4), CONTAINER_SEQ) +RUN_TESTS() \ No newline at end of file diff --git a/test/helpers/exception_test.hpp b/test/helpers/exception_test.hpp index 1e7ae248..289cd1a5 100644 --- a/test/helpers/exception_test.hpp +++ b/test/helpers/exception_test.hpp @@ -20,22 +20,37 @@ fixture, BOOST_STRINGIZE(test_func)); \ } \ +# define UNORDERED_EXCEPTION_TEST_CASE_REPEAT(name, test_func, n, type) \ + UNORDERED_AUTO_TEST(name) \ + { \ + for (unsigned i = 0; i < n; ++i) { \ + test_func< type > fixture; \ + ::test::lightweight::exception_safety( \ + fixture, BOOST_STRINGIZE(test_func)); \ + } \ + } \ + + # define UNORDERED_EPOINT_IMPL ::test::lightweight::epoint #define UNORDERED_EXCEPTION_TEST_POSTFIX RUN_TESTS() -#define RUN_EXCEPTION_TESTS(test_seq, param_seq) \ - BOOST_PP_SEQ_FOR_EACH_PRODUCT(RUN_EXCEPTION_TESTS_OP, \ - (test_seq)(param_seq)) \ - RUN_TESTS() \ +#define EXCEPTION_TESTS(test_seq, param_seq) \ + BOOST_PP_SEQ_FOR_EACH_PRODUCT(EXCEPTION_TESTS_OP, \ + (test_seq)((1))(param_seq)) -#define RUN_EXCEPTION_TESTS_OP(r, product) \ - UNORDERED_EXCEPTION_TEST_CASE( \ +#define EXCEPTION_TESTS_REPEAT(n, test_seq, param_seq) \ + BOOST_PP_SEQ_FOR_EACH_PRODUCT(EXCEPTION_TESTS_OP, \ + (test_seq)((n))(param_seq)) + +#define EXCEPTION_TESTS_OP(r, product) \ + UNORDERED_EXCEPTION_TEST_CASE_REPEAT( \ BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, product), \ - BOOST_PP_CAT(_, BOOST_PP_SEQ_ELEM(1, product)) \ + BOOST_PP_CAT(_, BOOST_PP_SEQ_ELEM(2, product)) \ ), \ BOOST_PP_SEQ_ELEM(0, product), \ - BOOST_PP_SEQ_ELEM(1, product) \ + BOOST_PP_SEQ_ELEM(1, product), \ + BOOST_PP_SEQ_ELEM(2, product) \ ) \ #define UNORDERED_SCOPE(scope_name) \