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 398 additions and 323 deletions
+7 -17
View File
@@ -7,7 +7,7 @@
// hairy with several tricky edge cases - so explicitly test each one.
#include <boost/unordered_map.hpp>
#include <boost/detail/lightweight_test.hpp>
#include "../helpers/test.hpp"
#include <list>
#include <set>
#include <iostream>
@@ -52,8 +52,7 @@ typedef boost::unordered_multimap<int, int,
typedef collide_map::value_type collide_value;
typedef std::list<collide_value> collide_list;
void empty_range_tests()
UNORDERED_AUTO_TEST(empty_range_tests)
{
collide_map x;
x.erase(x.begin(), x.end());
@@ -61,7 +60,7 @@ void empty_range_tests()
x.erase(x.end(), x.end());
}
void single_item_tests()
UNORDERED_AUTO_TEST(single_item_tests)
{
collide_list init;
init.push_back(collide_value(1,1));
@@ -75,7 +74,7 @@ void single_item_tests()
BOOST_TEST(x.count(1) == 0 && x.size() == 0);
}
void two_equivalent_item_tests()
UNORDERED_AUTO_TEST(two_equivalent_item_tests)
{
collide_list init;
init.push_back(collide_value(1,1));
@@ -172,7 +171,7 @@ void exhaustive_erase_tests(Container* x, int num_values,
}
}
void exhaustive_collide_tests()
UNORDERED_AUTO_TEST(exhaustive_collide_tests)
{
std::cout<<"exhaustive_collide_tests:\n";
collide_map m;
@@ -180,20 +179,11 @@ void exhaustive_collide_tests()
std::cout<<"\n";
}
void exhaustive_collide2_tests()
UNORDERED_AUTO_TEST(exhaustive_collide2_tests)
{
std::cout<<"exhaustive_collide2_tests:\n";
exhaustive_erase_tests((collide_map2*) 0, 8, 4);
std::cout<<"\n";
}
int main()
{
empty_range_tests();
single_item_tests();
two_equivalent_item_tests();
exhaustive_collide_tests();
exhaustive_collide2_tests();
return boost::report_errors();
}
RUN_TESTS()