Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2008-01-20 13:55:59


Author: danieljames
Date: 2008-01-20 13:55:57 EST (Sun, 20 Jan 2008)
New Revision: 42882
URL: http://svn.boost.org/trac/boost/changeset/42882

Log:
Merged revisions 42856-42881 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/trunk

........
  r42880 | danieljames | 2008-01-20 16:10:43 +0000 (Sun, 20 Jan 2008) | 17 lines
  
  Simplify the tests a little:
  
  Add a parameter to random_values to control what sort of values it generates.
  This means that instead of using equivalent_object to test collisions (which
  was a total hack) we now just need another parameter.
  
  This requires some meta programming to act differently for maps and sets.
  Because of this pairs no longer need to be generated so remove the code for
  doing that (which doesn't work on some compilers).
  
  Remove the generator object, just call generate directly.
  
  Remove some of the tests using int containers, they didn't really add to
  anthing other than the compile time (some tests are timing out).
........

Properties modified:
   trunk/ (props changed)
Text files modified:
   trunk/libs/unordered/test/helpers/fwd.hpp | 2
   trunk/libs/unordered/test/helpers/generators.hpp | 28 ---------
   trunk/libs/unordered/test/helpers/random_values.hpp | 92 ++++++++++++++++++++++++++++++-
   trunk/libs/unordered/test/objects/exception.hpp | 1
   trunk/libs/unordered/test/objects/test.hpp | 58 --------------------
   trunk/libs/unordered/test/unordered/assign_tests.cpp | 53 ++++++++++--------
   trunk/libs/unordered/test/unordered/bucket_tests.cpp | 5 -
   trunk/libs/unordered/test/unordered/constructor_tests.cpp | 114 +++++++++++++++++++--------------------
   trunk/libs/unordered/test/unordered/copy_tests.cpp | 37 +++++++-----
   trunk/libs/unordered/test/unordered/erase_tests.cpp | 62 ++++++++++-----------
   trunk/libs/unordered/test/unordered/find_tests.cpp | 36 ++++++------
   trunk/libs/unordered/test/unordered/insert_tests.cpp | 100 ++++++++++++++++------------------
   trunk/libs/unordered/test/unordered/swap_tests.cpp | 29 ++++-----
   13 files changed, 306 insertions(+), 311 deletions(-)

Modified: trunk/libs/unordered/test/helpers/fwd.hpp
==============================================================================
--- trunk/libs/unordered/test/helpers/fwd.hpp (original)
+++ trunk/libs/unordered/test/helpers/fwd.hpp 2008-01-20 13:55:57 EST (Sun, 20 Jan 2008)
@@ -15,8 +15,6 @@
     signed char generate(signed char const*);
     std::string generate(std::string*);
     float generate(float const*);
- template <class T1, class T2>
- std::pair<T1, T2> generate(std::pair<T1, T2>*);
 
     struct base_type {} base;
     struct derived_type : base_type {} derived;

Modified: trunk/libs/unordered/test/helpers/generators.hpp
==============================================================================
--- trunk/libs/unordered/test/helpers/generators.hpp (original)
+++ trunk/libs/unordered/test/helpers/generators.hpp 2008-01-20 13:55:57 EST (Sun, 20 Jan 2008)
@@ -16,7 +16,6 @@
 #include <stdexcept>
 #include <cstdlib>
 #include <boost/type_traits/add_const.hpp>
-
 #include "./fwd.hpp"
 
 namespace test
@@ -27,29 +26,6 @@
             srand(x);
         }
     };
-
- template <class T>
- struct generator;
-
- template <class T1, class T2> std::pair<T1, T2> generate(
- std::pair<T1, T2> const*)
- {
- static generator<T1> g1;
- static generator<T2> g2;
-
- return std::pair<T1, T2>(g1(), g2());
- }
-
- template <class T>
- struct generator
- {
- typedef T value_type;
- typedef BOOST_DEDUCED_TYPENAME boost::add_const<T>::type const_value_type;
- value_type operator()() const
- {
- return generate((const_value_type*) 0);
- }
- };
 
     inline int generate(int const*)
     {
@@ -73,13 +49,13 @@
     {
         using namespace std;
 
- static test::generator<char> char_gen;
+ char* char_ptr = 0;
 
         std::string result;
 
         int length = rand() % 10;
         for(int i = 0; i < length; ++i)
- result += char_gen();
+ result += generate(char_ptr);
 
         return result;
     }

Modified: trunk/libs/unordered/test/helpers/random_values.hpp
==============================================================================
--- trunk/libs/unordered/test/helpers/random_values.hpp (original)
+++ trunk/libs/unordered/test/helpers/random_values.hpp 2008-01-20 13:55:57 EST (Sun, 20 Jan 2008)
@@ -8,18 +8,102 @@
 
 #include <list>
 #include <algorithm>
+#include <boost/mpl/if.hpp>
 #include "./generators.hpp"
+#include "./metafunctions.hpp"
 
 namespace test
 {
+ typedef enum {
+ default_generator,
+ generate_collisions
+ } random_generator;
+
+ template <class X>
+ struct unordered_generator_set
+ {
+ typedef BOOST_DEDUCED_TYPENAME X::value_type value_type;
+
+ random_generator type_;
+
+ unordered_generator_set(random_generator type)
+ : type_(type) {}
+
+ template <class T>
+ void fill(T& x, std::size_t len) {
+ value_type* value_ptr = 0;
+ int* int_ptr = 0;
+
+ for(std::size_t i = 0; i < len; ++i) {
+ value_type value = generate(value_ptr);
+
+ for(int count =
+ type_ == generate_collisions ?
+ generate(int_ptr) % 10 : 1;
+ count; --count) {
+ x.push_back(value);
+ }
+ }
+ }
+ };
+
+ template <class X>
+ struct unordered_generator_map
+ {
+ typedef BOOST_DEDUCED_TYPENAME X::key_type key_type;
+ typedef BOOST_DEDUCED_TYPENAME X::mapped_type mapped_type;
+
+ random_generator type_;
+
+ unordered_generator_map(random_generator type)
+ : type_(type) {}
+
+ template <class T>
+ void fill(T& x, std::size_t len) {
+ key_type* key_ptr = 0;
+ mapped_type* mapped_ptr = 0;
+ int* int_ptr = 0;
+
+ for(std::size_t i = 0; i < len; ++i) {
+ key_type key = generate(key_ptr);
+
+ for(int count =
+ type_ == generate_collisions ?
+ generate(int_ptr) % 10 : 1;
+ count; --count) {
+ x.push_back(std::pair<key_type const, mapped_type>(key, generate(mapped_ptr)));
+ }
+ }
+ }
+ };
+
+ template <class X>
+ struct unordered_generator_base
+ : public boost::mpl::if_<
+ test::is_set<X>,
+ test::unordered_generator_set<X>,
+ test::unordered_generator_map<X> >
+ {
+ };
+
+ template <class X>
+ struct unordered_generator : public unordered_generator_base<X>::type
+ {
+ typedef BOOST_DEDUCED_TYPENAME unordered_generator_base<X>::type base;
+
+ unordered_generator(random_generator const& type = default_generator)
+ : base(type) {}
+ };
+
     template <class X>
     struct random_values
         : public std::list<BOOST_DEDUCED_TYPENAME X::value_type>
     {
- random_values(int count) {
- typedef BOOST_DEDUCED_TYPENAME X::value_type value_type;
- static test::generator<value_type> gen;
- std::generate_n(std::back_inserter(*this), count, gen);
+ random_values(int count, test::random_generator const& generator =
+ test::default_generator)
+ {
+ static test::unordered_generator<X> gen(generator);
+ gen.fill(*this, count);
         }
     };
 }

Modified: trunk/libs/unordered/test/objects/exception.hpp
==============================================================================
--- trunk/libs/unordered/test/objects/exception.hpp (original)
+++ trunk/libs/unordered/test/objects/exception.hpp 2008-01-20 13:55:57 EST (Sun, 20 Jan 2008)
@@ -32,6 +32,7 @@
     class hash;
     class equal_to;
     template <class T> class allocator;
+ object generate(object const*);
 
     class object
     {

Modified: trunk/libs/unordered/test/objects/test.hpp
==============================================================================
--- trunk/libs/unordered/test/objects/test.hpp (original)
+++ trunk/libs/unordered/test/objects/test.hpp 2008-01-20 13:55:57 EST (Sun, 20 Jan 2008)
@@ -23,6 +23,7 @@
     class less;
     class equal_to;
     template <class T> class allocator;
+ object generate(object const*);
 
     class object
     {
@@ -62,44 +63,6 @@
         }
     };
 
- // This object is usd to test how well the containers cope with equivalent keys.
- class equivalent_object
- {
- friend class hash;
- friend class equal_to;
- friend class less;
- int tag1_, tag2_;
- public:
- explicit equivalent_object(int t1 = 0, int t2 = 0) : tag1_(t1), tag2_(t2) {}
-
- ~equivalent_object() {
- tag1_ = -1;
- tag2_ = -1;
- }
-
- friend bool operator==(equivalent_object const& x1, equivalent_object const& x2) {
- return x1.tag1_ == x2.tag1_;
- }
-
- friend bool operator!=(equivalent_object const& x1, equivalent_object const& x2) {
- return x1.tag1_ != x2.tag1_;
- }
-
- friend bool operator<(equivalent_object const& x1, equivalent_object const& x2) {
- return x1.tag1_ < x2.tag1_;
- }
-
- friend equivalent_object generate(equivalent_object const*) {
- signed char* x = 0;
- return equivalent_object(generate(x), generate(x));
- }
-
- friend std::ostream& operator<<(std::ostream& out, equivalent_object const& o)
- {
- return out<<"("<<o.tag1_<<","<<o.tag2_<<")";
- }
- };
-
     class hash
     {
         int type_;
@@ -117,10 +80,6 @@
             }
         }
 
- std::size_t operator()(equivalent_object const& x) const {
- return x.tag1_;
- }
-
         std::size_t operator()(int x) const {
             return x;
         }
@@ -151,10 +110,6 @@
             }
         }
 
- bool operator()(equivalent_object const& x1, equivalent_object const& x2) const {
- return x1 < x2;
- }
-
         std::size_t operator()(int x1, int x2) const {
             return x1 < x2;
         }
@@ -181,10 +136,6 @@
             }
         }
 
- bool operator()(equivalent_object const& x1, equivalent_object const& x2) const {
- return x1 == x2;
- }
-
         std::size_t operator()(int x1, int x2) const {
             return x1 == x2;
         }
@@ -294,13 +245,6 @@
         y = tmp;
     }
 
- void swap(test::equivalent_object& x, test::equivalent_object& y) {
- test::equivalent_object tmp;
- tmp = x;
- x = y;
- y = tmp;
- }
-
     void swap(test::hash& x, test::hash& y) {
         test::hash tmp;
         tmp = x;

Modified: trunk/libs/unordered/test/unordered/assign_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/assign_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/assign_tests.cpp 2008-01-20 13:55:57 EST (Sun, 20 Jan 2008)
@@ -16,7 +16,7 @@
 test::seed_t seed(96785);
 
 template <class T>
-void assign_tests1(T* = 0)
+void assign_tests1(T*, test::random_generator generator = test::default_generator)
 {
     BOOST_DEDUCED_TYPENAME T::hasher hf;
     BOOST_DEDUCED_TYPENAME T::key_equal eq;
@@ -32,7 +32,7 @@
 
     std::cerr<<"assign_tests1.2\n";
     {
- test::random_values<T> v(1000);
+ test::random_values<T> v(1000, generator);
         T x(v.begin(), v.end());
 
         test::ordered<T> tracker = test::create_ordered(x);
@@ -50,7 +50,7 @@
 }
 
 template <class T>
-void assign_tests2(T* = 0)
+void assign_tests2(T*, test::random_generator generator = test::default_generator)
 {
     BOOST_DEDUCED_TYPENAME T::hasher hf1(1);
     BOOST_DEDUCED_TYPENAME T::hasher hf2(2);
@@ -61,7 +61,7 @@
 
     std::cerr<<"assign_tests2.1\n";
     {
- test::random_values<T> v(1000);
+ test::random_values<T> v(1000, generator);
         T x1(v.begin(), v.end(), 0, hf1, eq1);
         T x2(0, hf2, eq2);
         x2 = x1;
@@ -72,7 +72,7 @@
 
     std::cerr<<"assign_tests2.2\n";
     {
- test::random_values<T> v1(100), v2(100);
+ test::random_values<T> v1(100, generator), v2(100, generator);
         T x1(v1.begin(), v1.end(), 0, hf1, eq1, al1);
         T x2(v2.begin(), v2.end(), 0, hf2, eq2, al2);
         x2 = x1;
@@ -85,25 +85,30 @@
 
 int main()
 {
- assign_tests1((boost::unordered_set<int>*) 0);
- assign_tests1((boost::unordered_multiset<int>*) 0);
- assign_tests1((boost::unordered_map<int, int>*) 0);
- assign_tests1((boost::unordered_multimap<int, int>*) 0);
-
- assign_tests1((boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- assign_tests1((boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- assign_tests1((boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- assign_tests1((boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
-
- assign_tests1((boost::unordered_set<test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- assign_tests1((boost::unordered_multiset<test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- assign_tests1((boost::unordered_map<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- assign_tests1((boost::unordered_multimap<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
-
- assign_tests2((boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- assign_tests2((boost::unordered_multiset<test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- assign_tests2((boost::unordered_map<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- assign_tests2((boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
+ boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_set;
+ boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multiset;
+ boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_map;
+ boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multimap;
+
+ assign_tests1(test_set);
+ assign_tests1(test_multiset);
+ assign_tests1(test_map);
+ assign_tests1(test_multimap);
+
+ assign_tests1(test_set, test::generate_collisions);
+ assign_tests1(test_multiset, test::generate_collisions);
+ assign_tests1(test_map, test::generate_collisions);
+ assign_tests1(test_multimap, test::generate_collisions);
+
+ assign_tests2(test_set);
+ assign_tests2(test_multiset);
+ assign_tests2(test_map);
+ assign_tests2(test_multimap);
+
+ assign_tests2(test_set, test::generate_collisions);
+ assign_tests2(test_multiset, test::generate_collisions);
+ assign_tests2(test_map, test::generate_collisions);
+ assign_tests2(test_multimap, test::generate_collisions);
 
     return boost::report_errors();
 }

Modified: trunk/libs/unordered/test/unordered/bucket_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/bucket_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/bucket_tests.cpp 2008-01-20 13:55:57 EST (Sun, 20 Jan 2008)
@@ -50,11 +50,6 @@
 
 int main()
 {
- bucket_tests((boost::unordered_set<int>*) 0);
- bucket_tests((boost::unordered_multiset<int>*) 0);
- bucket_tests((boost::unordered_map<int, int>*) 0);
- bucket_tests((boost::unordered_multimap<int, int>*) 0);
-
     bucket_tests((boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
     bucket_tests((boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
     bucket_tests((boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);

Modified: trunk/libs/unordered/test/unordered/constructor_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/constructor_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/constructor_tests.cpp 2008-01-20 13:55:57 EST (Sun, 20 Jan 2008)
@@ -18,7 +18,7 @@
 test::seed_t seed(356730);
 
 template <class T>
-void constructor_tests1(T* = 0)
+void constructor_tests1(T*, test::random_generator generator = test::default_generator)
 {
     BOOST_DEDUCED_TYPENAME T::hasher hf;
     BOOST_DEDUCED_TYPENAME T::key_equal eq;
@@ -68,7 +68,7 @@
 
     std::cerr<<"Construct 5\n";
     {
- test::random_values<T> v(1000);
+ test::random_values<T> v(1000, generator);
         T x(v.begin(), v.end(), 10000, hf, eq);
         BOOST_TEST(x.bucket_count() >= 10000);
         BOOST_TEST(test::equivalent(x.hash_function(), hf));
@@ -80,7 +80,7 @@
 
     std::cerr<<"Construct 6\n";
     {
- test::random_values<T> v(10);
+ test::random_values<T> v(10, generator);
         T x(v.begin(), v.end(), 10000, hf);
         BOOST_TEST(x.bucket_count() >= 10000);
         BOOST_TEST(test::equivalent(x.hash_function(), hf));
@@ -92,7 +92,7 @@
 
     std::cerr<<"Construct 7\n";
     {
- test::random_values<T> v(100);
+ test::random_values<T> v(100, generator);
         T x(v.begin(), v.end(), 100);
         BOOST_TEST(x.bucket_count() >= 100);
         BOOST_TEST(test::equivalent(x.hash_function(), hf));
@@ -104,7 +104,7 @@
 
     std::cerr<<"Construct 8\n";
     {
- test::random_values<T> v(1);
+ test::random_values<T> v(1, generator);
         T x(v.begin(), v.end());
         BOOST_TEST(test::equivalent(x.hash_function(), hf));
         BOOST_TEST(test::equivalent(x.key_eq(), eq));
@@ -125,7 +125,7 @@
 
     std::cerr<<"Construct 10\n";
     {
- test::random_values<T> v(1000);
+ test::random_values<T> v(1000, generator);
         T x(v.begin(), v.end(), 10000, hf, eq, al);
         BOOST_TEST(x.bucket_count() >= 10000);
         BOOST_TEST(test::equivalent(x.hash_function(), hf));
@@ -137,7 +137,7 @@
 }
 
 template <class T>
-void constructor_tests2(T* = 0)
+void constructor_tests2(T*, test::random_generator const& generator = test::default_generator)
 {
     BOOST_DEDUCED_TYPENAME T::hasher hf;
     BOOST_DEDUCED_TYPENAME T::hasher hf1(1);
@@ -172,7 +172,7 @@
 
     std::cerr<<"Construct 3\n";
     {
- test::random_values<T> v(100);
+ test::random_values<T> v(100, generator);
         T x(v.begin(), v.end(), 0, hf1, eq1);
         BOOST_TEST(test::equivalent(x.hash_function(), hf1));
         BOOST_TEST(test::equivalent(x.key_eq(), eq1));
@@ -183,7 +183,7 @@
 
     std::cerr<<"Construct 4\n";
     {
- test::random_values<T> v(5);
+ test::random_values<T> v(5, generator);
         T x(v.begin(), v.end(), 1000, hf1);
         BOOST_TEST(x.bucket_count() >= 1000);
         BOOST_TEST(test::equivalent(x.hash_function(), hf1));
@@ -196,7 +196,7 @@
 
     std::cerr<<"Construct 5\n";
     {
- test::random_values<T> v(100);
+ test::random_values<T> v(100, generator);
         T x(v.begin(), v.end(), 0, hf, eq, al1);
         T y(x.begin(), x.end(), 0, hf1, eq1, al2);
         test::check_container(x, v);
@@ -207,7 +207,7 @@
 
     std::cerr<<"Construct 6\n";
     {
- test::random_values<T> v(100);
+ test::random_values<T> v(100, generator);
         T x(v.begin(), v.end(), 0, hf1, eq1);
         T y(x.begin(), x.end(), 0, hf, eq);
         test::check_container(x, v);
@@ -218,7 +218,7 @@
 
     std::cerr<<"Construct 7\n";
     {
- test::random_values<T> v(100);
+ test::random_values<T> v(100, generator);
         T x(v.begin(), v.end(), 0, hf1, eq1);
         T y(x.begin(), x.end(), 0, hf2, eq2);
         test::check_container(x, v);
@@ -229,7 +229,7 @@
 
     std::cerr<<"Construct 8 - from input iterator\n";
     {
- test::random_values<T> v(100);
+ test::random_values<T> v(100, generator);
         T x(test::input_iterator(v.begin()), test::input_iterator(v.end()), 0, hf1, eq1);
         T y(test::input_iterator(x.begin()), test::input_iterator(x.end()), 0, hf2, eq2);
         test::check_container(x, v);
@@ -257,55 +257,51 @@
 
 int main()
 {
- std::cerr<<"Test1 unordered_set<int>\n";
- constructor_tests1((boost::unordered_set<int>*) 0);
- std::cerr<<"Test1 unordered_multiset<int>\n";
- constructor_tests1((boost::unordered_multiset<int>*) 0);
- std::cerr<<"Test1 unordered_map<int, int>\n";
- constructor_tests1((boost::unordered_map<int, int>*) 0);
- std::cerr<<"Test1 unordered_multimap<int, int>\n";
- constructor_tests1((boost::unordered_multimap<int, int>*) 0);
-
- std::cerr<<"Test1 unordered_set<test::object>\n";
- constructor_tests1((boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- std::cerr<<"Test1 unordered_multiset<test::object>\n";
- constructor_tests1((boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- std::cerr<<"Test1 unordered_map<test::object, test::object>\n";
- constructor_tests1((boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- std::cerr<<"Test1 unordered_multimap<test::object, test::object>\n";
- constructor_tests1((boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
-
- std::cerr<<"Test1 unordered_set<test::equivalent_object>\n";
- constructor_tests1((boost::unordered_set<test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- std::cerr<<"Test1 unordered_multiset<test::equivalent_object>\n";
- constructor_tests1((boost::unordered_multiset<test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- std::cerr<<"Test1 unordered_map<test::equivalent_object, test::equivalent_object>\n";
- constructor_tests1((boost::unordered_map<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- std::cerr<<"Test1 unordered_multimap<test::equivalent_object, test::equivalent_object>\n";
- constructor_tests1((boost::unordered_multimap<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
-
- std::cerr<<"Test2 unordered_set<test::object>\n";
- constructor_tests2((boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- std::cerr<<"Test2 unordered_multiset<test::object>\n";
- constructor_tests2((boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- std::cerr<<"Test2 unordered_map<test::object, test::object>\n";
- constructor_tests2((boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- std::cerr<<"Test2 unordered_multimap<test::object, test::object>\n";
- constructor_tests2((boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
-
- std::cerr<<"Test2 unordered_set<test::equivalent_object>\n";
- constructor_tests2((boost::unordered_set<test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- std::cerr<<"Test2 unordered_multiset<test::equivalent_object>\n";
- constructor_tests2((boost::unordered_multiset<test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- std::cerr<<"Test2 unordered_map<test::equivalent_object, test::equivalent_object>\n";
- constructor_tests2((boost::unordered_map<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- std::cerr<<"Test2 unordered_multimap<test::equivalent_object, test::equivalent_object>\n";
- constructor_tests2((boost::unordered_multimap<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
+ boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_set;
+ boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multiset;
+ boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_map;
+ boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multimap;
+
+ std::cerr<<"Test1 test_set\n";
+ constructor_tests1(test_set);
+ std::cerr<<"Test1 test_multiset\n";
+ constructor_tests1(test_multiset);
+ std::cerr<<"Test1 test_map\n";
+ constructor_tests1(test_map);
+ std::cerr<<"Test1 test_multimap\n";
+ constructor_tests1(test_multimap);
+
+ std::cerr<<"Test1 test_set, collisions\n";
+ constructor_tests1(test_set, test::generate_collisions);
+ std::cerr<<"Test1 test_multiset, collisions\n";
+ constructor_tests1(test_multiset, test::generate_collisions);
+ std::cerr<<"Test1 test_map, collisions\n";
+ constructor_tests1(test_map, test::generate_collisions);
+ std::cerr<<"Test1 test_multimap, collisions\n";
+ constructor_tests1(test_multimap, test::generate_collisions);
+
+ std::cerr<<"Test2 test_set\n";
+ constructor_tests2(test_set);
+ std::cerr<<"Test2 test_multiset\n";
+ constructor_tests2(test_multiset);
+ std::cerr<<"Test2 test_map\n";
+ constructor_tests2(test_map);
+ std::cerr<<"Test2 test_multimap\n";
+ constructor_tests2(test_multimap);
+
+ std::cerr<<"Test2 test_set, collisions\n";
+ constructor_tests2(test_set, test::generate_collisions);
+ std::cerr<<"Test2 test_multiset, collisions\n";
+ constructor_tests2(test_multiset, test::generate_collisions);
+ std::cerr<<"Test2 test_map, collisions\n";
+ constructor_tests2(test_map, test::generate_collisions);
+ std::cerr<<"Test2 test_multimap, collisions\n";
+ constructor_tests2(test_multimap, test::generate_collisions);
 
     std::cerr<<"Map Test unordered_map<test::object, test::object>\n";
- map_constructor_test((boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
+ map_constructor_test(test_map);
     std::cerr<<"Map Test unordered_multimap<test::object, test::object>\n";
- map_constructor_test((boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
+ map_constructor_test(test_multimap);
 
     return boost::report_errors();
 }

Modified: trunk/libs/unordered/test/unordered/copy_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/copy_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/copy_tests.cpp 2008-01-20 13:55:57 EST (Sun, 20 Jan 2008)
@@ -15,7 +15,7 @@
 test::seed_t seed(9063);
 
 template <class T>
-void copy_construct_tests1(T* = 0)
+void copy_construct_tests1(T*, test::random_generator const& generator = test::default_generator)
 {
     BOOST_DEDUCED_TYPENAME T::hasher hf;
     BOOST_DEDUCED_TYPENAME T::key_equal eq;
@@ -60,7 +60,7 @@
 }
 
 template <class T>
-void copy_construct_tests2(T* ptr = 0)
+void copy_construct_tests2(T* ptr, test::random_generator const& generator = test::default_generator)
 {
     copy_construct_tests1(ptr);
 
@@ -92,20 +92,25 @@
 
 int main()
 {
- copy_construct_tests1((boost::unordered_set<int>*) 0);
- copy_construct_tests1((boost::unordered_multiset<int>*) 0);
- copy_construct_tests1((boost::unordered_map<int, int>*) 0);
- copy_construct_tests1((boost::unordered_multimap<int, int>*) 0);
-
- copy_construct_tests2((boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- copy_construct_tests2((boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- copy_construct_tests2((boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- copy_construct_tests2((boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
-
- copy_construct_tests2((boost::unordered_set<test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- copy_construct_tests2((boost::unordered_multiset<test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- copy_construct_tests2((boost::unordered_map<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- copy_construct_tests2((boost::unordered_multimap<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
+ boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_set;
+ boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multiset;
+ boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_map;
+ boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multimap;
+
+ copy_construct_tests1(test_set);
+ copy_construct_tests1(test_multiset);
+ copy_construct_tests1(test_map);
+ copy_construct_tests1(test_multimap);
+
+ copy_construct_tests2(test_set);
+ copy_construct_tests2(test_multiset);
+ copy_construct_tests2(test_map);
+ copy_construct_tests2(test_multimap);
+
+ copy_construct_tests2(test_set, test::generate_collisions);
+ copy_construct_tests2(test_multiset, test::generate_collisions);
+ copy_construct_tests2(test_map, test::generate_collisions);
+ copy_construct_tests2(test_multimap, test::generate_collisions);
 
     return boost::report_errors();
 }

Modified: trunk/libs/unordered/test/unordered/erase_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/erase_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/erase_tests.cpp 2008-01-20 13:55:57 EST (Sun, 20 Jan 2008)
@@ -18,11 +18,11 @@
 test::seed_t seed(85638);
 
 template <class Container>
-void erase_tests1(Container* = 0)
+void erase_tests1(Container*, test::random_generator generator = test::default_generator)
 {
     std::cerr<<"Erase by key.\n";
     {
- test::random_values<Container> v(1000);
+ test::random_values<Container> v(1000, generator);
         Container x(v.begin(), v.end());
         for(BOOST_DEDUCED_TYPENAME test::random_values<Container>::iterator it = v.begin();
             it != v.end(); ++it)
@@ -38,7 +38,7 @@
 
     std::cerr<<"erase(begin()).\n";
     {
- test::random_values<Container> v(1000);
+ test::random_values<Container> v(1000, generator);
         Container x(v.begin(), v.end());
         std::size_t size = x.size();
         while(size > 0 && !x.empty())
@@ -56,7 +56,7 @@
 
     std::cerr<<"erase(random position).\n";
     {
- test::random_values<Container> v(1000);
+ test::random_values<Container> v(1000, generator);
         Container x(v.begin(), v.end());
         std::size_t size = x.size();
         while(size > 0 && !x.empty())
@@ -87,7 +87,7 @@
 
     std::cerr<<"erase(ranges).\n";
     {
- test::random_values<Container> v(500);
+ test::random_values<Container> v(500, generator);
         Container x(v.begin(), v.end());
 
         std::size_t size = x.size();
@@ -109,42 +109,40 @@
 
     std::cerr<<"clear().\n";
     {
- test::random_values<Container> v(500);
+ test::random_values<Container> v(500, generator);
         Container x(v.begin(), v.end());
         x.clear();
         BOOST_TEST(x.empty());
         BOOST_TEST(x.begin() == x.end());
     }
+
+ std::cerr<<"\n";
 }
 
 int main()
 {
- std::cerr<<"Erase unordered_set<int>.\n";
- erase_tests1((boost::unordered_set<int>*) 0);
- std::cerr<<"\nErase unordered_multiset<int>.\n";
- erase_tests1((boost::unordered_multiset<int>*) 0);
- std::cerr<<"\nErase unordered_map<int>.\n";
- erase_tests1((boost::unordered_map<int, int>*) 0);
- std::cerr<<"\nErase unordered_multimap<int>.\n";
- erase_tests1((boost::unordered_multimap<int, int>*) 0);
-
- std::cerr<<"\nErase unordered_set<test::object,..>.\n";
- erase_tests1((boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- std::cerr<<"\nErase unordered_multiset<test::object,..>.\n";
- erase_tests1((boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- std::cerr<<"\nErase unordered_map<test::object,..>.\n";
- erase_tests1((boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- std::cerr<<"\nErase unordered_multimap<test::object,..>.\n";
- erase_tests1((boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
-
- std::cerr<<"\nErase unordered_set<test::equivalent_object,..>.\n";
- erase_tests1((boost::unordered_set<test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- std::cerr<<"\nErase unordered_multiset<test::equivalent_object,..>.\n";
- erase_tests1((boost::unordered_multiset<test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- std::cerr<<"\nErase unordered_map<test::equivalent_object,..>.\n";
- erase_tests1((boost::unordered_map<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- std::cerr<<"\nErase unordered_multimap<test::equivalent_object,..>.\n";
- erase_tests1((boost::unordered_multimap<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
+ boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_set;
+ boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multiset;
+ boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_map;
+ boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multimap;
+
+ std::cerr<<"Erase test_set.\n";
+ erase_tests1(test_set);
+ std::cerr<<"Erase test_multiset.\n";
+ erase_tests1(test_multiset);
+ std::cerr<<"Erase test_map.\n";
+ erase_tests1(test_map);
+ std::cerr<<"Erase test_multimap.\n";
+ erase_tests1(test_multimap);
+
+ std::cerr<<"Erase test_set, collisions.\n";
+ erase_tests1(test_set, test::generate_collisions);
+ std::cerr<<"Erase test_multiset, collisions.\n";
+ erase_tests1(test_multiset, test::generate_collisions);
+ std::cerr<<"Erase test_map, collisions.\n";
+ erase_tests1(test_map, test::generate_collisions);
+ std::cerr<<"Erase test_multimap, collisions.\n";
+ erase_tests1(test_multimap, test::generate_collisions);
 
     return boost::report_errors();
 }

Modified: trunk/libs/unordered/test/unordered/find_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/find_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/find_tests.cpp 2008-01-20 13:55:57 EST (Sun, 20 Jan 2008)
@@ -14,12 +14,12 @@
 test::seed_t seed(78937);
 
 template <class X>
-void find_tests1(X*)
+void find_tests1(X*, test::random_generator generator = test::default_generator)
 {
     typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
 
     {
- test::random_values<X> v(500);
+ test::random_values<X> v(500, generator);
         X x(v.begin(), v.end());
         X const& x_const = x;
         test::ordered<X> tracker = test::create_ordered(x);
@@ -46,7 +46,7 @@
                     (BOOST_DEDUCED_TYPENAME test::non_const_value_type<X>::type*) 0);
         }
 
- test::random_values<X> v2(500);
+ test::random_values<X> v2(500, generator);
         for(BOOST_DEDUCED_TYPENAME test::random_values<X>::const_iterator it2 =
                 v2.begin(); it2 != v2.end(); ++it2)
         {
@@ -65,7 +65,7 @@
     {
         X x;
 
- test::random_values<X> v2(5);
+ test::random_values<X> v2(5, generator);
         for(BOOST_DEDUCED_TYPENAME test::random_values<X>::const_iterator it3 =
                 v2.begin(); it3 != v2.end(); ++it3)
         {
@@ -80,20 +80,20 @@
 
 int main()
 {
- find_tests1((boost::unordered_set<int>*) 0);
- find_tests1((boost::unordered_multiset<int>*) 0);
- find_tests1((boost::unordered_map<int, int>*) 0);
- find_tests1((boost::unordered_multimap<int, int>*) 0);
-
- find_tests1((boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- find_tests1((boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- find_tests1((boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- find_tests1((boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
-
- find_tests1((boost::unordered_set<test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- find_tests1((boost::unordered_multiset<test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- find_tests1((boost::unordered_map<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- find_tests1((boost::unordered_multimap<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
+ boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_set;
+ boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multiset;
+ boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_map;
+ boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multimap;
+
+ find_tests1(test_set);
+ find_tests1(test_multiset);
+ find_tests1(test_map);
+ find_tests1(test_multimap);
+
+ find_tests1(test_set, test::generate_collisions);
+ find_tests1(test_multiset, test::generate_collisions);
+ find_tests1(test_map, test::generate_collisions);
+ find_tests1(test_multimap, test::generate_collisions);
 
     return 0;
 }

Modified: trunk/libs/unordered/test/unordered/insert_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/insert_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/insert_tests.cpp 2008-01-20 13:55:57 EST (Sun, 20 Jan 2008)
@@ -19,7 +19,7 @@
 test::seed_t seed(243432);
 
 template <class X>
-void unique_insert_tests1(X* = 0)
+void unique_insert_tests1(X*, test::random_generator generator = test::default_generator)
 {
     typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
     typedef test::ordered<X> ordered;
@@ -29,7 +29,7 @@
     X x;
     test::ordered<X> tracker = test::create_ordered(x);
 
- test::random_values<X> v(1000);
+ test::random_values<X> v(1000, generator);
 
     for(BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin();
             it != v.end(); ++it)
@@ -54,14 +54,14 @@
 }
 
 template <class X>
-void equivalent_insert_tests1(X* = 0)
+void equivalent_insert_tests1(X*, test::random_generator generator = test::default_generator)
 {
     std::cerr<<"insert(value) tests for containers with equivalent keys.\n";
 
     X x;
     test::ordered<X> tracker = test::create_ordered(x);
 
- test::random_values<X> v(1000);
+ test::random_values<X> v(1000, generator);
     for(BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin();
             it != v.end(); ++it)
     {
@@ -83,7 +83,7 @@
 }
 
 template <class X>
-void insert_tests2(X* = 0)
+void insert_tests2(X*, test::random_generator generator = test::default_generator)
 {
     typedef BOOST_DEDUCED_TYPENAME test::ordered<X> tracker_type;
     typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
@@ -96,7 +96,7 @@
         X x;
         tracker_type tracker = test::create_ordered(x);
 
- test::random_values<X> v(1000);
+ test::random_values<X> v(1000, generator);
         for(BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin();
                 it != v.end(); ++it)
         {
@@ -122,7 +122,7 @@
         X const& x_const = x;
         tracker_type tracker = test::create_ordered(x);
 
- test::random_values<X> v(100);
+ test::random_values<X> v(100, generator);
         for(BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin();
                 it != v.end(); ++it)
         {
@@ -148,7 +148,7 @@
         const_iterator pos = x.begin();
         tracker_type tracker = test::create_ordered(x);
 
- test::random_values<X> v(1000);
+ test::random_values<X> v(1000, generator);
         for(BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin();
                 it != v.end(); ++it)
         {
@@ -173,7 +173,7 @@
         X x;
         tracker_type tracker = test::create_ordered(x);
 
- test::random_values<X> v(1000);
+ test::random_values<X> v(1000, generator);
         for(BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin();
                 it != v.end(); ++it)
         {
@@ -196,7 +196,7 @@
     {
         X x;
 
- test::random_values<X> v(1000);
+ test::random_values<X> v(1000, generator);
         x.insert(v.begin(), v.end());
 
         test::check_container(x, v);
@@ -208,7 +208,7 @@
     {
         X x;
 
- test::random_values<X> v(1000);
+ test::random_values<X> v(1000, generator);
         x.insert(test::input_iterator(v.begin()), test::input_iterator(v.end()));
         test::check_container(x, v);
 
@@ -217,14 +217,14 @@
 }
 
 template <class X>
-void map_tests(X* = 0)
+void map_tests(X*, test::random_generator generator = test::default_generator)
 {
     std::cerr<<"map tests.\n";
 
     X x;
     test::ordered<X> tracker = test::create_ordered(x);
 
- test::random_values<X> v(1000);
+ test::random_values<X> v(1000, generator);
     for(BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin();
             it != v.end(); ++it)
     {
@@ -244,12 +244,12 @@
 }
 
 template <class X>
-void associative_insert_range_test(X* = 0)
+void associative_insert_range_test(X*, test::random_generator generator = test::default_generator)
 {
     std::cerr<<"associative_insert_range_test\n";
 
     typedef std::list<std::pair<BOOST_DEDUCED_TYPENAME X::key_type, BOOST_DEDUCED_TYPENAME X::mapped_type> > list;
- test::random_values<X> v(1000);
+ test::random_values<X> v(1000, generator);
     list l;
     std::copy(v.begin(), v.end(), std::back_inserter(l));
 
@@ -260,42 +260,38 @@
 
 int main()
 {
- unique_insert_tests1((boost::unordered_set<int>*) 0);
- equivalent_insert_tests1((boost::unordered_multiset<int>*) 0);
- unique_insert_tests1((boost::unordered_map<int, int>*) 0);
- equivalent_insert_tests1((boost::unordered_multimap<int, int>*) 0);
-
- unique_insert_tests1((boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- equivalent_insert_tests1((boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- unique_insert_tests1((boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- equivalent_insert_tests1((boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
-
- unique_insert_tests1((boost::unordered_set<test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- equivalent_insert_tests1((boost::unordered_multiset<test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- unique_insert_tests1((boost::unordered_map<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- equivalent_insert_tests1((boost::unordered_multimap<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
-
- insert_tests2((boost::unordered_set<int>*) 0);
- insert_tests2((boost::unordered_multiset<int>*) 0);
- insert_tests2((boost::unordered_map<int, int>*) 0);
- insert_tests2((boost::unordered_multimap<int, int>*) 0);
-
- insert_tests2((boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- insert_tests2((boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- insert_tests2((boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- insert_tests2((boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
-
- insert_tests2((boost::unordered_set<test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- insert_tests2((boost::unordered_multiset<test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- insert_tests2((boost::unordered_map<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
- insert_tests2((boost::unordered_multimap<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
-
- map_tests((boost::unordered_map<int, int>*) 0);
- map_tests((boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- map_tests((boost::unordered_map<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
-
- associative_insert_range_test((boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- associative_insert_range_test((boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- associative_insert_range_test((boost::unordered_multimap<test::equivalent_object, test::equivalent_object, test::hash, test::equal_to, test::allocator<test::equivalent_object> >*) 0);
+ boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_set;
+ boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multiset;
+ boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_map;
+ boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multimap;
+
+ unique_insert_tests1(test_set);
+ equivalent_insert_tests1(test_multiset);
+ unique_insert_tests1(test_map);
+ equivalent_insert_tests1(test_multimap);
+
+ unique_insert_tests1(test_set, test::generate_collisions);
+ equivalent_insert_tests1(test_multiset, test::generate_collisions);
+ unique_insert_tests1(test_map, test::generate_collisions);
+ equivalent_insert_tests1(test_multimap, test::generate_collisions);
+
+ insert_tests2(test_set);
+ insert_tests2(test_multiset);
+ insert_tests2(test_map);
+ insert_tests2(test_multimap);
+
+ insert_tests2(test_set, test::generate_collisions);
+ insert_tests2(test_multiset, test::generate_collisions);
+ insert_tests2(test_map, test::generate_collisions);
+ insert_tests2(test_multimap, test::generate_collisions);
+
+ map_tests(test_map);
+ map_tests(test_map, test::generate_collisions);
+
+ associative_insert_range_test(test_map);
+ associative_insert_range_test(test_map, test::generate_collisions);
+ associative_insert_range_test(test_multimap);
+ associative_insert_range_test(test_multimap, test::generate_collisions);
+
     return boost::report_errors();
 }

Modified: trunk/libs/unordered/test/unordered/swap_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/swap_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/swap_tests.cpp 2008-01-20 13:55:57 EST (Sun, 20 Jan 2008)
@@ -116,23 +116,20 @@
 
 int main()
 {
- std::cerr<<"Erase unordered_set<int>.\n";
- swap_tests1((boost::unordered_set<int>*) 0);
- std::cerr<<"\nErase unordered_multiset<int>.\n";
- swap_tests1((boost::unordered_multiset<int>*) 0);
- std::cerr<<"\nErase unordered_map<int>.\n";
- swap_tests1((boost::unordered_map<int, int>*) 0);
- std::cerr<<"\nErase unordered_multimap<int>.\n";
- swap_tests1((boost::unordered_multimap<int, int>*) 0);
+ boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_set;
+ boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multiset;
+ boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_map;
+ boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multimap;
 
- std::cerr<<"\nErase unordered_set<test::object,..>.\n";
- swap_tests2((boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- std::cerr<<"\nErase unordered_multiset<test::object,..>.\n";
- swap_tests2((boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- std::cerr<<"\nErase unordered_map<test::object,..>.\n";
- swap_tests2((boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
- std::cerr<<"\nErase unordered_multimap<test::object,..>.\n";
- swap_tests2((boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >*) 0);
+ swap_tests1(test_set);
+ swap_tests1(test_multiset);
+ swap_tests1(test_map);
+ swap_tests1(test_multimap);
+
+ swap_tests2(test_set);
+ swap_tests2(test_multiset);
+ swap_tests2(test_map);
+ swap_tests2(test_multimap);
 
     return boost::report_errors();
 }


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