Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71363 - in trunk: boost/unordered/detail libs/unordered/test/unordered
From: dnljms_at_[hidden]
Date: 2011-04-17 17:27:38


Author: danieljames
Date: 2011-04-17 17:27:38 EDT (Sun, 17 Apr 2011)
New Revision: 71363
URL: http://svn.boost.org/trac/boost/changeset/71363

Log:
Unordered: Fix some errors in the equality tests.
Text files modified:
   trunk/boost/unordered/detail/equivalent.hpp | 6 +++---
   trunk/libs/unordered/test/unordered/compile_map.cpp | 15 ++++++++-------
   trunk/libs/unordered/test/unordered/compile_set.cpp | 14 +++++++-------
   3 files changed, 18 insertions(+), 17 deletions(-)

Modified: trunk/boost/unordered/detail/equivalent.hpp
==============================================================================
--- trunk/boost/unordered/detail/equivalent.hpp (original)
+++ trunk/boost/unordered/detail/equivalent.hpp 2011-04-17 17:27:38 EDT (Sun, 17 Apr 2011)
@@ -98,8 +98,8 @@
             {
                 value_type const& v = node::get_value(n1);
                 if (find(start, n1, v)) continue;
- std::size_t matches = count(n2, end2, v);
- if (!matches or matches != 1 + count(n1->next_, end1, v))
+ std::size_t matches = count_equal(n2, end2, v);
+ if (!matches or matches != 1 + count_equal(n1->next_, end1, v))
                     return false;
             }
             
@@ -114,7 +114,7 @@
             return false;
         }
         
- static std::size_t count(node_ptr n, node_ptr end, value_type const& v)
+ static std::size_t count_equal(node_ptr n, node_ptr end, value_type const& v)
         {
             std::size_t count = 0;
             for(;n != end; n = n->next_)

Modified: trunk/libs/unordered/test/unordered/compile_map.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/compile_map.cpp (original)
+++ trunk/libs/unordered/test/unordered/compile_map.cpp 2011-04-17 17:27:38 EDT (Sun, 17 Apr 2011)
@@ -68,16 +68,17 @@
 }
 
 UNORDERED_AUTO_TEST(equality_tests) {
- typedef std::pair<test::minimal::assignable const,
+ typedef std::pair<
+ test::minimal::copy_constructible_equality_comparable const,
             test::minimal::copy_constructible> value_type;
 
     boost::unordered_map<int, int> int_map;
 
     boost::unordered_map<
- test::minimal::assignable,
         test::minimal::copy_constructible_equality_comparable,
- test::minimal::hash<test::minimal::assignable>,
- test::minimal::equal_to<test::minimal::assignable>,
+ test::minimal::copy_constructible_equality_comparable,
+ test::minimal::hash<test::minimal::copy_constructible_equality_comparable>,
+ test::minimal::equal_to<test::minimal::copy_constructible_equality_comparable>,
         test::minimal::allocator<value_type> > map;
 
     equality_test(int_map);
@@ -86,10 +87,10 @@
     boost::unordered_multimap<int, int> int_multimap;
 
     boost::unordered_multimap<
- test::minimal::assignable,
         test::minimal::copy_constructible_equality_comparable,
- test::minimal::hash<test::minimal::assignable>,
- test::minimal::equal_to<test::minimal::assignable>,
+ test::minimal::copy_constructible_equality_comparable,
+ test::minimal::hash<test::minimal::copy_constructible_equality_comparable>,
+ test::minimal::equal_to<test::minimal::copy_constructible_equality_comparable>,
         test::minimal::allocator<value_type> > multimap;
 
     equality_test(int_multimap);

Modified: trunk/libs/unordered/test/unordered/compile_set.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/compile_set.cpp (original)
+++ trunk/libs/unordered/test/unordered/compile_set.cpp 2011-04-17 17:27:38 EDT (Sun, 17 Apr 2011)
@@ -56,14 +56,14 @@
 }
 
 UNORDERED_AUTO_TEST(equality_tests) {
- typedef test::minimal::assignable value_type;
+ typedef test::minimal::copy_constructible_equality_comparable value_type;
 
     boost::unordered_set<int> int_set;
 
     boost::unordered_set<
- test::minimal::assignable,
- test::minimal::hash<test::minimal::assignable>,
- test::minimal::equal_to<test::minimal::assignable>,
+ test::minimal::copy_constructible_equality_comparable,
+ test::minimal::hash<test::minimal::copy_constructible_equality_comparable>,
+ test::minimal::equal_to<test::minimal::copy_constructible_equality_comparable>,
         test::minimal::allocator<value_type> > set;
 
     equality_test(int_set);
@@ -72,9 +72,9 @@
     boost::unordered_multiset<int> int_multiset;
 
     boost::unordered_multiset<
- test::minimal::assignable,
- test::minimal::hash<test::minimal::assignable>,
- test::minimal::equal_to<test::minimal::assignable>,
+ test::minimal::copy_constructible_equality_comparable,
+ test::minimal::hash<test::minimal::copy_constructible_equality_comparable>,
+ test::minimal::equal_to<test::minimal::copy_constructible_equality_comparable>,
         test::minimal::allocator<value_type> > multiset;
 
     equality_test(int_multiset);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk