diff --git a/_clang-format b/_clang-format index b1522cf4..b8a4f24c 100644 --- a/_clang-format +++ b/_clang-format @@ -35,4 +35,4 @@ BraceWrapping: PointerAlignment: Left # Boost specific stuff -ForEachMacros: [ BOOST_FOREACH ] +ForEachMacros: [ BOOST_FOREACH, UNORDERED_AUTO_TEST ] diff --git a/test/exception/constructor_exception_tests.cpp b/test/exception/constructor_exception_tests.cpp index 9c755848..d480accd 100644 --- a/test/exception/constructor_exception_tests.cpp +++ b/test/exception/constructor_exception_tests.cpp @@ -199,11 +199,14 @@ template struct copy_range_construct_test : public range, objects } }; +// clang-format off EXCEPTION_TESTS( - (construct_test1)(construct_test2)(construct_test3)(construct_test4)( - construct_test5)(construct_test6)(range_construct_test1)( - range_construct_test2)(range_construct_test3)(range_construct_test4)( - range_construct_test5)(input_range_construct_test)( - copy_range_construct_test), + (construct_test1)(construct_test2)(construct_test3)(construct_test4) + (construct_test5)(construct_test6)(range_construct_test1) + (range_construct_test2)(range_construct_test3)(range_construct_test4) + (range_construct_test5)(input_range_construct_test) + (copy_range_construct_test), CONTAINER_SEQ) +// clang-format on + RUN_TESTS() diff --git a/test/exception/move_assign_exception_tests.cpp b/test/exception/move_assign_exception_tests.cpp index 576d3233..b81bfe36 100644 --- a/test/exception/move_assign_exception_tests.cpp +++ b/test/exception/move_assign_exception_tests.cpp @@ -121,8 +121,12 @@ template struct equivalent_test1 : move_assign_base } }; +// clang-format off EXCEPTION_TESTS( - (move_assign_test1)(move_assign_test2)(move_assign_test3)(move_assign_test4)( - move_assign_test4a)(move_assign_test5)(equivalent_test1), + (move_assign_test1)(move_assign_test2)(move_assign_test3) + (move_assign_test4)(move_assign_test4a)(move_assign_test5) + (equivalent_test1), CONTAINER_SEQ) +// clang-format on + RUN_TESTS() diff --git a/test/exception/rehash_exception_tests.cpp b/test/exception/rehash_exception_tests.cpp index 88f17932..a927d136 100644 --- a/test/exception/rehash_exception_tests.cpp +++ b/test/exception/rehash_exception_tests.cpp @@ -123,7 +123,11 @@ template struct rehash_test5 : rehash_test_base } }; -EXCEPTION_TESTS((rehash_test0)(rehash_test1)(rehash_test2)(rehash_test3)( - rehash_test4)(rehash_test5), +// clang-format off +EXCEPTION_TESTS( + (rehash_test0)(rehash_test1)(rehash_test2)(rehash_test3)(rehash_test4) + (rehash_test5), CONTAINER_SEQ) +// clang-format on + RUN_TESTS() diff --git a/test/exception/swap_exception_tests.cpp b/test/exception/swap_exception_tests.cpp index f722b1af..242410d7 100644 --- a/test/exception/swap_exception_tests.cpp +++ b/test/exception/swap_exception_tests.cpp @@ -135,7 +135,11 @@ template struct swap_test4 : swap_base swap_test4() : swap_base(10, 10, 1, 2) {} }; -EXCEPTION_TESTS((self_swap_test1)(self_swap_test2)(swap_test1)(swap_test2)( - swap_test3)(swap_test4), +// clang-format off +EXCEPTION_TESTS( + (self_swap_test1)(self_swap_test2) + (swap_test1)(swap_test2)(swap_test3)(swap_test4), CONTAINER_SEQ) +// clang-format on + RUN_TESTS() diff --git a/test/helpers/exception_test.hpp b/test/helpers/exception_test.hpp index a7ded572..d5272691 100644 --- a/test/helpers/exception_test.hpp +++ b/test/helpers/exception_test.hpp @@ -14,16 +14,14 @@ #include #define UNORDERED_EXCEPTION_TEST_CASE(name, test_func, type) \ - UNORDERED_AUTO_TEST(name) \ - { \ + UNORDERED_AUTO_TEST (name) { \ test_func fixture; \ ::test::lightweight::exception_safety( \ fixture, BOOST_STRINGIZE(test_func)); \ } #define UNORDERED_EXCEPTION_TEST_CASE_REPEAT(name, test_func, n, type) \ - UNORDERED_AUTO_TEST(name) \ - { \ + UNORDERED_AUTO_TEST (name) { \ for (unsigned i = 0; i < n; ++i) { \ test_func fixture; \ ::test::lightweight::exception_safety( \ diff --git a/test/helpers/test.hpp b/test/helpers/test.hpp index 5bce54fe..1acd6d77 100644 --- a/test/helpers/test.hpp +++ b/test/helpers/test.hpp @@ -163,9 +163,8 @@ namespace test { BOOST_PP_SEQ_TAIL(BOOST_PP_SEQ_TAIL(product))) #define UNORDERED_TEST_OP2(name, n, params) \ - UNORDERED_AUTO_TEST( \ - BOOST_PP_SEQ_FOLD_LEFT(UNORDERED_TEST_OP_JOIN, name, params)) \ - { \ + UNORDERED_AUTO_TEST ( \ + BOOST_PP_SEQ_FOLD_LEFT(UNORDERED_TEST_OP_JOIN, name, params)) { \ for (int i = 0; i < n; ++i) \ name BOOST_PP_SEQ_TO_TUPLE(params); \ } @@ -177,8 +176,7 @@ namespace test { UNORDERED_MULTI_TEST_REPEAT(name, impl, 1, parameters) #define UNORDERED_MULTI_TEST_REPEAT(name, impl, n, parameters) \ - UNORDERED_AUTO_TEST(name) \ - { \ + UNORDERED_AUTO_TEST (name) { \ BOOST_PP_SEQ_FOR_EACH_PRODUCT( \ UNORDERED_MULTI_TEST_OP, ((impl))((n))parameters) \ } diff --git a/test/unordered/assign_tests.cpp b/test/unordered/assign_tests.cpp index 2c4677b8..e3c2b9b3 100644 --- a/test/unordered/assign_tests.cpp +++ b/test/unordered/assign_tests.cpp @@ -242,8 +242,7 @@ namespace assign_tests { return T::allocator_type::is_propagate_on_assign; } - UNORDERED_AUTO_TEST(check_traits) - { + UNORDERED_AUTO_TEST (check_traits) { BOOST_TEST(!is_propagate(test_set)); BOOST_TEST(is_propagate(test_set_prop_assign)); BOOST_TEST(!is_propagate(test_set_no_prop_assign)); @@ -267,8 +266,7 @@ namespace assign_tests { #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - UNORDERED_AUTO_TEST(assign_default_initializer_list) - { + UNORDERED_AUTO_TEST (assign_default_initializer_list) { BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Initializer List Tests\n"; std::initializer_list > init; boost::unordered_map x1; @@ -282,8 +280,7 @@ namespace assign_tests { #endif #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - UNORDERED_AUTO_TEST(assign_initializer_list) - { + UNORDERED_AUTO_TEST (assign_initializer_list) { BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Initializer List Tests\n"; boost::unordered_set x; diff --git a/test/unordered/at_tests.cpp b/test/unordered/at_tests.cpp index 4f2af3ce..4d91975c 100644 --- a/test/unordered/at_tests.cpp +++ b/test/unordered/at_tests.cpp @@ -14,8 +14,7 @@ namespace at_tests { - UNORDERED_AUTO_TEST(at_tests) - { + UNORDERED_AUTO_TEST (at_tests) { BOOST_LIGHTWEIGHT_TEST_OSTREAM << "Create Map" << std::endl; boost::unordered_map x; diff --git a/test/unordered/compile_map.cpp b/test/unordered/compile_map.cpp index 530ee59f..6a84d595 100644 --- a/test/unordered/compile_map.cpp +++ b/test/unordered/compile_map.cpp @@ -36,8 +36,7 @@ INSTANTIATE(multimap), test::minimal::allocator >; -UNORDERED_AUTO_TEST(test0) -{ +UNORDERED_AUTO_TEST (test0) { test::minimal::constructor_param x; typedef std::pair @@ -81,8 +80,7 @@ UNORDERED_AUTO_TEST(test0) container_test(multimap, value); } -UNORDERED_AUTO_TEST(equality_tests) -{ +UNORDERED_AUTO_TEST (equality_tests) { typedef std::pair value_type; @@ -125,8 +123,7 @@ UNORDERED_AUTO_TEST(equality_tests) equality_test(multimap); } -UNORDERED_AUTO_TEST(test1) -{ +UNORDERED_AUTO_TEST (test1) { boost::hash hash; std::equal_to equal_to; int value = 0; @@ -167,8 +164,7 @@ UNORDERED_AUTO_TEST(test1) unordered_copyable_test(multimap2, value, map_value, hash, equal_to); } -UNORDERED_AUTO_TEST(test2) -{ +UNORDERED_AUTO_TEST (test2) { test::minimal::constructor_param x; test::minimal::assignable assignable(x); @@ -235,8 +231,7 @@ std::size_t hash_value(lwg2059_key x) bool operator==(lwg2059_key x, lwg2059_key y) { return x.value == y.value; } -UNORDERED_AUTO_TEST(lwg2059) -{ +UNORDERED_AUTO_TEST (lwg2059) { { boost::unordered_map x; x.emplace(lwg2059_key(10), 5); diff --git a/test/unordered/compile_set.cpp b/test/unordered/compile_set.cpp index 156b3cb5..727294f3 100644 --- a/test/unordered/compile_set.cpp +++ b/test/unordered/compile_set.cpp @@ -35,8 +35,7 @@ INSTANTIATE(multiset), test::minimal::allocator >; -UNORDERED_AUTO_TEST(test0) -{ +UNORDERED_AUTO_TEST (test0) { test::minimal::constructor_param x; test::minimal::assignable assignable(x); @@ -78,8 +77,7 @@ UNORDERED_AUTO_TEST(test0) container_test(multiset, assignable); } -UNORDERED_AUTO_TEST(equality_tests) -{ +UNORDERED_AUTO_TEST (equality_tests) { typedef test::minimal::copy_constructible_equality_comparable value_type; boost::unordered_set int_set; @@ -118,8 +116,7 @@ UNORDERED_AUTO_TEST(equality_tests) equality_test(multiset); } -UNORDERED_AUTO_TEST(test1) -{ +UNORDERED_AUTO_TEST (test1) { boost::hash hash; std::equal_to equal_to; int value = 0; @@ -157,8 +154,7 @@ UNORDERED_AUTO_TEST(test1) unordered_copyable_test(multiset2, value, value, hash, equal_to); } -UNORDERED_AUTO_TEST(test2) -{ +UNORDERED_AUTO_TEST (test2) { test::minimal::constructor_param x; test::minimal::assignable assignable(x); @@ -193,8 +189,7 @@ UNORDERED_AUTO_TEST(test2) unordered_set_member_test(multiset, assignable); } -UNORDERED_AUTO_TEST(movable1_tests) -{ +UNORDERED_AUTO_TEST (movable1_tests) { test::minimal::constructor_param x; test::minimal::movable1 movable1(x); @@ -226,8 +221,7 @@ UNORDERED_AUTO_TEST(movable1_tests) unordered_movable_test(multiset, movable1, movable1, hash, equal_to); } -UNORDERED_AUTO_TEST(movable2_tests) -{ +UNORDERED_AUTO_TEST (movable2_tests) { test::minimal::constructor_param x; test::minimal::movable2 movable2(x); @@ -259,8 +253,7 @@ UNORDERED_AUTO_TEST(movable2_tests) unordered_movable_test(multiset, movable2, movable2, hash, equal_to); } -UNORDERED_AUTO_TEST(destructible_tests) -{ +UNORDERED_AUTO_TEST (destructible_tests) { test::minimal::constructor_param x; test::minimal::destructible destructible(x); @@ -303,8 +296,7 @@ std::size_t hash_value(lwg2059_key x) bool operator==(lwg2059_key x, lwg2059_key y) { return x.value == y.value; } -UNORDERED_AUTO_TEST(lwg2059) -{ +UNORDERED_AUTO_TEST (lwg2059) { { boost::unordered_set x; x.emplace(lwg2059_key(10)); diff --git a/test/unordered/constructor_tests.cpp b/test/unordered/constructor_tests.cpp index 7d03c7ea..8e615f90 100644 --- a/test/unordered/constructor_tests.cpp +++ b/test/unordered/constructor_tests.cpp @@ -427,8 +427,7 @@ namespace constructor_tests { #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - UNORDERED_AUTO_TEST(test_default_initializer_list) - { + UNORDERED_AUTO_TEST (test_default_initializer_list) { std::initializer_list init; boost::unordered_set x1 = init; BOOST_TEST(x1.empty()); @@ -438,8 +437,7 @@ namespace constructor_tests { #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - UNORDERED_AUTO_TEST(test_initializer_list) - { + UNORDERED_AUTO_TEST (test_initializer_list) { boost::unordered_set x1 = {2, 10, 45, -5}; BOOST_TEST(x1.find(10) != x1.end()); BOOST_TEST(x1.find(46) == x1.end()); diff --git a/test/unordered/detail_tests.cpp b/test/unordered/detail_tests.cpp index 06341ce2..545c8381 100644 --- a/test/unordered/detail_tests.cpp +++ b/test/unordered/detail_tests.cpp @@ -51,8 +51,7 @@ void test_prev_prime(std::size_t value) } } -UNORDERED_AUTO_TEST(next_prime_test) -{ +UNORDERED_AUTO_TEST (next_prime_test) { BOOST_TEST(!is_prime(0)); BOOST_TEST(!is_prime(1)); BOOST_TEST(is_prime(2)); diff --git a/test/unordered/emplace_tests.cpp b/test/unordered/emplace_tests.cpp index 50191f3c..b424d3d7 100644 --- a/test/unordered/emplace_tests.cpp +++ b/test/unordered/emplace_tests.cpp @@ -167,8 +167,7 @@ namespace emplace_tests { emplace_value(emplace_value const&); }; - UNORDERED_AUTO_TEST(emplace_set) - { + UNORDERED_AUTO_TEST (emplace_set) { test::check_instances check_; typedef boost::unordered_set > @@ -249,8 +248,7 @@ namespace emplace_tests { BOOST_TEST(x.count(v4) == 1); } - UNORDERED_AUTO_TEST(emplace_multiset) - { + UNORDERED_AUTO_TEST (emplace_multiset) { test::check_instances check_; typedef boost::unordered_multiset container; diff --git a/test/unordered/equality_tests.cpp b/test/unordered/equality_tests.cpp index a80eac0b..3ff61a1b 100644 --- a/test/unordered/equality_tests.cpp +++ b/test/unordered/equality_tests.cpp @@ -31,43 +31,42 @@ namespace equality_tests { }; #define UNORDERED_EQUALITY_SET_TEST(seq1, op, seq2) \ - { \ + do { \ boost::unordered_set set1, set2; \ BOOST_PP_SEQ_FOR_EACH(UNORDERED_SET_INSERT, set1, seq1) \ BOOST_PP_SEQ_FOR_EACH(UNORDERED_SET_INSERT, set2, seq2) \ BOOST_TEST(set1 op set2); \ - } + } while (0) #define UNORDERED_EQUALITY_MULTISET_TEST(seq1, op, seq2) \ - { \ + do { \ boost::unordered_multiset set1, set2; \ BOOST_PP_SEQ_FOR_EACH(UNORDERED_SET_INSERT, set1, seq1) \ BOOST_PP_SEQ_FOR_EACH(UNORDERED_SET_INSERT, set2, seq2) \ BOOST_TEST(set1 op set2); \ - } + } while (0) #define UNORDERED_EQUALITY_MAP_TEST(seq1, op, seq2) \ - { \ + do { \ boost::unordered_map map1, map2; \ BOOST_PP_SEQ_FOR_EACH(UNORDERED_MAP_INSERT, map1, seq1) \ BOOST_PP_SEQ_FOR_EACH(UNORDERED_MAP_INSERT, map2, seq2) \ BOOST_TEST(map1 op map2); \ - } + } while (0) #define UNORDERED_EQUALITY_MULTIMAP_TEST(seq1, op, seq2) \ - { \ + do { \ boost::unordered_multimap map1, map2; \ BOOST_PP_SEQ_FOR_EACH(UNORDERED_MAP_INSERT, map1, seq1) \ BOOST_PP_SEQ_FOR_EACH(UNORDERED_MAP_INSERT, map2, seq2) \ BOOST_TEST(map1 op map2); \ - } + } while (0) #define UNORDERED_SET_INSERT(r, set, item) set.insert(item); #define UNORDERED_MAP_INSERT(r, map, item) \ map.insert(std::pair BOOST_PP_SEQ_TO_TUPLE(item)); - UNORDERED_AUTO_TEST(equality_size_tests) - { + UNORDERED_AUTO_TEST (equality_size_tests) { boost::unordered_set x1, x2; BOOST_TEST(x1 == x2); BOOST_TEST(!(x1 != x2)); @@ -89,38 +88,44 @@ namespace equality_tests { BOOST_TEST(!(x2 == x1)); } - UNORDERED_AUTO_TEST(equality_key_value_tests){ - UNORDERED_EQUALITY_MULTISET_TEST((1), !=, (2)) - UNORDERED_EQUALITY_SET_TEST((2), ==, (2)) - UNORDERED_EQUALITY_MAP_TEST(((1)(1))((2)(1)), !=, ((1)(1))((3)(1)))} + UNORDERED_AUTO_TEST (equality_key_value_tests) { + UNORDERED_EQUALITY_MULTISET_TEST((1), !=, (2)); + UNORDERED_EQUALITY_SET_TEST((2), ==, (2)); + UNORDERED_EQUALITY_MAP_TEST(((1)(1))((2)(1)), !=, ((1)(1))((3)(1))); + } - UNORDERED_AUTO_TEST(equality_collision_test){UNORDERED_EQUALITY_MULTISET_TEST( - (1), !=, (501)) UNORDERED_EQUALITY_MULTISET_TEST((1)(251), !=, - (1)(501)) UNORDERED_EQUALITY_MULTIMAP_TEST(((251)(1))((1)(1)), !=, - ((501)(1))((1)(1))) UNORDERED_EQUALITY_MULTISET_TEST((1)(501), ==, (1)(501)) - UNORDERED_EQUALITY_SET_TEST((1)(501), ==, (501)(1))} + UNORDERED_AUTO_TEST (equality_collision_test) { + UNORDERED_EQUALITY_MULTISET_TEST((1), !=, (501)); + UNORDERED_EQUALITY_MULTISET_TEST((1)(251), !=, (1)(501)); + UNORDERED_EQUALITY_MULTIMAP_TEST( + ((251)(1))((1)(1)), !=, ((501)(1))((1)(1))); + UNORDERED_EQUALITY_MULTISET_TEST((1)(501), ==, (1)(501)); + UNORDERED_EQUALITY_SET_TEST((1)(501), ==, (501)(1)); + } - UNORDERED_AUTO_TEST(equality_group_size_test){ - UNORDERED_EQUALITY_MULTISET_TEST((10)(20)(20), !=, (10)(10)(20)) - UNORDERED_EQUALITY_MULTIMAP_TEST( - ((10)(1))((20)(1))((20)(1)), !=, ((10)(1))((20)(1))((10)(1))) - UNORDERED_EQUALITY_MULTIMAP_TEST( - ((20)(1))((10)(1))((10)(1)), ==, ((10)(1))((20)(1))((10)(1)))} + UNORDERED_AUTO_TEST (equality_group_size_test) { + UNORDERED_EQUALITY_MULTISET_TEST((10)(20)(20), !=, (10)(10)(20)); + UNORDERED_EQUALITY_MULTIMAP_TEST( + ((10)(1))((20)(1))((20)(1)), !=, ((10)(1))((20)(1))((10)(1))); + UNORDERED_EQUALITY_MULTIMAP_TEST( + ((20)(1))((10)(1))((10)(1)), ==, ((10)(1))((20)(1))((10)(1))); + } - UNORDERED_AUTO_TEST(equality_map_value_test){UNORDERED_EQUALITY_MAP_TEST( - ((1)(1)), !=, ((1)(2))) UNORDERED_EQUALITY_MAP_TEST(((1)(1)), ==, - ((1)(1))) UNORDERED_EQUALITY_MULTIMAP_TEST(((1)(1)), !=, ((1)(2))) - UNORDERED_EQUALITY_MULTIMAP_TEST(((1)(1))((1)(1)), !=, ((1)(1))((1)(2))) - UNORDERED_EQUALITY_MULTIMAP_TEST(((1)(2))((1)(1)), ==, ((1)(1))((1)(2))) - UNORDERED_EQUALITY_MULTIMAP_TEST( - ((1)(2))((1)(1)), !=, ((1)(1))((1)(3)))} + UNORDERED_AUTO_TEST (equality_map_value_test) { + UNORDERED_EQUALITY_MAP_TEST(((1)(1)), !=, ((1)(2))); + UNORDERED_EQUALITY_MAP_TEST(((1)(1)), ==, ((1)(1))); + UNORDERED_EQUALITY_MULTIMAP_TEST(((1)(1)), !=, ((1)(2))); + UNORDERED_EQUALITY_MULTIMAP_TEST(((1)(1))((1)(1)), !=, ((1)(1))((1)(2))); + UNORDERED_EQUALITY_MULTIMAP_TEST(((1)(2))((1)(1)), ==, ((1)(1))((1)(2))); + UNORDERED_EQUALITY_MULTIMAP_TEST(((1)(2))((1)(1)), !=, ((1)(1))((1)(3))); + } - UNORDERED_AUTO_TEST(equality_predicate_test){ - UNORDERED_EQUALITY_SET_TEST((1), !=, (1001)) - UNORDERED_EQUALITY_MAP_TEST(((1)(2))((1001)(1)), !=, ((1001)(2))((1)(1)))} + UNORDERED_AUTO_TEST (equality_predicate_test) { + UNORDERED_EQUALITY_SET_TEST((1), !=, (1001)); + UNORDERED_EQUALITY_MAP_TEST(((1)(2))((1001)(1)), !=, ((1001)(2))((1)(1))); + } - UNORDERED_AUTO_TEST(equality_multiple_group_test) - { + UNORDERED_AUTO_TEST (equality_multiple_group_test) { UNORDERED_EQUALITY_MULTISET_TEST( (1)(1)(1)(1001)(2001)(2001)(2)(1002)(3)(1003)(2003), ==, (3)(1003)(2003)(1002)(2)(2001)(2001)(1)(1001)(1)(1)); @@ -129,8 +134,7 @@ namespace equality_tests { // Test that equality still works when the two containers have // different hash functions but the same equality predicate. - UNORDERED_AUTO_TEST(equality_different_hash_test) - { + UNORDERED_AUTO_TEST (equality_different_hash_test) { typedef boost::unordered_set set; set set1(0, mod_compare(false), mod_compare(false)); set set2(0, mod_compare(true), mod_compare(true)); diff --git a/test/unordered/equivalent_keys_tests.cpp b/test/unordered/equivalent_keys_tests.cpp index 22edf3be..f040819d 100644 --- a/test/unordered/equivalent_keys_tests.cpp +++ b/test/unordered/equivalent_keys_tests.cpp @@ -35,8 +35,7 @@ void test_equal_insertion(Iterator begin, Iterator end) test::check_equivalent_keys(x1); } -UNORDERED_AUTO_TEST(set_tests) -{ +UNORDERED_AUTO_TEST (set_tests) { int values[][5] = {{1}, {54, 23}, {-13, 65}, {77, 77}, {986, 25, 986}}; typedef boost::unordered_set set; @@ -55,8 +54,7 @@ UNORDERED_AUTO_TEST(set_tests) test_equal_insertion(values[4], values[4] + 3); } -UNORDERED_AUTO_TEST(map_tests) -{ +UNORDERED_AUTO_TEST (map_tests) { typedef test::list > values_type; values_type v[5]; v[0].push_back(std::pair(1, 1)); diff --git a/test/unordered/erase_equiv_tests.cpp b/test/unordered/erase_equiv_tests.cpp index 95185ed4..effe0cd5 100644 --- a/test/unordered/erase_equiv_tests.cpp +++ b/test/unordered/erase_equiv_tests.cpp @@ -73,8 +73,7 @@ typedef boost::unordered_multimap, typedef collide_map::value_type collide_value; typedef test::list collide_list; -UNORDERED_AUTO_TEST(empty_range_tests) -{ +UNORDERED_AUTO_TEST (empty_range_tests) { collide_map x; x.erase(x.begin(), x.end()); x.erase(x.begin(), x.begin()); @@ -82,8 +81,7 @@ UNORDERED_AUTO_TEST(empty_range_tests) test::check_equivalent_keys(x); } -UNORDERED_AUTO_TEST(single_item_tests) -{ +UNORDERED_AUTO_TEST (single_item_tests) { collide_list init; init.push_back(collide_value(1, 1)); @@ -99,8 +97,7 @@ UNORDERED_AUTO_TEST(single_item_tests) test::check_equivalent_keys(x); } -UNORDERED_AUTO_TEST(two_equivalent_item_tests) -{ +UNORDERED_AUTO_TEST (two_equivalent_item_tests) { collide_list init; init.push_back(collide_value(1, 1)); init.push_back(collide_value(1, 2)); @@ -198,23 +195,20 @@ void exhaustive_erase_tests(Container* x, int num_values, int num_duplicated) } } -UNORDERED_AUTO_TEST(exhaustive_collide_tests) -{ +UNORDERED_AUTO_TEST (exhaustive_collide_tests) { BOOST_LIGHTWEIGHT_TEST_OSTREAM << "exhaustive_collide_tests:\n"; collide_map m; exhaustive_erase_tests((collide_map*)0, 4, 4); BOOST_LIGHTWEIGHT_TEST_OSTREAM << "\n"; } -UNORDERED_AUTO_TEST(exhaustive_collide2_tests) -{ +UNORDERED_AUTO_TEST (exhaustive_collide2_tests) { BOOST_LIGHTWEIGHT_TEST_OSTREAM << "exhaustive_collide2_tests:\n"; exhaustive_erase_tests((collide_map2*)0, 8, 4); BOOST_LIGHTWEIGHT_TEST_OSTREAM << "\n"; } -UNORDERED_AUTO_TEST(exhaustive_collide3_tests) -{ +UNORDERED_AUTO_TEST (exhaustive_collide3_tests) { BOOST_LIGHTWEIGHT_TEST_OSTREAM << "exhaustive_collide3_tests:\n"; exhaustive_erase_tests((collide_map3*)0, 8, 4); BOOST_LIGHTWEIGHT_TEST_OSTREAM << "\n"; diff --git a/test/unordered/fwd_map_test.cpp b/test/unordered/fwd_map_test.cpp index ee3028d9..0c7df04f 100644 --- a/test/unordered/fwd_map_test.cpp +++ b/test/unordered/fwd_map_test.cpp @@ -55,8 +55,7 @@ bool call_not_equals( typedef boost::unordered_map int_map; typedef boost::unordered_multimap int_multimap; -UNORDERED_AUTO_TEST(use_map_fwd_declared_function) -{ +UNORDERED_AUTO_TEST (use_map_fwd_declared_function) { int_map x, y; x[1] = 2; y[2] = 1; @@ -72,8 +71,7 @@ UNORDERED_AUTO_TEST(use_map_fwd_declared_function) BOOST_TEST(call_not_equals(x, y)); } -UNORDERED_AUTO_TEST(use_multimap_fwd_declared_function) -{ +UNORDERED_AUTO_TEST (use_multimap_fwd_declared_function) { int_multimap x, y; call_swap(x, y); BOOST_TEST(call_equals(x, y)); diff --git a/test/unordered/fwd_set_test.cpp b/test/unordered/fwd_set_test.cpp index 0cc687c4..6512522a 100644 --- a/test/unordered/fwd_set_test.cpp +++ b/test/unordered/fwd_set_test.cpp @@ -67,23 +67,20 @@ bool call_not_equals( typedef boost::unordered_set int_set; typedef boost::unordered_multiset int_multiset; -UNORDERED_AUTO_TEST(use_fwd_declared_trait_without_definition) -{ +UNORDERED_AUTO_TEST (use_fwd_declared_trait_without_definition) { BOOST_TEST(sizeof(is_unordered_set_impl((int_set*)0)) == sizeof(true_type)); } #include -UNORDERED_AUTO_TEST(use_fwd_declared_trait) -{ +UNORDERED_AUTO_TEST (use_fwd_declared_trait) { boost::unordered_set x; BOOST_TEST(sizeof(is_unordered_set_impl(&x)) == sizeof(true_type)); BOOST_TEST(sizeof(is_unordered_set_impl((int*)0)) == sizeof(false_type)); } -UNORDERED_AUTO_TEST(use_set_fwd_declared_function) -{ +UNORDERED_AUTO_TEST (use_set_fwd_declared_function) { int_set x, y; x.insert(1); y.insert(2); @@ -99,8 +96,7 @@ UNORDERED_AUTO_TEST(use_set_fwd_declared_function) BOOST_TEST(call_not_equals(x, y)); } -UNORDERED_AUTO_TEST(use_multiset_fwd_declared_function) -{ +UNORDERED_AUTO_TEST (use_multiset_fwd_declared_function) { int_multiset x, y; call_swap(x, y); BOOST_TEST(call_equals(x, y)); diff --git a/test/unordered/insert_hint_tests.cpp b/test/unordered/insert_hint_tests.cpp index 658e129c..c77fc2dc 100644 --- a/test/unordered/insert_hint_tests.cpp +++ b/test/unordered/insert_hint_tests.cpp @@ -17,8 +17,7 @@ #include namespace insert_hint { - UNORDERED_AUTO_TEST(insert_hint_empty) - { + UNORDERED_AUTO_TEST (insert_hint_empty) { typedef boost::unordered_multiset container; container x; x.insert(x.cbegin(), 10); @@ -27,8 +26,7 @@ namespace insert_hint { test::check_equivalent_keys(x); } - UNORDERED_AUTO_TEST(insert_hint_empty2) - { + UNORDERED_AUTO_TEST (insert_hint_empty2) { typedef boost::unordered_multimap container; container x; x.emplace_hint(x.cbegin(), "hello", 50); @@ -38,8 +36,7 @@ namespace insert_hint { test::check_equivalent_keys(x); } - UNORDERED_AUTO_TEST(insert_hint_single) - { + UNORDERED_AUTO_TEST (insert_hint_single) { typedef boost::unordered_multiset container; container x; x.insert("equal"); @@ -49,8 +46,7 @@ namespace insert_hint { test::check_equivalent_keys(x); } - UNORDERED_AUTO_TEST(insert_hint_single2) - { + UNORDERED_AUTO_TEST (insert_hint_single2) { typedef boost::unordered_multimap container; container x; x.emplace(10, "one"); @@ -69,8 +65,7 @@ namespace insert_hint { test::check_equivalent_keys(x); } - UNORDERED_AUTO_TEST(insert_hint_multiple) - { + UNORDERED_AUTO_TEST (insert_hint_multiple) { for (unsigned int size = 0; size < 10; ++size) { for (unsigned int offset = 0; offset <= size; ++offset) { typedef boost::unordered_multiset container; @@ -96,8 +91,7 @@ namespace insert_hint { } } - UNORDERED_AUTO_TEST(insert_hint_unique) - { + UNORDERED_AUTO_TEST (insert_hint_unique) { typedef boost::unordered_set container; container x; x.insert(x.cbegin(), 10); @@ -106,8 +100,7 @@ namespace insert_hint { test::check_equivalent_keys(x); } - UNORDERED_AUTO_TEST(insert_hint_unique_single) - { + UNORDERED_AUTO_TEST (insert_hint_unique_single) { typedef boost::unordered_set container; container x; x.insert(10); diff --git a/test/unordered/insert_tests.cpp b/test/unordered/insert_tests.cpp index f1cd020c..db3bae82 100644 --- a/test/unordered/insert_tests.cpp +++ b/test/unordered/insert_tests.cpp @@ -976,8 +976,7 @@ namespace insert_tests { } }; - UNORDERED_AUTO_TEST(insert_initializer_list_set) - { + UNORDERED_AUTO_TEST (insert_initializer_list_set) { boost::unordered_set set; set.insert({1, 2, 3, 1}); BOOST_TEST_EQ(set.size(), 3u); @@ -1015,8 +1014,7 @@ namespace insert_tests { #if !BOOST_WORKAROUND(BOOST_MSVC, == 1800) - UNORDERED_AUTO_TEST(insert_initializer_list_multiset) - { + UNORDERED_AUTO_TEST (insert_initializer_list_multiset) { boost::unordered_multiset multiset; // multiset.insert({}); BOOST_TEST(multiset.empty()); @@ -1033,8 +1031,7 @@ namespace insert_tests { #endif - UNORDERED_AUTO_TEST(insert_initializer_list_map) - { + UNORDERED_AUTO_TEST (insert_initializer_list_map) { boost::unordered_map map; // map.insert({}); BOOST_TEST(map.empty()); @@ -1042,8 +1039,7 @@ namespace insert_tests { BOOST_TEST_EQ(map.size(), 2u); } - UNORDERED_AUTO_TEST(insert_initializer_list_multimap) - { + UNORDERED_AUTO_TEST (insert_initializer_list_multimap) { boost::unordered_multimap multimap; // multimap.insert({}); BOOST_TEST(multimap.empty()); @@ -1079,8 +1075,7 @@ namespace insert_tests { } }; - UNORDERED_AUTO_TEST(map_emplace_test) - { + UNORDERED_AUTO_TEST (map_emplace_test) { { boost::unordered_map x; overloaded_constructor check; @@ -1169,8 +1163,7 @@ namespace insert_tests { } }; - UNORDERED_AUTO_TEST(map_emplace_test2) - { + UNORDERED_AUTO_TEST (map_emplace_test2) { // Emulating piecewise construction with boost::tuple bypasses the // allocator's construct method, but still uses test destroy method. test::detail::disable_construction_tracking _scoped; @@ -1276,8 +1269,7 @@ namespace insert_tests { } } - UNORDERED_AUTO_TEST(set_emplace_test2) - { + UNORDERED_AUTO_TEST (set_emplace_test2) { boost::unordered_set< std::pair > x; @@ -1340,8 +1332,7 @@ RUN_TESTS_QUIET() #else // PIECEWISE_TEST_NAME -UNORDERED_AUTO_TEST(PIECEWISE_TEST_NAME) -{ +UNORDERED_AUTO_TEST (PIECEWISE_TEST_NAME) { #if EMULATING_PIECEWISE_CONSTRUCTION test::detail::disable_construction_tracking _scoped; #endif @@ -1431,8 +1422,7 @@ UNORDERED_AUTO_TEST(PIECEWISE_TEST_NAME) } } -UNORDERED_AUTO_TEST(BOOST_PP_CAT(PIECEWISE_TEST_NAME, 2)) -{ +UNORDERED_AUTO_TEST (BOOST_PP_CAT(PIECEWISE_TEST_NAME, 2)) { #if EMULATING_PIECEWISE_CONSTRUCTION test::detail::disable_construction_tracking _scoped; #endif diff --git a/test/unordered/merge_tests.cpp b/test/unordered/merge_tests.cpp index 0ddfe53e..3c27b745 100644 --- a/test/unordered/merge_tests.cpp +++ b/test/unordered/merge_tests.cpp @@ -19,8 +19,7 @@ namespace merge_tests { - UNORDERED_AUTO_TEST(merge_set) - { + UNORDERED_AUTO_TEST (merge_set) { boost::unordered_set x; boost::unordered_set y; @@ -59,8 +58,7 @@ namespace merge_tests { test::check_equivalent_keys(y); } - UNORDERED_AUTO_TEST(merge_multiset) - { + UNORDERED_AUTO_TEST (merge_multiset) { boost::unordered_multiset x; boost::unordered_multiset y; @@ -99,8 +97,7 @@ namespace merge_tests { test::check_equivalent_keys(y); } - UNORDERED_AUTO_TEST(merge_set_and_multiset) - { + UNORDERED_AUTO_TEST (merge_set_and_multiset) { boost::unordered_set x; boost::unordered_multiset y; diff --git a/test/unordered/node_handle_tests.cpp b/test/unordered/node_handle_tests.cpp index 91cd49d9..a8e2fa28 100644 --- a/test/unordered/node_handle_tests.cpp +++ b/test/unordered/node_handle_tests.cpp @@ -16,8 +16,7 @@ #include #include -UNORDERED_AUTO_TEST(example1) -{ +UNORDERED_AUTO_TEST (example1) { typedef boost::unordered_map::insert_return_type insert_return_type; @@ -42,8 +41,7 @@ UNORDERED_AUTO_TEST(example1) BOOST_TEST(r.node.mapped() == "buckle my shoe"); } -UNORDERED_AUTO_TEST(example2) -{ +UNORDERED_AUTO_TEST (example2) { boost::unordered_set src; src.insert(1); src.insert(3); @@ -58,8 +56,7 @@ UNORDERED_AUTO_TEST(example2) // dst == {1, 2, 3, 4, 5} } -UNORDERED_AUTO_TEST(example3) -{ +UNORDERED_AUTO_TEST (example3) { typedef boost::unordered_set::iterator iterator; boost::unordered_set src; @@ -90,8 +87,7 @@ UNORDERED_AUTO_TEST(example3) BOOST_TEST(it == dst2.end()); } -UNORDERED_AUTO_TEST(failed_insertion_with_hint) -{ +UNORDERED_AUTO_TEST (failed_insertion_with_hint) { { boost::unordered_set src; boost::unordered_set dst; @@ -234,8 +230,7 @@ template void node_handle_tests_impl(Container& c) BOOST_TEST(!n4); } -UNORDERED_AUTO_TEST(node_handle_tests) -{ +UNORDERED_AUTO_TEST (node_handle_tests) { boost::unordered_set x1; x1.emplace(100); x1.emplace(140); @@ -363,8 +358,7 @@ struct hash_thing } }; -UNORDERED_AUTO_TEST(insert_node_handle_unique_tests) -{ +UNORDERED_AUTO_TEST (insert_node_handle_unique_tests) { { boost::unordered_set x1; boost::unordered_set x2; @@ -389,8 +383,7 @@ UNORDERED_AUTO_TEST(insert_node_handle_unique_tests) } } -UNORDERED_AUTO_TEST(insert_node_handle_equiv_tests) -{ +UNORDERED_AUTO_TEST (insert_node_handle_equiv_tests) { { boost::unordered_multimap x1; boost::unordered_multimap x2; @@ -405,8 +398,7 @@ UNORDERED_AUTO_TEST(insert_node_handle_equiv_tests) } } -UNORDERED_AUTO_TEST(insert_node_handle_unique_tests2) -{ +UNORDERED_AUTO_TEST (insert_node_handle_unique_tests2) { { boost::unordered_set x1; boost::unordered_set x2; diff --git a/test/unordered/noexcept_tests.cpp b/test/unordered/noexcept_tests.cpp index 3a82facd..98dfa2b2 100644 --- a/test/unordered/noexcept_tests.cpp +++ b/test/unordered/noexcept_tests.cpp @@ -100,8 +100,7 @@ namespace noexcept_tests { bool have_is_nothrow_move = false; - UNORDERED_AUTO_TEST(check_is_nothrow_move) - { + UNORDERED_AUTO_TEST (check_is_nothrow_move) { BOOST_TEST( !boost::is_nothrow_move_constructible::value); have_is_nothrow_move = @@ -119,8 +118,7 @@ namespace noexcept_tests { #endif } - UNORDERED_AUTO_TEST(test_noexcept) - { + UNORDERED_AUTO_TEST (test_noexcept) { if (have_is_nothrow_move) { BOOST_TEST((boost::is_nothrow_move_constructible< boost::unordered_set >::value)); @@ -139,8 +137,7 @@ namespace noexcept_tests { boost::hash, equal_to_possible_exception> >::value)); } - UNORDERED_AUTO_TEST(test_no_throw_when_noexcept) - { + UNORDERED_AUTO_TEST (test_no_throw_when_noexcept) { typedef boost::unordered_set throwing_set; diff --git a/test/unordered/simple_tests.cpp b/test/unordered/simple_tests.cpp index ca99a86f..9fa21e17 100644 --- a/test/unordered/simple_tests.cpp +++ b/test/unordered/simple_tests.cpp @@ -88,8 +88,7 @@ template void simple_test(X const& a) } } -UNORDERED_AUTO_TEST(simple_tests) -{ +UNORDERED_AUTO_TEST (simple_tests) { using namespace std; srand(14878); diff --git a/test/unordered/swap_tests.cpp b/test/unordered/swap_tests.cpp index 6eb9af89..52d2c875 100644 --- a/test/unordered/swap_tests.cpp +++ b/test/unordered/swap_tests.cpp @@ -187,8 +187,7 @@ namespace swap_tests { using test::generate_collisions; using test::limited_range; - UNORDERED_AUTO_TEST(check_traits) - { + UNORDERED_AUTO_TEST (check_traits) { BOOST_TEST(!is_propagate(test_set)); BOOST_TEST(is_propagate(test_set_prop_swap)); BOOST_TEST(!is_propagate(test_set_no_prop_swap)); diff --git a/test/unordered/unnecessary_copy_tests.cpp b/test/unordered/unnecessary_copy_tests.cpp index 27d71762..929d55fe 100644 --- a/test/unordered/unnecessary_copy_tests.cpp +++ b/test/unordered/unnecessary_copy_tests.cpp @@ -341,8 +341,7 @@ namespace unnecessary_copy_tests { UNORDERED_TEST( unnecessary_copy_emplace_boost_move_map_test, ((map)(multimap))) - UNORDERED_AUTO_TEST(unnecessary_copy_emplace_set_test) - { + UNORDERED_AUTO_TEST (unnecessary_copy_emplace_set_test) { // When calling 'source' the object is moved on some compilers, but not // others. So count that here to adjust later. @@ -425,8 +424,7 @@ namespace unnecessary_copy_tests { MOVE_COUNT(0); } - UNORDERED_AUTO_TEST(unnecessary_copy_emplace_map_test) - { + UNORDERED_AUTO_TEST (unnecessary_copy_emplace_map_test) { // When calling 'source' the object is moved on some compilers, but not // others. So count that here to adjust later.