Merge new changes to unordered & hash.

- Unordered tests can run lightweight test or Boost.Test (at least
   theoretically).
 - Workaround Open BSD's incorrect numeric_limits.
 - Move the hash extensions in their own file.
 - Various small improvements to the unordered docs.
 - Fix some unordered examples.

Merged revisions 43117-43837 via svnmerge from 
https://svn.boost.org/svn/boost/branches/unordered/trunk


[SVN r43838]
This commit is contained in:
Daniel James
2008-03-24 17:03:15 +00:00
parent 535a41a2f5
commit e07e7e889d
29 changed files with 399 additions and 324 deletions

View File

@@ -5,7 +5,7 @@
#include <boost/unordered_set.hpp>
#include <boost/unordered_map.hpp>
#include <boost/detail/lightweight_test.hpp>
#include "../helpers/test.hpp"
#include "../objects/test.hpp"
#include "../helpers/random_values.hpp"
#include "../helpers/tracker.hpp"
@@ -15,6 +15,8 @@
#include <iostream>
namespace constructor_tests {
test::seed_t seed(356730);
template <class T>
@@ -255,53 +257,28 @@ void map_constructor_test(T* = 0)
test::check_equivalent_keys(x);
}
int main()
{
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;
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);
using test::default_generator;
using test::generate_collisions;
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);
UNORDERED_TEST(constructor_tests1,
((test_set)(test_multiset)(test_map)(test_multimap))
((default_generator)(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);
UNORDERED_TEST(constructor_tests2,
((test_set)(test_multiset)(test_map)(test_multimap))
((default_generator)(generate_collisions))
)
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);
UNORDERED_TEST(map_constructor_test,
((test_map)(test_multimap))
)
std::cerr<<"Map Test unordered_map<test::object, test::object>\n";
map_constructor_test(test_map);
std::cerr<<"Map Test unordered_multimap<test::object, test::object>\n";
map_constructor_test(test_multimap);
return boost::report_errors();
}
RUN_TESTS()