forked from boostorg/unordered
Use pre-review copy of unordered for trunk.
[SVN r42183]
This commit is contained in:
@@ -111,7 +111,6 @@ void container_test(X& r, T&)
|
||||
(&a1)->~X();
|
||||
|
||||
X const a_const;
|
||||
|
||||
test::check_return_type<iterator>::equals(a.begin());
|
||||
test::check_return_type<const_iterator>::equals(a_const.begin());
|
||||
test::check_return_type<const_iterator>::equals(a.cbegin());
|
||||
@@ -120,18 +119,12 @@ void container_test(X& r, T&)
|
||||
test::check_return_type<const_iterator>::equals(a_const.end());
|
||||
test::check_return_type<const_iterator>::equals(a.cend());
|
||||
test::check_return_type<const_iterator>::equals(a_const.cend());
|
||||
}
|
||||
|
||||
template <class X, class T>
|
||||
void equality_test(X& r, T&)
|
||||
{
|
||||
X const a = r, b = r;
|
||||
// No tests for ==, != since they're not required for unordered containers.
|
||||
|
||||
test::check_return_type<bool>::equals(a == b);
|
||||
test::check_return_type<bool>::equals(a != b);
|
||||
#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
|
||||
test::check_return_type<std::size_t>::equals(boost::hash_value(a));
|
||||
#else
|
||||
test::check_return_type<std::size_t>::equals(hash_value(a));
|
||||
#endif
|
||||
a.swap(b);
|
||||
test::check_return_type<X>::equals_ref(r = a);
|
||||
test::check_return_type<size_type>::equals(a.size());
|
||||
test::check_return_type<size_type>::equals(a.max_size());
|
||||
test::check_return_type<bool>::convertible(a.empty());
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "../objects/minimal.hpp"
|
||||
#include "./compile_tests.hpp"
|
||||
|
||||
void container_tests()
|
||||
int main()
|
||||
{
|
||||
typedef std::pair<test::minimal::assignable const,
|
||||
test::minimal::copy_constructible> value_type;
|
||||
@@ -40,36 +40,6 @@ void container_tests()
|
||||
test::minimal::allocator<value_type> > multimap;
|
||||
|
||||
container_test(multimap, value);
|
||||
}
|
||||
|
||||
void equality_tests() {
|
||||
typedef std::pair<test::minimal::assignable const,
|
||||
test::minimal::copy_constructible_equality_comparable> value_type;
|
||||
value_type value(
|
||||
test::minimal::assignable::create(),
|
||||
test::minimal::copy_constructible_equality_comparable::create());
|
||||
|
||||
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::allocator<value_type> > map;
|
||||
|
||||
equality_test(map, value);
|
||||
|
||||
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::allocator<value_type> > multimap;
|
||||
|
||||
equality_test(multimap, value);
|
||||
}
|
||||
|
||||
int main() {
|
||||
container_tests();
|
||||
equality_tests();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ int main()
|
||||
test::minimal::allocator<test::minimal::assignable> > set;
|
||||
|
||||
container_test(set, assignable);
|
||||
equality_test(set, assignable);
|
||||
|
||||
std::cout<<"Test unordered_multiset.\n";
|
||||
boost::unordered_multiset<
|
||||
@@ -35,7 +34,6 @@ int main()
|
||||
test::minimal::allocator<test::minimal::assignable> > multiset;
|
||||
|
||||
container_test(multiset, assignable);
|
||||
equality_test(multiset, assignable);
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user