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/doc/buckets.qbk b/doc/buckets.qbk index 6baa64e7..54d2bc94 100644 --- a/doc/buckets.qbk +++ b/doc/buckets.qbk @@ -160,12 +160,9 @@ the expensive rehashing out of the way and let you store iterators, safe in the knowledge that they won't be invalidated. If you are inserting `n` elements into container `x`, you could first call: - x.rehash((x.size() + n) / x.max_load_factor() + 1); + x.rehash((x.size() + n) / x.max_load_factor()); [blurb Note: `rehash`'s argument is the minimum number of buckets, not the -number of elements, which is why the new size is divided by the maximum load factor. The -`+ 1` guarantees there is no invalidation; without it, reallocation could occur -if the number of bucket exactly divides the target size, since the container is -allowed to rehash when the load factor is equal to the maximum load factor.] +number of elements, which is why the new size is divided by the maximum load factor.] [endsect] diff --git a/include/boost/unordered/detail/fwd.hpp b/include/boost/unordered/detail/fwd.hpp index 7f25cfc1..75030a9a 100644 --- a/include/boost/unordered/detail/fwd.hpp +++ b/include/boost/unordered/detail/fwd.hpp @@ -32,8 +32,7 @@ #endif #endif -// TODO: Use piecewise construction by default? Is it safe to assume that an -// unknown library has it? +// Assume that an unknown library does not support piecewise construction. #if !defined(BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT) #define BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT 0 #endif diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index e4c00849..d25026fe 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -356,13 +356,12 @@ namespace boost { } template - inline std::size_t initial_size( - I i, I j, std::size_t num_buckets = - boost::unordered::detail::default_bucket_count) + inline std::size_t initial_size(I i, I j, + std::size_t num_buckets = + boost::unordered::detail::default_bucket_count) { - // TODO: Why +1? return (std::max)( - boost::unordered::detail::insert_size(i, j) + 1, num_buckets); + boost::unordered::detail::insert_size(i, j), num_buckets); } ////////////////////////////////////////////////////////////////////////// @@ -384,6 +383,7 @@ namespace boost { T& get() { return value_; } T const& get() const { return value_; } + private: T value_; }; @@ -1027,17 +1027,17 @@ namespace boost { #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) template - BOOST_UNORDERED_HAS_FUNCTION( - construct, U, (boost::unordered::detail::make(), - boost::unordered::detail::make()...), + BOOST_UNORDERED_HAS_FUNCTION(construct, U, + (boost::unordered::detail::make(), + boost::unordered::detail::make()...), 2); #else template - BOOST_UNORDERED_HAS_FUNCTION( - construct, U, (boost::unordered::detail::make(), - boost::unordered::detail::make()), + BOOST_UNORDERED_HAS_FUNCTION(construct, U, + (boost::unordered::detail::make(), + boost::unordered::detail::make()), 2); #endif @@ -2571,7 +2571,6 @@ namespace boost { typedef prime_policy type; }; -// TODO: Maybe not if std::size_t is smaller than long long. #if !defined(BOOST_NO_LONG_LONG) template <> struct pick_policy2 { @@ -2686,7 +2685,7 @@ namespace boost { { construct(current_, bf.current(), boost::unordered::detail::integral_constant()); + nothrow_move_constructible>()); } ~functions() { this->destroy(current_); } @@ -3169,9 +3168,10 @@ namespace boost { // I think swap can throw if Propagate::value, // since the allocators' swap can throw. Not sure though. - swap_allocators(x, boost::unordered::detail::integral_constant:: - propagate_on_container_swap::value>()); + swap_allocators( + x, boost::unordered::detail::integral_constant::propagate_on_container_swap::value>()); boost::swap(buckets_, x.buckets_); boost::swap(bucket_count_, x.bucket_count_); @@ -3197,6 +3197,31 @@ namespace boost { other.max_load_ = 0; } + // For use in the constructor when allocators might be different. + void move_construct_buckets(table& src) + { + if (this->node_alloc() == src.node_alloc()) { + move_buckets_from(src); + } else { + this->create_buckets(this->bucket_count_); + link_pointer prev = this->get_previous_start(); + std::size_t last_bucket = this->bucket_count_; + for (node_pointer n = src.begin(); n; n = next_node(n)) { + std::size_t bucket = n->get_bucket(); + if (bucket != last_bucket) { + this->get_bucket(bucket)->next_ = prev; + } + node_pointer n2 = boost::unordered::detail::func::construct_node( + this->node_alloc(), boost::move(n->value())); + n2->bucket_info_ = n->bucket_info_; + prev->next_ = n2; + ++size_; + prev = n2; + last_bucket = bucket; + } + } + } + //////////////////////////////////////////////////////////////////////// // Delete/destruct @@ -3294,8 +3319,8 @@ namespace boost { if (this != &x) { assign(x, is_unique, boost::unordered::detail::integral_constant:: - propagate_on_container_copy_assignment::value>()); + allocator_traits:: + propagate_on_container_copy_assignment::value>()); } } @@ -3307,7 +3332,7 @@ namespace boost { mlf_ = x.mlf_; recalculate_max_load(); - if (x.size_ >= max_load_) { + if (x.size_ > max_load_) { create_buckets(min_buckets_for_size(x.size_)); } else if (size_) { clear_buckets(); @@ -3350,8 +3375,8 @@ namespace boost { if (this != &x) { move_assign(x, is_unique, boost::unordered::detail::integral_constant:: - propagate_on_container_move_assignment::value>()); + allocator_traits:: + propagate_on_container_move_assignment::value>()); } } @@ -3382,7 +3407,7 @@ namespace boost { mlf_ = x.mlf_; recalculate_max_load(); - if (x.size_ >= max_load_) { + if (x.size_ > max_load_) { create_buckets(min_buckets_for_size(x.size_)); } else if (size_) { clear_buckets(); @@ -3524,9 +3549,8 @@ namespace boost { std::size_t bucket_index = this->hash_to_bucket(key_hash); bucket_pointer b = this->get_bucket(bucket_index); - // TODO: Do this need to set_first_in_group ? n->bucket_info_ = bucket_index; - // n->set_first_in_group(); + n->set_first_in_group(); if (!b->next_) { link_pointer start_node = this->get_previous_start(); @@ -3922,20 +3946,6 @@ namespace boost { } } - // TODO: Should be move_buckets_uniq - void move_buckets(table const& src) - { - this->create_buckets(this->bucket_count_); - - for (node_pointer n = src.begin(); n; n = next_node(n)) { - std::size_t key_hash = this->hash(this->get_key(n)); - this->add_node_unique( - boost::unordered::detail::func::construct_node( - this->node_alloc(), boost::move(n->value())), - key_hash); - } - } - void assign_buckets(table const& src, true_type) { node_holder holder(*this); @@ -4062,7 +4072,7 @@ namespace boost { } } } else { - // n->set_first_in_group(); + n->set_first_in_group(); bucket_pointer b = this->get_bucket(bucket_index); if (!b->next_) { @@ -4211,9 +4221,9 @@ namespace boost { } template - void insert_range_equiv( - I i, I j, typename boost::unordered::detail::disable_if_forward::type = 0) + void insert_range_equiv(I i, I j, + typename boost::unordered::detail::disable_if_forward::type = 0) { for (; i != j; ++i) { emplace_equiv(boost::unordered::detail::func::construct_node( @@ -4328,26 +4338,6 @@ namespace boost { } } - void move_buckets_equiv(table const& src) - { - this->create_buckets(this->bucket_count_); - - for (node_pointer n = src.begin(); n;) { - std::size_t key_hash = this->hash(this->get_key(n)); - node_pointer group_end(next_group(n)); - node_pointer pos = this->add_node_equiv( - boost::unordered::detail::func::construct_node( - this->node_alloc(), boost::move(n->value())), - key_hash, node_pointer()); - for (n = next_node(n); n != group_end; n = next_node(n)) { - this->add_node_equiv( - boost::unordered::detail::func::construct_node( - this->node_alloc(), boost::move(n->value())), - key_hash, pos); - } - } - } - void assign_buckets(table const& src, false_type) { node_holder holder(*this); @@ -4680,8 +4670,9 @@ namespace boost { template struct node : boost::unordered::detail::value_base { - typedef typename ::boost::unordered::detail::rebind_wrap >::type allocator; + typedef + typename ::boost::unordered::detail::rebind_wrap >::type + allocator; typedef typename ::boost::unordered::detail::allocator_traits< allocator>::pointer node_pointer; typedef node_pointer link_pointer; diff --git a/include/boost/unordered/detail/map.hpp b/include/boost/unordered/detail/map.hpp index 024b3611..8025de80 100644 --- a/include/boost/unordered/detail/map.hpp +++ b/include/boost/unordered/detail/map.hpp @@ -19,8 +19,9 @@ namespace boost { typedef P key_equal; typedef K const const_key_type; - typedef typename ::boost::unordered::detail::rebind_wrap::type value_allocator; + typedef + typename ::boost::unordered::detail::rebind_wrap::type + value_allocator; typedef boost::unordered::detail::allocator_traits value_allocator_traits; diff --git a/include/boost/unordered/detail/set.hpp b/include/boost/unordered/detail/set.hpp index af3dbd58..b7869e3c 100644 --- a/include/boost/unordered/detail/set.hpp +++ b/include/boost/unordered/detail/set.hpp @@ -18,8 +18,9 @@ namespace boost { typedef P key_equal; typedef T const const_key_type; - typedef typename ::boost::unordered::detail::rebind_wrap::type value_allocator; + typedef + typename ::boost::unordered::detail::rebind_wrap::type + value_allocator; typedef boost::unordered::detail::allocator_traits value_allocator_traits; diff --git a/include/boost/unordered/unordered_map.hpp b/include/boost/unordered/unordered_map.hpp index d994c02a..bae3aa2f 100644 --- a/include/boost/unordered/unordered_map.hpp +++ b/include/boost/unordered/unordered_map.hpp @@ -309,7 +309,7 @@ namespace boost { return table_.emplace_hint_unique(hint, table::extractor::extract(boost::forward(a0)), boost::unordered::detail::create_emplace_args( - boost::forward(a0))); + boost::forward(a0))); } template @@ -317,19 +317,19 @@ namespace boost { const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1) { return table_.emplace_hint_unique(hint, - table::extractor::extract(boost::forward(a0), - boost::forward(a1)), - boost::unordered::detail::create_emplace_args(boost::forward(a0), - boost::forward(a1))); + table::extractor::extract( + boost::forward(a0), boost::forward(a1)), + boost::unordered::detail::create_emplace_args( + boost::forward(a0), boost::forward(a1))); } template iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) { - return table_.emplace_hint_unique( - hint, table::extractor::extract( - boost::forward(a0), boost::forward(a1)), + return table_.emplace_hint_unique(hint, + table::extractor::extract( + boost::forward(a0), boost::forward(a1)), boost::unordered::detail::create_emplace_args(boost::forward(a0), boost::forward(a1), boost::forward(a2))); } @@ -354,9 +354,9 @@ namespace boost { iterator emplace_hint( \ const_iterator hint, BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \ { \ - return table_.emplace_hint_unique( \ - hint, table::extractor::extract( \ - boost::forward(a0), boost::forward(a1)), \ + return table_.emplace_hint_unique(hint, \ + table::extractor::extract( \ + boost::forward(a0), boost::forward(a1)), \ boost::unordered::detail::create_emplace_args( \ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \ } @@ -532,8 +532,7 @@ namespace boost { std::pair try_emplace(key_type const& k, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) { - return table_.try_emplace_unique( - k, + return table_.try_emplace_unique(k, boost::unordered::detail::create_emplace_args(boost::forward(a0), boost::forward(a1), boost::forward(a2))); } @@ -562,8 +561,7 @@ namespace boost { std::pair try_emplace(BOOST_RV_REF(key_type) k, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) { - return table_.try_emplace_unique( - boost::move(k), + return table_.try_emplace_unique(boost::move(k), boost::unordered::detail::create_emplace_args(boost::forward(a0), boost::forward(a1), boost::forward(a2))); } @@ -592,8 +590,7 @@ namespace boost { iterator try_emplace(const_iterator hint, key_type const& k, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) { - return table_.try_emplace_hint_unique( - hint, k, + return table_.try_emplace_hint_unique(hint, k, boost::unordered::detail::create_emplace_args(boost::forward(a0), boost::forward(a1), boost::forward(a2))); } @@ -614,16 +611,15 @@ namespace boost { BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1) { return table_.try_emplace_hint_unique(hint, boost::move(k), - boost::unordered::detail::create_emplace_args(boost::forward(a0), - boost::forward(a1))); + boost::unordered::detail::create_emplace_args( + boost::forward(a0), boost::forward(a1))); } template iterator try_emplace(const_iterator hint, BOOST_RV_REF(key_type) k, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) { - return table_.try_emplace_hint_unique( - hint, boost::move(k), + return table_.try_emplace_hint_unique(hint, boost::move(k), boost::unordered::detail::create_emplace_args(boost::forward(a0), boost::forward(a1), boost::forward(a2))); } @@ -644,8 +640,8 @@ namespace boost { BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \ { \ return table_.try_emplace_unique(boost::move(k), \ - boost::unordered::detail::create_emplace_args(BOOST_PP_ENUM_##z( \ - n, BOOST_UNORDERED_CALL_FORWARD, a))); \ + boost::unordered::detail::create_emplace_args( \ + BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \ } \ \ template \ @@ -662,8 +658,8 @@ namespace boost { BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \ { \ return table_.try_emplace_hint_unique(hint, boost::move(k), \ - boost::unordered::detail::create_emplace_args(BOOST_PP_ENUM_##z( \ - n, BOOST_UNORDERED_CALL_FORWARD, a))); \ + boost::unordered::detail::create_emplace_args( \ + BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \ } BOOST_UNORDERED_TRY_EMPLACE(1, 4, _) @@ -1105,8 +1101,7 @@ namespace boost { template iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0) { - return iterator(table_.emplace_hint_equiv( - hint, + return iterator(table_.emplace_hint_equiv(hint, boost::unordered::detail::func::construct_node_from_args( table_.node_alloc(), boost::unordered::detail::create_emplace_args( boost::forward(a0))))); @@ -1429,12 +1424,7 @@ namespace boost { BOOST_RV_REF(unordered_map) other, allocator_type const& a) : table_(other.table_, a, boost::unordered::detail::move_tag()) { - if (table_.node_alloc() == other.table_.node_alloc()) { - table_.move_buckets_from(other.table_); - } else if (other.table_.size_) { - // TODO: Could pick new bucket size? - table_.move_buckets(other.table_); - } + table_.move_construct_buckets(other.table_); } #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) @@ -1913,12 +1903,7 @@ namespace boost { BOOST_RV_REF(unordered_multimap) other, allocator_type const& a) : table_(other.table_, a, boost::unordered::detail::move_tag()) { - if (table_.node_alloc() == other.table_.node_alloc()) { - table_.move_buckets_from(other.table_); - } else if (other.table_.size_) { - // TODO: Could pick new bucket size? - table_.move_buckets_equiv(other.table_); - } + table_.move_construct_buckets(other.table_); } #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) diff --git a/include/boost/unordered/unordered_set.hpp b/include/boost/unordered/unordered_set.hpp index 4f829ced..e01c5586 100644 --- a/include/boost/unordered/unordered_set.hpp +++ b/include/boost/unordered/unordered_set.hpp @@ -307,7 +307,7 @@ namespace boost { return table_.emplace_hint_unique(hint, table::extractor::extract(boost::forward(a0)), boost::unordered::detail::create_emplace_args( - boost::forward(a0))); + boost::forward(a0))); } template @@ -315,19 +315,19 @@ namespace boost { const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1) { return table_.emplace_hint_unique(hint, - table::extractor::extract(boost::forward(a0), - boost::forward(a1)), - boost::unordered::detail::create_emplace_args(boost::forward(a0), - boost::forward(a1))); + table::extractor::extract( + boost::forward(a0), boost::forward(a1)), + boost::unordered::detail::create_emplace_args( + boost::forward(a0), boost::forward(a1))); } template iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) { - return table_.emplace_hint_unique( - hint, table::extractor::extract( - boost::forward(a0), boost::forward(a1)), + return table_.emplace_hint_unique(hint, + table::extractor::extract( + boost::forward(a0), boost::forward(a1)), boost::unordered::detail::create_emplace_args(boost::forward(a0), boost::forward(a1), boost::forward(a2))); } @@ -352,9 +352,9 @@ namespace boost { iterator emplace_hint( \ const_iterator hint, BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \ { \ - return table_.emplace_hint_unique( \ - hint, table::extractor::extract( \ - boost::forward(a0), boost::forward(a1)), \ + return table_.emplace_hint_unique(hint, \ + table::extractor::extract( \ + boost::forward(a0), boost::forward(a1)), \ boost::unordered::detail::create_emplace_args( \ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \ } @@ -813,8 +813,7 @@ namespace boost { template iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0) { - return iterator(table_.emplace_hint_equiv( - hint, + return iterator(table_.emplace_hint_equiv(hint, boost::unordered::detail::func::construct_node_from_args( table_.node_alloc(), boost::unordered::detail::create_emplace_args( boost::forward(a0))))); @@ -1109,12 +1108,7 @@ namespace boost { BOOST_RV_REF(unordered_set) other, allocator_type const& a) : table_(other.table_, a, boost::unordered::detail::move_tag()) { - if (table_.node_alloc() == other.table_.node_alloc()) { - table_.move_buckets_from(other.table_); - } else if (other.table_.size_) { - // TODO: Could pick new bucket size? - table_.move_buckets(other.table_); - } + table_.move_construct_buckets(other.table_); } #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) @@ -1511,12 +1505,7 @@ namespace boost { BOOST_RV_REF(unordered_multiset) other, allocator_type const& a) : table_(other.table_, a, boost::unordered::detail::move_tag()) { - if (table_.node_alloc() == other.table_.node_alloc()) { - table_.move_buckets_from(other.table_); - } else if (other.table_.size_) { - // TODO: Could pick new bucket size? - table_.move_buckets_equiv(other.table_); - } + table_.move_construct_buckets(other.table_); } #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) 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/invariants.hpp b/test/helpers/invariants.hpp index 8d47c1d0..92012c84 100644 --- a/test/helpers/invariants.hpp +++ b/test/helpers/invariants.hpp @@ -97,8 +97,9 @@ namespace test { // Check the load factor. - float load_factor = size == 0 ? 0 : static_cast(size) / - static_cast(x1.bucket_count()); + float load_factor = size == 0 ? 0 + : static_cast(size) / + static_cast(x1.bucket_count()); using namespace std; if (fabs(x1.load_factor() - load_factor) > x1.load_factor() / 64) BOOST_ERROR("x1.load_factor() doesn't match actual load_factor."); 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/objects/minimal.hpp b/test/objects/minimal.hpp index 867a263e..b89e0af8 100644 --- a/test/objects/minimal.hpp +++ b/test/objects/minimal.hpp @@ -56,6 +56,7 @@ namespace test { destructible(constructor_param const&) {} ~destructible() {} void dummy_member() const {} + private: destructible(destructible const&); destructible& operator=(destructible const&); @@ -68,6 +69,7 @@ namespace test { copy_constructible(copy_constructible const&) {} ~copy_constructible() {} void dummy_member() const {} + private: copy_constructible& operator=(copy_constructible const&); copy_constructible() {} @@ -86,6 +88,7 @@ namespace test { ~copy_constructible_equality_comparable() {} void dummy_member() const {} + private: copy_constructible_equality_comparable& operator=( copy_constructible_equality_comparable const&); @@ -141,6 +144,7 @@ namespace test { assignable& operator=(assignable const&) { return *this; } ~assignable() {} void dummy_member() const {} + private: assignable() {} #if BOOST_UNORDERED_CHECK_ADDR_OPERATOR_NOT_USED @@ -179,6 +183,7 @@ namespace test { ~movable2() {} movable2& operator=(movable2&&) { return *this; } void dummy_member() const {} + private: movable2() {} movable2(movable2 const&); @@ -285,6 +290,7 @@ namespace test { T* ptr_; ptr(T* x) : ptr_(x) {} + public: ptr() : ptr_(0) {} explicit ptr(void_ptr const& x) : ptr_((T*)x.ptr_) {} @@ -336,6 +342,7 @@ namespace test { T const* ptr_; const_ptr(T const* ptr) : ptr_(ptr) {} + public: const_ptr() : ptr_(0) {} const_ptr(ptr const& x) : ptr_(x.ptr_) {} diff --git a/test/objects/test.hpp b/test/objects/test.hpp index 8c87bc26..8ea6d2de 100644 --- a/test/objects/test.hpp +++ b/test/objects/test.hpp @@ -497,6 +497,7 @@ namespace test { T* ptr_; ptr(T* x) : ptr_(x) {} + public: ptr() : ptr_(0) {} explicit ptr(void_ptr const& x) : ptr_((T*)x.ptr_) {} @@ -539,6 +540,7 @@ namespace test { T const* ptr_; const_ptr(T const* ptr) : ptr_(ptr) {} + public: const_ptr() : ptr_(0) {} const_ptr(ptr const& x) : ptr_(x.ptr_) {} diff --git a/test/unordered/assign_tests.cpp b/test/unordered/assign_tests.cpp index d0d7a669..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)); @@ -255,7 +254,7 @@ namespace assign_tests { test_multimap_prop_assign)(test_set_no_prop_assign)( test_multiset_no_prop_assign)(test_map_no_prop_assign)( test_multimap_no_prop_assign))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST( assign_tests2, ((test_set)(test_multiset)(test_map)(test_multimap)( @@ -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 4f8f701d..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; @@ -97,7 +95,7 @@ UNORDERED_AUTO_TEST(equality_tests) test::minimal::copy_constructible_equality_comparable, test::minimal::hash, test::minimal::equal_to< - test::minimal::copy_constructible_equality_comparable>, + test::minimal::copy_constructible_equality_comparable>, test::minimal::allocator > map; @@ -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 0c6fa555..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; @@ -91,7 +89,7 @@ UNORDERED_AUTO_TEST(equality_tests) boost::unordered_set, test::minimal::equal_to< - test::minimal::copy_constructible_equality_comparable>, + test::minimal::copy_constructible_equality_comparable>, test::minimal::allocator > 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 0728a1e7..8e615f90 100644 --- a/test/unordered/constructor_tests.cpp +++ b/test/unordered/constructor_tests.cpp @@ -415,20 +415,19 @@ namespace constructor_tests { UNORDERED_TEST(constructor_tests1, ((test_map_std_alloc)(test_set)(test_multiset)(test_map)(test_multimap))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST(constructor_tests2, ((test_set)(test_multiset)(test_map)(test_multimap))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST(map_constructor_test, ((test_map_std_alloc)(test_map)(test_multimap))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) #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/copy_tests.cpp b/test/unordered/copy_tests.cpp index a2afd64b..17df86d8 100644 --- a/test/unordered/copy_tests.cpp +++ b/test/unordered/copy_tests.cpp @@ -195,7 +195,7 @@ namespace copy_tests { test_multimap_select_copy)(test_set_no_select_copy)( test_multiset_no_select_copy)(test_map_no_select_copy)( test_multimap_no_select_copy))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST(copy_construct_tests2, ((test_set)(test_multiset)(test_map)(test_multimap)(test_set_select_copy)( @@ -203,7 +203,7 @@ namespace copy_tests { test_multimap_select_copy)(test_set_no_select_copy)( test_multiset_no_select_copy)(test_map_no_select_copy)( test_multimap_no_select_copy))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) } RUN_TESTS() 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 2d14d337..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,49 +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_group_size_test) - { - UNORDERED_EQUALITY_MULTISET_TEST((10)(20)(20), !=, (10)(10)(20)) + UNORDERED_AUTO_TEST (equality_collision_test) { + UNORDERED_EQUALITY_MULTISET_TEST((1), !=, (501)); + UNORDERED_EQUALITY_MULTISET_TEST((1)(251), !=, (1)(501)); UNORDERED_EQUALITY_MULTIMAP_TEST( - ((10)(1))((20)(1))((20)(1)), !=, ((10)(1))((20)(1))((10)(1))) + ((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( - ((20)(1))((10)(1))((10)(1)), ==, ((10)(1))((20)(1))((10)(1))) + ((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)); @@ -140,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/find_tests.cpp b/test/unordered/find_tests.cpp index b9a38238..268d42bb 100644 --- a/test/unordered/find_tests.cpp +++ b/test/unordered/find_tests.cpp @@ -155,7 +155,7 @@ namespace find_tests { (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST(find_compatible_keys_test, ((test_set)(test_multiset)(test_map)(test_multimap))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) } RUN_TESTS() 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 1a37e357..db3bae82 100644 --- a/test/unordered/insert_tests.cpp +++ b/test/unordered/insert_tests.cpp @@ -917,11 +917,11 @@ namespace insert_tests { UNORDERED_TEST(unique_insert_tests1, ((test_set_std_alloc)(test_set)(test_map))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST(equivalent_insert_tests1, ((test_multimap_std_alloc)(test_multiset)(test_multimap))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST(insert_tests2, ((test_multimap_std_alloc)(test_set)(test_multiset)(test_map)( @@ -929,21 +929,21 @@ namespace insert_tests { UNORDERED_TEST(unique_emplace_tests1, ((test_set_std_alloc)(test_set)(test_map))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST(equivalent_emplace_tests1, ((test_multimap_std_alloc)(test_multiset)(test_multimap))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST(move_emplace_tests, ((test_set_std_alloc)(test_multimap_std_alloc)(test_set)(test_map)( test_multiset)(test_multimap))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST(default_emplace_tests, ((test_set_std_alloc)(test_multimap_std_alloc)(test_set)(test_map)( test_multiset)(test_multimap))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST(map_tests, ((test_map))((default_generator)(generate_collisions)(limited_range))) @@ -953,11 +953,11 @@ namespace insert_tests { UNORDERED_TEST(map_insert_range_test1, ((test_multimap_std_alloc)(test_map)(test_multimap))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST(map_insert_range_test2, ((test_multimap_std_alloc)(test_map)(test_multimap))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) @@ -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; @@ -1179,8 +1172,8 @@ namespace insert_tests { boost::unordered_map, std::equal_to, - test::allocator1 > > + test::allocator1< + std::pair > > x; x.emplace(boost::unordered::piecewise_construct, boost::make_tuple(), @@ -1246,8 +1239,8 @@ namespace insert_tests { boost::unordered_multimap, std::equal_to, - test::allocator1 > > + test::allocator1< + std::pair > > x; x.emplace(boost::unordered::piecewise_construct, boost::make_tuple(), @@ -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 @@ -1350,8 +1341,8 @@ UNORDERED_AUTO_TEST(PIECEWISE_TEST_NAME) boost::unordered_map, std::equal_to, - test::allocator1 > > + test::allocator1< + std::pair > > x; x.emplace(PIECEWISE_NAMESPACE::piecewise_construct, @@ -1400,8 +1391,8 @@ UNORDERED_AUTO_TEST(PIECEWISE_TEST_NAME) boost::unordered_multimap, std::equal_to, - test::allocator1 > > + test::allocator1< + std::pair > > x; x.emplace(PIECEWISE_NAMESPACE::piecewise_construct, @@ -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/load_factor_tests.cpp b/test/unordered/load_factor_tests.cpp index f59a4547..9c76a743 100644 --- a/test/unordered/load_factor_tests.cpp +++ b/test/unordered/load_factor_tests.cpp @@ -87,7 +87,7 @@ namespace load_factor_tests { UNORDERED_TEST(load_factor_insert_tests, ((int_set_ptr)(int_multiset_ptr)(int_map_ptr)(int_multimap_ptr))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) } RUN_TESTS() 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/move_tests.cpp b/test/unordered/move_tests.cpp index 13f19d74..5d0d37d8 100644 --- a/test/unordered/move_tests.cpp +++ b/test/unordered/move_tests.cpp @@ -347,26 +347,26 @@ namespace move_tests { test_multimap_prop_move)(test_set_no_prop_move)( test_multiset_no_prop_move)(test_map_no_prop_move)( test_multimap_no_prop_move))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST(move_assign_tests1, ((test_map_std_alloc)(test_set)(test_multiset)(test_map)(test_multimap)( test_set_prop_move)(test_multiset_prop_move)(test_map_prop_move)( test_multimap_prop_move)(test_set_no_prop_move)( test_multiset_no_prop_move)(test_map_no_prop_move)( test_multimap_no_prop_move))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST(move_construct_tests2, ((test_set)(test_multiset)(test_map)(test_multimap)(test_set_prop_move)( test_multiset_prop_move)(test_map_prop_move)(test_multimap_prop_move)( test_set_no_prop_move)(test_multiset_no_prop_move)(test_map_no_prop_move)( test_multimap_no_prop_move))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST(move_assign_tests2, ((test_set)(test_multiset)(test_map)(test_multimap)(test_set_prop_move)( test_multiset_prop_move)(test_map_prop_move)(test_multimap_prop_move)( test_set_no_prop_move)(test_multiset_no_prop_move)(test_map_no_prop_move)( test_multimap_no_prop_move))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) } RUN_TESTS() diff --git a/test/unordered/node_handle_tests.cpp b/test/unordered/node_handle_tests.cpp index 357801c9..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; @@ -156,8 +152,7 @@ bool node_handle_compare( } template -bool node_handle_compare( - NodeHandle const& nh, +bool node_handle_compare(NodeHandle const& nh, std::pair const& x) { @@ -235,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); @@ -364,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; @@ -390,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; @@ -406,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/rehash_tests.cpp b/test/unordered/rehash_tests.cpp index 21d94b3e..87a49593 100644 --- a/test/unordered/rehash_tests.cpp +++ b/test/unordered/rehash_tests.cpp @@ -208,23 +208,23 @@ namespace rehash_tests { ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))) UNORDERED_TEST(rehash_empty_test2, ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST(rehash_empty_test3, ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST(rehash_test1, ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST(reserve_empty_test1, ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))) UNORDERED_TEST(reserve_empty_test2, ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))) UNORDERED_TEST(reserve_test1, ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) UNORDERED_TEST(reserve_test2, ((int_set_ptr)(test_multiset_ptr)(test_map_ptr)(int_multimap_ptr))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) } RUN_TESTS() 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 ac033743..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)); @@ -207,6 +206,6 @@ namespace swap_tests { test_multiset_prop_swap)(test_map_prop_swap)(test_multimap_prop_swap)( test_set_no_prop_swap)(test_multiset_no_prop_swap)(test_map_no_prop_swap)( test_multimap_no_prop_swap))( - (default_generator)(generate_collisions)(limited_range))) + (default_generator)(generate_collisions)(limited_range))) } RUN_TESTS() 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.