|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r58692 - in trunk: boost/functional/hash boost/unordered boost/unordered/detail libs/functional/hash/test libs/unordered/examples libs/unordered/test/exception libs/unordered/test/helpers libs/unordered/test/objects libs/unordered/test/unordered
From: daniel_james_at_[hidden]
Date: 2010-01-04 17:49:44
Author: danieljames
Date: 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
New Revision: 58692
URL: http://svn.boost.org/trac/boost/changeset/58692
Log:
Formatting changes, mostly to fit within 80 characters.
Also, some C casts converted to static_cast.
Text files modified:
trunk/boost/functional/hash/hash.hpp | 20 +++--
trunk/boost/unordered/detail/fwd.hpp | 6 +
trunk/boost/unordered/detail/unique.hpp | 4
trunk/boost/unordered/unordered_map.hpp | 3
trunk/libs/functional/hash/test/config.hpp | 3
trunk/libs/functional/hash/test/container_fwd_test.cpp | 9 +
trunk/libs/functional/hash/test/hash_complex_test.cpp | 17 +++-
trunk/libs/functional/hash/test/hash_custom_test.cpp | 4
trunk/libs/functional/hash/test/hash_float_test.hpp | 121 +++++++++++++++++++++++++++------------
trunk/libs/functional/hash/test/hash_friend_test.cpp | 4
trunk/libs/functional/hash/test/hash_fwd_test.hpp | 6 +
trunk/libs/functional/hash/test/hash_fwd_test_1.cpp | 7 +
trunk/libs/functional/hash/test/hash_global_namespace_test.cpp | 4
trunk/libs/functional/hash/test/hash_number_test.cpp | 5 +
trunk/libs/functional/hash/test/hash_range_test.cpp | 6 +
trunk/libs/unordered/examples/fnv1.hpp | 9 +
trunk/libs/unordered/test/exception/assign_exception_tests.cpp | 12 ++-
trunk/libs/unordered/test/exception/constructor_exception_tests.cpp | 16 ++++
trunk/libs/unordered/test/exception/erase_exception_tests.cpp | 3
trunk/libs/unordered/test/exception/insert_exception_tests.cpp | 28 ++++++--
trunk/libs/unordered/test/exception/rehash_exception_tests.cpp | 4
trunk/libs/unordered/test/helpers/count.hpp | 11 ++
trunk/libs/unordered/test/helpers/equivalent.hpp | 8 +
trunk/libs/unordered/test/helpers/exception_test.hpp | 96 ++++++++++++++++++-------------
trunk/libs/unordered/test/helpers/helpers.hpp | 6 +
trunk/libs/unordered/test/helpers/invariants.hpp | 20 ++++--
trunk/libs/unordered/test/helpers/list.hpp | 29 +++++++-
trunk/libs/unordered/test/helpers/memory.hpp | 26 +++++--
trunk/libs/unordered/test/helpers/prefix.hpp | 3
trunk/libs/unordered/test/helpers/random_values.hpp | 4
trunk/libs/unordered/test/helpers/test.hpp | 55 +++++++++--------
trunk/libs/unordered/test/helpers/tracker.hpp | 67 ++++++++++++++-------
trunk/libs/unordered/test/objects/minimal.hpp | 65 ++++++++++++++++----
trunk/libs/unordered/test/objects/test.hpp | 40 ++++++++++--
trunk/libs/unordered/test/unordered/assign_tests.cpp | 22 +++++-
trunk/libs/unordered/test/unordered/bucket_tests.cpp | 34 ++++++++--
trunk/libs/unordered/test/unordered/compile_tests.hpp | 115 ++++++++++++++++++++++++++-----------
trunk/libs/unordered/test/unordered/constructor_tests.cpp | 38 +++++++++---
trunk/libs/unordered/test/unordered/copy_tests.cpp | 22 +++++-
trunk/libs/unordered/test/unordered/equality_tests.cpp | 63 ++++++++++---------
trunk/libs/unordered/test/unordered/equivalent_keys_tests.cpp | 25 ++++---
trunk/libs/unordered/test/unordered/erase_equiv_tests.cpp | 3
trunk/libs/unordered/test/unordered/erase_tests.cpp | 38 ++++++++---
trunk/libs/unordered/test/unordered/find_tests.cpp | 25 +++++--
trunk/libs/unordered/test/unordered/fwd_set_test.cpp | 3
trunk/libs/unordered/test/unordered/incomplete_test.cpp | 31 ++++++---
trunk/libs/unordered/test/unordered/insert_stable_tests.cpp | 10 ++
trunk/libs/unordered/test/unordered/insert_tests.cpp | 95 +++++++++++++++++++++----------
trunk/libs/unordered/test/unordered/load_factor_tests.cpp | 3
trunk/libs/unordered/test/unordered/move_tests.cpp | 28 ++++++--
trunk/libs/unordered/test/unordered/rehash_tests.cpp | 12 ++-
trunk/libs/unordered/test/unordered/simple_tests.cpp | 3
trunk/libs/unordered/test/unordered/swap_tests.cpp | 28 ++++++--
trunk/libs/unordered/test/unordered/unnecessary_copy_tests.cpp | 46 ++++++++------
54 files changed, 915 insertions(+), 450 deletions(-)
Modified: trunk/boost/functional/hash/hash.hpp
==============================================================================
--- trunk/boost/functional/hash/hash.hpp (original)
+++ trunk/boost/functional/hash/hash.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -20,7 +20,8 @@
#include <boost/type_traits/is_pointer.hpp>
#endif
-#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
+#if BOOST_WORKAROUND(__GNUC__, < 3) \
+ && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
#define BOOST_HASH_CHAR_TRAITS string_char_traits
#else
#define BOOST_HASH_CHAR_TRAITS char_traits
@@ -67,7 +68,8 @@
std::size_t hash_value(long double v);
template <class Ch, class A>
- std::size_t hash_value(std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const&);
+ std::size_t hash_value(
+ std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const&);
// Implementation
@@ -200,9 +202,10 @@
#if defined(BOOST_MSVC)
#pragma warning(push)
#if BOOST_MSVC <= 1400
-#pragma warning(disable:4267) // 'argument' : conversion from 'size_t' to 'unsigned int',
- // possible loss of data
- // A misguided attempt to detect 64-bit incompatability.
+#pragma warning(disable:4267) // 'argument' : conversion from 'size_t' to
+ // 'unsigned int', possible loss of data
+ // A misguided attempt to detect 64-bit
+ // incompatability.
#endif
#endif
@@ -285,7 +288,8 @@
#endif
template <class Ch, class A>
- inline std::size_t hash_value(std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const& v)
+ inline std::size_t hash_value(
+ std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const& v)
{
return hash_range(v.begin(), v.end());
}
@@ -310,8 +314,8 @@
//
// Define the specializations required by the standard. The general purpose
- // boost::hash is defined later in extensions.hpp if BOOST_HASH_NO_EXTENSIONS
- // is not defined.
+ // boost::hash is defined later in extensions.hpp if
+ // BOOST_HASH_NO_EXTENSIONS is not defined.
// BOOST_HASH_SPECIALIZE - define a specialization for a type which is
// passed by copy.
Modified: trunk/boost/unordered/detail/fwd.hpp
==============================================================================
--- trunk/boost/unordered/detail/fwd.hpp (original)
+++ trunk/boost/unordered/detail/fwd.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -270,7 +270,8 @@
typedef BOOST_DEDUCED_TYPENAME A::value_type value_type;
typedef BOOST_DEDUCED_TYPENAME iterator_base::node node;
- typedef BOOST_DEDUCED_TYPENAME bucket::bucket_allocator bucket_allocator;
+ typedef BOOST_DEDUCED_TYPENAME bucket::bucket_allocator
+ bucket_allocator;
typedef BOOST_DEDUCED_TYPENAME bucket::bucket_ptr bucket_ptr;
typedef BOOST_DEDUCED_TYPENAME bucket::node_ptr node_ptr;
@@ -973,7 +974,8 @@
typedef E extractor;
typedef G group_type;
- typedef hash_node_constructor<value_allocator, group_type> node_constructor;
+ typedef hash_node_constructor<value_allocator, group_type>
+ node_constructor;
typedef hash_buckets<value_allocator, group_type> buckets;
typedef hash_buffered_functions<hasher, key_equal> buffered_functions;
Modified: trunk/boost/unordered/detail/unique.hpp
==============================================================================
--- trunk/boost/unordered/detail/unique.hpp (original)
+++ trunk/boost/unordered/detail/unique.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -323,8 +323,8 @@
do {
// No side effects in this initial code
- // Note: can't use get_key as '*i' might not be value_type - it could
- // be a pair with first_types as key_type without const or a
+ // Note: can't use get_key as '*i' might not be value_type - it
+ // could be a pair with first_types as key_type without const or a
// different second_type.
key_type const& k = extractor::extract(*i);
std::size_t hash_value = this->hash_function()(k);
Modified: trunk/boost/unordered/unordered_map.hpp
==============================================================================
--- trunk/boost/unordered/unordered_map.hpp (original)
+++ trunk/boost/unordered/unordered_map.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -291,7 +291,8 @@
table_.emplace(v));
}
- iterator emplace_hint(const_iterator, value_type const& v = value_type())
+ iterator emplace_hint(const_iterator,
+ value_type const& v = value_type())
{
return iterator(table_.emplace(v).first);
}
Modified: trunk/libs/functional/hash/test/config.hpp
==============================================================================
--- trunk/libs/functional/hash/test/config.hpp (original)
+++ trunk/libs/functional/hash/test/config.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -16,5 +16,6 @@
#if defined(_WIN32_WCE)
// The standard windows mobile headers trigger this warning so I disable it
// before doing anything else.
-#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union
+#pragma warning(disable:4201) // nonstandard extension used :
+ // nameless struct/union
#endif
Modified: trunk/libs/functional/hash/test/container_fwd_test.cpp
==============================================================================
--- trunk/libs/functional/hash/test/container_fwd_test.cpp (original)
+++ trunk/libs/functional/hash/test/container_fwd_test.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -7,14 +7,17 @@
#include <boost/functional/detail/container_fwd.hpp>
-#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
+#if BOOST_WORKAROUND(__GNUC__, < 3) && \
+ !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
template <class charT, class Allocator>
-static void test(std::basic_string<charT, std::string_char_traits<charT>, Allocator> const&)
+static void test(
+ std::basic_string<charT, std::string_char_traits<charT>, Allocator> const&)
{
}
#else
template <class charT, class Allocator>
-static void test(std::basic_string<charT, std::char_traits<charT>, Allocator> const&)
+static void test(
+ std::basic_string<charT, std::char_traits<charT>, Allocator> const&)
{
}
#endif
Modified: trunk/libs/functional/hash/test/hash_complex_test.cpp
==============================================================================
--- trunk/libs/functional/hash/test/hash_complex_test.cpp (original)
+++ trunk/libs/functional/hash/test/hash_complex_test.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -20,13 +20,18 @@
#include <boost/detail/lightweight_test.hpp>
#if defined(BOOST_MSVC)
-#pragma warning(disable:4244) // conversion from 'unsigned long' to 'unsigned short', possible loss of data
-#pragma warning(disable:4245) // conversion from 'int' to 'const unsigned short', signed/unsigned mismatch
-#pragma warning(disable:4305) // truncation from 'double' to 'const std::complex<float>::_Ty'
-#pragma warning(disable:4309) // truncation of constant value
-#pragma warning(disable:4512) // assignment operator could not be generated
+#pragma warning(disable:4244) // conversion from 'unsigned long' to
+ // 'unsigned short', possible loss of data
+#pragma warning(disable:4245) // conversion from 'int' to
+ // 'const unsigned short',
+ // signed/unsigned mismatch
+#pragma warning(disable:4305) // truncation from 'double' to
+ // 'const std::complex<float>::_Ty'
+#pragma warning(disable:4309) // truncation of constant value
+#pragma warning(disable:4512) // assignment operator could not be generated
#if BOOST_MSVC < 1400
-#pragma warning(disable:4267) // conversion from 'size_t' to 'unsigned int', possible loss of data
+#pragma warning(disable:4267) // conversion from 'size_t' to 'unsigned int',
+ // possible loss of data
#endif
#endif
Modified: trunk/libs/functional/hash/test/hash_custom_test.cpp
==============================================================================
--- trunk/libs/functional/hash/test/hash_custom_test.cpp (original)
+++ trunk/libs/functional/hash/test/hash_custom_test.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -84,8 +84,8 @@
HASH_NAMESPACE::hash_combine(seed2, 250u);
HASH_NAMESPACE::hash_combine(seed2, 350u);
- BOOST_TEST(seed ==
- HASH_NAMESPACE::hash_range(custom_vector.begin(), custom_vector.end()));
+ BOOST_TEST(seed == HASH_NAMESPACE::hash_range(
+ custom_vector.begin(), custom_vector.end()));
BOOST_TEST(seed == seed2);
}
Modified: trunk/libs/functional/hash/test/hash_float_test.hpp
==============================================================================
--- trunk/libs/functional/hash/test/hash_float_test.hpp (original)
+++ trunk/libs/functional/hash/test/hash_float_test.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -22,10 +22,11 @@
#if defined(BOOST_MSVC)
#pragma warning(push)
-#pragma warning(disable:4127) // conditional expression is constant
-#pragma warning(disable:4723) // conditional expression is constant
+#pragma warning(disable:4127) // conditional expression is constant
+#pragma warning(disable:4723) // conditional expression is constant
#if BOOST_MSVC < 1400
-#pragma warning(disable:4267) // conversion from 'size_t' to 'unsigned int', possible loss of data
+#pragma warning(disable:4267) // conversion from 'size_t' to 'unsigned int',
+ // possible loss of data
#endif
#endif
@@ -36,23 +37,33 @@
template <class T>
void float_tests(char const* name, T* = 0)
{
- std::cerr<<"\n"
- <<"Testing " BOOST_STRINGIZE(HASH_NAMESPACE) "::hash<"<<name<<">\n"
- <<"\n"
- <<"boost::hash_detail::limits<T>::digits = "
- <<boost::hash_detail::limits<T>::digits<<"\n"
- <<"boost::hash_detail::limits<int>::digits = "
- <<boost::hash_detail::limits<int>::digits<<"\n"
- <<"boost::hash_detail::limits<std::size_t>::digits = "
- <<boost::hash_detail::limits<std::size_t>::digits<<"\n"
- <<"\n"
- <<"boost::hash_detail::call_ldexp<T>::float_type = "
- <<float_type((BOOST_DEDUCED_TYPENAME boost::hash_detail::call_ldexp<T>::float_type*)0)<<"\n"
- <<"boost::hash_detail::call_frexp<T>::float_type = "
- <<float_type((BOOST_DEDUCED_TYPENAME boost::hash_detail::call_frexp<T>::float_type*)0)<<"\n"
- <<"boost::hash_detail::select_hash_type<T>::type = "
- <<float_type((BOOST_DEDUCED_TYPENAME boost::hash_detail::select_hash_type<T>::type*)0)<<"\n"
- <<"\n"
+ std::cerr
+ << "\n"
+ << "Testing " BOOST_STRINGIZE(HASH_NAMESPACE) "::hash<"
+ << name
+ << ">\n"
+ << "\n"
+ << "boost::hash_detail::limits<T>::digits = "
+ << boost::hash_detail::limits<T>::digits<< "\n"
+ << "boost::hash_detail::limits<int>::digits = "
+ << boost::hash_detail::limits<int>::digits<< "\n"
+ << "boost::hash_detail::limits<std::size_t>::digits = "
+ << boost::hash_detail::limits<std::size_t>::digits
+ << "\n"
+ << "\n"
+ << "boost::hash_detail::call_ldexp<T>::float_type = "
+ << float_type(static_cast<BOOST_DEDUCED_TYPENAME
+ boost::hash_detail::call_ldexp<T>::float_type*>(0))
+ << "\n"
+ << "boost::hash_detail::call_frexp<T>::float_type = "
+ << float_type(static_cast<BOOST_DEDUCED_TYPENAME
+ boost::hash_detail::call_frexp<T>::float_type*>(0))
+ << "\n"
+ << "boost::hash_detail::select_hash_type<T>::type = "
+ << float_type(static_cast<BOOST_DEDUCED_TYPENAME
+ boost::hash_detail::select_hash_type<T>::type*>(0))
+ << "\n"
+ << "\n"
;
HASH_NAMESPACE::hash<T> x1;
@@ -72,7 +83,9 @@
// Doing anything with infinity causes borland to crash.
#if defined(__BORLANDC__)
- std::cerr<<"Not running infinity checks on Borland, as it causes it to crash.\n";
+ std::cerr
+ << "Not running infinity checks on Borland, as it causes it to crash."
+ "\n";
#else
if(boost::hash_detail::limits<T>::has_infinity) {
T infinity = -log(zero);
@@ -111,19 +124,40 @@
// This should really be 'has_denorm == denorm_present' but some
// compilers don't have 'denorm_present'. See also a later use.
if(boost::hash_detail::limits<T>::has_denorm) {
- if(x1(boost::hash_detail::limits<T>::denorm_min()) == x1(infinity)) {
- std::cerr<<"x1(denorm_min) == x1(infinity) == "<<x1(infinity)<<"\n";
+ if(x1(boost::hash_detail::limits<T>::denorm_min()) == x1(infinity))
+ {
+ std::cerr
+ << "x1(denorm_min) == x1(infinity) == "
+ << x1(infinity)
+ << "\n";
}
- if(x1(boost::hash_detail::limits<T>::denorm_min()) == x1(minus_infinity)) {
- std::cerr<<"x1(denorm_min) == x1(-infinity) == "<<x1(minus_infinity)<<"\n";
+
+ if(x1(boost::hash_detail::limits<T>::denorm_min()) ==
+ x1(minus_infinity))
+ {
+ std::cerr
+ << "x1(denorm_min) == x1(-infinity) == "
+ << x1(minus_infinity)
+ << "\n";
}
}
+
if(boost::hash_detail::limits<T>::has_quiet_NaN) {
- if(x1(boost::hash_detail::limits<T>::quiet_NaN()) == x1(infinity)) {
- std::cerr<<"x1(quiet_NaN) == x1(infinity) == "<<x1(infinity)<<"\n";
+ if(x1(boost::hash_detail::limits<T>::quiet_NaN()) == x1(infinity))
+ {
+ std::cerr
+ << "x1(quiet_NaN) == x1(infinity) == "
+ << x1(infinity)
+ << "\n";
}
- if(x1(boost::hash_detail::limits<T>::quiet_NaN()) == x1(minus_infinity)) {
- std::cerr<<"x1(quiet_NaN) == x1(-infinity) == "<<x1(minus_infinity)<<"\n";
+
+ if(x1(boost::hash_detail::limits<T>::quiet_NaN()) ==
+ x1(minus_infinity))
+ {
+ std::cerr
+ << "x1(quiet_NaN) == x1(-infinity) == "
+ << x1(minus_infinity)
+ << "\n";
}
}
}
@@ -146,10 +180,12 @@
BOOST_TEST(x1(max) == HASH_NAMESPACE::hash_value(max));
BOOST_TEST(x1(half_max) == HASH_NAMESPACE::hash_value(half_max));
BOOST_TEST(x1(quarter_max) == HASH_NAMESPACE::hash_value(quarter_max));
- BOOST_TEST(x1(three_quarter_max) == HASH_NAMESPACE::hash_value(three_quarter_max));
+ BOOST_TEST(x1(three_quarter_max) ==
+ HASH_NAMESPACE::hash_value(three_quarter_max));
#endif
- // The '!=' tests could legitimately fail, but with my hash it indicates a bug.
+ // The '!=' tests could legitimately fail, but with my hash it indicates a
+ // bug.
BOOST_TEST(x1(max) == x1(max));
BOOST_TEST(x1(max) != x1(quarter_max));
BOOST_TEST(x1(max) != x1(half_max));
@@ -179,7 +215,8 @@
#if defined(TEST_EXTENSIONS)
BOOST_TEST(x1(boost::hash_detail::limits<T>::epsilon()) ==
- HASH_NAMESPACE::hash_value(boost::hash_detail::limits<T>::epsilon()));
+ HASH_NAMESPACE::hash_value(
+ boost::hash_detail::limits<T>::epsilon()));
#endif
BOOST_TEST(boost::hash_detail::limits<T>::epsilon() != (T) 0);
@@ -216,14 +253,19 @@
// specialization of boost::hash_detail::limits::denorm_min() for long
// doubles which causes this test to fail.
if(x1(boost::hash_detail::limits<T>::denorm_min()) !=
- HASH_NAMESPACE::hash_value(boost::hash_detail::limits<T>::denorm_min()))
+ HASH_NAMESPACE::hash_value(
+ boost::hash_detail::limits<T>::denorm_min()))
{
- std::cerr<<"x1(boost::hash_detail::limits<T>::denorm_min()) = "
- << x1(boost::hash_detail::limits<T>::denorm_min())
- << "\nhash_value(boost::hash_detail::limits<T>::denorm_min()) = "
- << HASH_NAMESPACE::hash_value(
+ std::cerr
+ << "x1(boost::hash_detail::limits<T>::denorm_min()) = "
+ << x1(boost::hash_detail::limits<T>::denorm_min())
+ << "\nhash_value(boost::hash_detail::limits<T>::denorm_min())"
+ " = "
+ << HASH_NAMESPACE::hash_value(
boost::hash_detail::limits<T>::denorm_min())
- << "\nx1(0) = "<<x1(0)<<"\n";
+ << "\nx1(0) = "
+ << x1(0)
+ << "\n";
}
#endif
}
@@ -235,7 +277,8 @@
std::cerr<<"x1(quiet_NaN) == x1(1.0) == "<<x1(1.0)<<"\n";
}
BOOST_TEST(x1(boost::hash_detail::limits<T>::quiet_NaN()) ==
- HASH_NAMESPACE::hash_value(boost::hash_detail::limits<T>::quiet_NaN()));
+ HASH_NAMESPACE::hash_value(
+ boost::hash_detail::limits<T>::quiet_NaN()));
}
#endif
}
Modified: trunk/libs/functional/hash/test/hash_friend_test.cpp
==============================================================================
--- trunk/libs/functional/hash/test/hash_friend_test.cpp (original)
+++ trunk/libs/functional/hash/test/hash_friend_test.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -87,8 +87,8 @@
HASH_NAMESPACE::hash_combine(seed2, 250u);
HASH_NAMESPACE::hash_combine(seed2, 350u);
- BOOST_TEST(seed ==
- HASH_NAMESPACE::hash_range(custom_vector.begin(), custom_vector.end()));
+ BOOST_TEST(seed == HASH_NAMESPACE::hash_range(
+ custom_vector.begin(), custom_vector.end()));
BOOST_TEST(seed == seed2);
}
Modified: trunk/libs/functional/hash/test/hash_fwd_test.hpp
==============================================================================
--- trunk/libs/functional/hash/test/hash_fwd_test.hpp (original)
+++ trunk/libs/functional/hash/test/hash_fwd_test.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -60,7 +60,8 @@
template <class T>
std::size_t hash_value(test_type3<T> const& x)
{
- std::size_t seed = HASH_NAMESPACE::hash_range(x.values.begin(), x.values.end());
+ std::size_t seed =
+ HASH_NAMESPACE::hash_range(x.values.begin(), x.values.end());
HASH_NAMESPACE::hash_range(seed, x.values.begin(), x.values.end());
return seed;
}
@@ -91,7 +92,8 @@
template <class T>
std::size_t hash_value(test::test_type3<T> const& x)
{
- std::size_t seed = HASH_NAMESPACE::hash_range(x.values.begin(), x.values.end());
+ std::size_t seed =
+ HASH_NAMESPACE::hash_range(x.values.begin(), x.values.end());
HASH_NAMESPACE::hash_range(seed, x.values.begin(), x.values.end());
return seed;
}
Modified: trunk/libs/functional/hash/test/hash_fwd_test_1.cpp
==============================================================================
--- trunk/libs/functional/hash/test/hash_fwd_test_1.cpp (original)
+++ trunk/libs/functional/hash/test/hash_fwd_test_1.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -68,10 +68,12 @@
test::test_type3<int> x(values1.begin(), values1.end());
test::test_type3<std::string> y(values2.begin(), values2.end());
- std::size_t seed1 = HASH_NAMESPACE::hash_range(values1.begin(), values1.end());
+ std::size_t seed1 =
+ HASH_NAMESPACE::hash_range(values1.begin(), values1.end());
HASH_NAMESPACE::hash_range(seed1, values1.begin(), values1.end());
- std::size_t seed2 = HASH_NAMESPACE::hash_range(values2.begin(), values2.end());
+ std::size_t seed2 =
+ HASH_NAMESPACE::hash_range(values2.begin(), values2.end());
HASH_NAMESPACE::hash_range(seed2, values2.begin(), values2.end());
HASH_NAMESPACE::hash<test::test_type3<int> > hasher_test_int;
@@ -92,4 +94,3 @@
#endif
return boost::report_errors();
}
-
Modified: trunk/libs/functional/hash/test/hash_global_namespace_test.cpp
==============================================================================
--- trunk/libs/functional/hash/test/hash_global_namespace_test.cpp (original)
+++ trunk/libs/functional/hash/test/hash_global_namespace_test.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -85,8 +85,8 @@
HASH_NAMESPACE::hash_combine(seed2, 250u);
HASH_NAMESPACE::hash_combine(seed2, 350u);
- BOOST_TEST(seed ==
- HASH_NAMESPACE::hash_range(custom_vector.begin(), custom_vector.end()));
+ BOOST_TEST(seed == HASH_NAMESPACE::hash_range(
+ custom_vector.begin(), custom_vector.end()));
BOOST_TEST(seed == seed2);
}
Modified: trunk/libs/functional/hash/test/hash_number_test.cpp
==============================================================================
--- trunk/libs/functional/hash/test/hash_number_test.cpp (original)
+++ trunk/libs/functional/hash/test/hash_number_test.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -55,8 +55,11 @@
if (limits::is_integer)
{
- if(limits::is_signed || limits::digits <= boost::hash_detail::limits<std::size_t>::digits)
+ if(limits::is_signed ||
+ limits::digits <= boost::hash_detail::limits<std::size_t>::digits)
+ {
BOOST_TEST(HASH_NAMESPACE::hash_value(T(-5)) == (std::size_t)T(-5));
+ }
BOOST_TEST(HASH_NAMESPACE::hash_value(T(0)) == (std::size_t)T(0u));
BOOST_TEST(HASH_NAMESPACE::hash_value(T(10)) == (std::size_t)T(10u));
BOOST_TEST(HASH_NAMESPACE::hash_value(T(25)) == (std::size_t)T(25u));
Modified: trunk/libs/functional/hash/test/hash_range_test.cpp
==============================================================================
--- trunk/libs/functional/hash/test/hash_range_test.cpp (original)
+++ trunk/libs/functional/hash/test/hash_range_test.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -70,10 +70,12 @@
BOOST_TEST(HASH_NAMESPACE::hash_range(values3.begin(), values3.end())
== HASH_NAMESPACE::hash_range(x.begin(), x.end()));
- std::size_t seed = HASH_NAMESPACE::hash_range(values3.begin(), values3.end());
+ std::size_t seed =
+ HASH_NAMESPACE::hash_range(values3.begin(), values3.end());
HASH_NAMESPACE::hash_range(seed, values4.begin(), values4.end());
HASH_NAMESPACE::hash_range(seed, x.begin(), x.end());
- BOOST_TEST(seed == HASH_NAMESPACE::hash_range(values5.begin(), values5.end()));
+ BOOST_TEST(seed ==
+ HASH_NAMESPACE::hash_range(values5.begin(), values5.end()));
}
int main()
Modified: trunk/libs/unordered/examples/fnv1.hpp
==============================================================================
--- trunk/libs/unordered/examples/fnv1.hpp (original)
+++ trunk/libs/unordered/examples/fnv1.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -55,11 +55,14 @@
// For 128 bit machines:
// const std::size_t fnv_prime = 309485009821345068724781401u;
- // const std::size_t fnv_offset_basis = 275519064689413815358837431229664493455u;
+ // const std::size_t fnv_offset_basis =
+ // 275519064689413815358837431229664493455u;
// For 256 bit machines:
- // const std::size_t fnv_prime = 374144419156711147060143317175368453031918731002211u;
- // const std::size_t fnv_offset_basis = 100029257958052580907070968620625704837092796014241193945225284501741471925557u;
+ // const std::size_t fnv_prime =
+ // 374144419156711147060143317175368453031918731002211u;
+ // const std::size_t fnv_offset_basis =
+ // 100029257958052580907070968620625704837092796014241193945225284501741471925557u;
typedef basic_fnv_1<fnv_prime, fnv_offset_basis> fnv_1;
typedef basic_fnv_1a<fnv_prime, fnv_offset_basis> fnv_1a;
Modified: trunk/libs/unordered/test/exception/assign_exception_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/exception/assign_exception_tests.cpp (original)
+++ trunk/libs/unordered/test/exception/assign_exception_tests.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -47,10 +47,14 @@
typedef BOOST_DEDUCED_TYPENAME T::key_equal key_equal;
typedef BOOST_DEDUCED_TYPENAME T::allocator_type allocator_type;
- assign_base(unsigned int count1, unsigned int count2, int tag1, int tag2)
- : x_values(count1), y_values(count2),
- x(x_values.begin(), x_values.end(), 0, hasher(tag1), key_equal(tag1), allocator_type(tag1)),
- y(y_values.begin(), y_values.end(), 0, hasher(tag2), key_equal(tag2), allocator_type(tag2)) {}
+ assign_base(unsigned int count1, unsigned int count2, int tag1, int tag2) :
+ x_values(count1),
+ y_values(count2),
+ x(x_values.begin(), x_values.end(), 0, hasher(tag1), key_equal(tag1),
+ allocator_type(tag1)),
+ y(y_values.begin(), y_values.end(), 0, hasher(tag2), key_equal(tag2),
+ allocator_type(tag2))
+ {}
typedef T data_type;
T init() const { return T(x); }
Modified: trunk/libs/unordered/test/exception/constructor_exception_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/exception/constructor_exception_tests.cpp (original)
+++ trunk/libs/unordered/test/exception/constructor_exception_tests.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -116,7 +116,8 @@
range_construct_test5() : range<T>(60) {}
void run() const {
- T x(this->values.begin(), this->values.end(), 0, hash, equal_to, allocator);
+ T x(this->values.begin(), this->values.end(), 0,
+ hash, equal_to, allocator);
}
};
@@ -134,7 +135,16 @@
};
RUN_EXCEPTION_TESTS(
- (construct_test1)(construct_test2)(construct_test3)(construct_test4)(construct_test5)(construct_test6)
- (range_construct_test1)(range_construct_test2)(range_construct_test3)(range_construct_test4)(range_construct_test5)
+ (construct_test1)
+ (construct_test2)
+ (construct_test3)
+ (construct_test4)
+ (construct_test5)
+ (construct_test6)
+ (range_construct_test1)
+ (range_construct_test2)
+ (range_construct_test3)
+ (range_construct_test4)
+ (range_construct_test5)
(input_range_construct_test),
CONTAINER_SEQ)
Modified: trunk/libs/unordered/test/exception/erase_exception_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/exception/erase_exception_tests.cpp (original)
+++ trunk/libs/unordered/test/exception/erase_exception_tests.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -40,7 +40,8 @@
{
void run(T& x) const
{
- typedef BOOST_DEDUCED_TYPENAME test::random_values<T>::const_iterator iterator;
+ typedef BOOST_DEDUCED_TYPENAME
+ test::random_values<T>::const_iterator iterator;
for(iterator it = this->values.begin(), end = this->values.end();
it != end; ++it)
Modified: trunk/libs/unordered/test/exception/insert_exception_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/exception/insert_exception_tests.cpp (original)
+++ trunk/libs/unordered/test/exception/insert_exception_tests.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -28,7 +28,9 @@
return T();
}
- void check BOOST_PREVENT_MACRO_SUBSTITUTION(T const& x, strong_type const& strong) const {
+ void check BOOST_PREVENT_MACRO_SUBSTITUTION(
+ T const& x, strong_type const& strong) const
+ {
std::string scope(test::scope);
if(scope.find("hash::operator()") == std::string::npos)
@@ -46,7 +48,8 @@
void run(T& x, strong_type& strong) const {
for(BOOST_DEDUCED_TYPENAME test::random_values<T>::const_iterator
- it = this->values.begin(), end = this->values.end(); it != end; ++it)
+ it = this->values.begin(), end = this->values.end();
+ it != end; ++it)
{
strong.store(x, test::exception::detail::tracker.count_allocations);
x.emplace(*it);
@@ -63,7 +66,8 @@
void run(T& x, strong_type& strong) const {
for(BOOST_DEDUCED_TYPENAME test::random_values<T>::const_iterator
- it = this->values.begin(), end = this->values.end(); it != end; ++it)
+ it = this->values.begin(), end = this->values.end();
+ it != end; ++it)
{
strong.store(x, test::exception::detail::tracker.count_allocations);
x.insert(*it);
@@ -78,7 +82,8 @@
void run(T& x, strong_type& strong) const {
for(BOOST_DEDUCED_TYPENAME test::random_values<T>::const_iterator
- it = this->values.begin(), end = this->values.end(); it != end; ++it)
+ it = this->values.begin(), end = this->values.end();
+ it != end; ++it)
{
strong.store(x, test::exception::detail::tracker.count_allocations);
x.insert(x.begin(), *it);
@@ -105,7 +110,8 @@
void run(T& x, strong_type& strong) const {
for(BOOST_DEDUCED_TYPENAME test::random_values<T>::const_iterator
- it = this->values.begin(), end = this->values.end(); it != end; ++it)
+ it = this->values.begin(), end = this->values.end();
+ it != end; ++it)
{
strong.store(x, test::exception::detail::tracker.count_allocations);
x.insert(it, boost::next(it));
@@ -142,7 +148,8 @@
BOOST_DEDUCED_TYPENAME T::const_iterator pos = x.cbegin();
for(BOOST_DEDUCED_TYPENAME test::random_values<T>::const_iterator
- it = boost::next(this->values.begin(), x.size()), end = this->values.end();
+ it = boost::next(this->values.begin(), x.size()),
+ end = this->values.end();
it != end && count < 10; ++it, ++count)
{
strong.store(x, test::exception::detail::tracker.count_allocations);
@@ -165,7 +172,8 @@
int count = 0;
for(BOOST_DEDUCED_TYPENAME test::random_values<T>::const_iterator
- it = boost::next(this->values.begin(), x.size()), end = this->values.end();
+ it = boost::next(this->values.begin(), x.size()),
+ end = this->values.end();
it != end && count < 10; ++it, ++count)
{
strong.store(x, test::exception::detail::tracker.count_allocations);
@@ -181,7 +189,8 @@
template <class T>
struct insert_test_rehash3 : public insert_test_base<T>
{
- BOOST_DEDUCED_TYPENAME T::size_type mutable rehash_bucket_count, original_bucket_count;
+ BOOST_DEDUCED_TYPENAME T::size_type mutable
+ rehash_bucket_count, original_bucket_count;
insert_test_rehash3() : insert_test_base<T>(1000) {}
@@ -196,7 +205,8 @@
rehash_bucket_count = static_cast<size_type>(
ceil(original_bucket_count * (double) x.max_load_factor())) - 1;
- size_type initial_elements = rehash_bucket_count > 5 ? rehash_bucket_count - 5 : 1;
+ size_type initial_elements =
+ rehash_bucket_count > 5 ? rehash_bucket_count - 5 : 1;
BOOST_TEST(initial_elements < this->values.size());
x.insert(this->values.begin(),
Modified: trunk/libs/unordered/test/exception/rehash_exception_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/exception/rehash_exception_tests.cpp (original)
+++ trunk/libs/unordered/test/exception/rehash_exception_tests.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -20,7 +20,9 @@
{
test::random_values<T> values;
unsigned int n;
- rehash_test_base(unsigned int count = 100, unsigned int n = 0) : values(count), n(n) {}
+ rehash_test_base(unsigned int count = 100, unsigned int n = 0)
+ : values(count), n(n)
+ {}
typedef T data_type;
typedef test::strong<T> strong_type;
Modified: trunk/libs/unordered/test/helpers/count.hpp
==============================================================================
--- trunk/libs/unordered/test/helpers/count.hpp (original)
+++ trunk/libs/unordered/test/helpers/count.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -39,8 +39,15 @@
return !(*this == x);
}
- friend std::ostream& operator<<(std::ostream& out, object_count const& c) {
- out<<"[instances: "<<c.instances<<", constructions: "<<c.constructions<<"]";
+ friend std::ostream& operator<<(std::ostream& out,
+ object_count const& c)
+ {
+ out
+ << "[instances: "
+ << c.instances
+ << ", constructions: "
+ << c.constructions
+ << "]";
return out;
}
};
Modified: trunk/libs/unordered/test/helpers/equivalent.hpp
==============================================================================
--- trunk/libs/unordered/test/helpers/equivalent.hpp (original)
+++ trunk/libs/unordered/test/helpers/equivalent.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -21,12 +21,16 @@
}
template <class T>
- bool equivalent_impl(boost::hash<T> const&, boost::hash<T> const&, derived_type) {
+ bool equivalent_impl(boost::hash<T> const&, boost::hash<T> const&,
+ derived_type)
+ {
return true;
}
template <class T>
- bool equivalent_impl(std::equal_to<T> const&, std::equal_to<T> const&, derived_type) {
+ bool equivalent_impl(std::equal_to<T> const&, std::equal_to<T> const&,
+ derived_type)
+ {
return true;
}
Modified: trunk/libs/unordered/test/helpers/exception_test.hpp
==============================================================================
--- trunk/libs/unordered/test/helpers/exception_test.hpp (original)
+++ trunk/libs/unordered/test/helpers/exception_test.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -12,44 +12,50 @@
#include <boost/preprocessor/seq/elem.hpp>
#include <boost/preprocessor/cat.hpp>
-# define UNORDERED_EXCEPTION_TEST_CASE(name, test_func, type) \
- UNORDERED_AUTO_TEST(name) \
- { \
- test_func< type > fixture; \
- ::test::lightweight::exception_safety(fixture, BOOST_STRINGIZE(test_func<type>)); \
- }
+# define UNORDERED_EXCEPTION_TEST_CASE(name, test_func, type) \
+ UNORDERED_AUTO_TEST(name) \
+ { \
+ test_func< type > fixture; \
+ ::test::lightweight::exception_safety( \
+ fixture, BOOST_STRINGIZE(test_func<type>)); \
+ } \
+
# define UNORDERED_EPOINT_IMPL ::test::lightweight::epoint
#define UNORDERED_EXCEPTION_TEST_POSTFIX RUN_TESTS()
-#define RUN_EXCEPTION_TESTS(test_seq, param_seq) \
- BOOST_PP_SEQ_FOR_EACH_PRODUCT(RUN_EXCEPTION_TESTS_OP, (test_seq)(param_seq)) \
- RUN_TESTS()
-
-#define RUN_EXCEPTION_TESTS_OP(r, product) \
- UNORDERED_EXCEPTION_TEST_CASE( \
- BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, product), \
- BOOST_PP_CAT(_, BOOST_PP_SEQ_ELEM(1, product)) \
- ), \
- BOOST_PP_SEQ_ELEM(0, product), \
- BOOST_PP_SEQ_ELEM(1, product) \
- )
-
-#define UNORDERED_SCOPE(scope_name) \
- for(::test::scope_guard unordered_test_guard( \
- BOOST_STRINGIZE(scope_name)); \
- !unordered_test_guard.dismissed(); \
- unordered_test_guard.dismiss())
-
-#define UNORDERED_EPOINT(name) \
- if(::test::exceptions_enabled) { \
- UNORDERED_EPOINT_IMPL(name); \
- }
-
-#define ENABLE_EXCEPTIONS \
- ::test::exceptions_enable BOOST_PP_CAT(ENABLE_EXCEPTIONS_, __LINE__)(true)
-#define DISABLE_EXCEPTIONS \
- ::test::exceptions_enable BOOST_PP_CAT(ENABLE_EXCEPTIONS_, __LINE__)(false)
+#define RUN_EXCEPTION_TESTS(test_seq, param_seq) \
+ BOOST_PP_SEQ_FOR_EACH_PRODUCT(RUN_EXCEPTION_TESTS_OP, \
+ (test_seq)(param_seq)) \
+ RUN_TESTS() \
+
+#define RUN_EXCEPTION_TESTS_OP(r, product) \
+ UNORDERED_EXCEPTION_TEST_CASE( \
+ BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, product), \
+ BOOST_PP_CAT(_, BOOST_PP_SEQ_ELEM(1, product)) \
+ ), \
+ BOOST_PP_SEQ_ELEM(0, product), \
+ BOOST_PP_SEQ_ELEM(1, product) \
+ ) \
+
+#define UNORDERED_SCOPE(scope_name) \
+ for(::test::scope_guard unordered_test_guard( \
+ BOOST_STRINGIZE(scope_name)); \
+ !unordered_test_guard.dismissed(); \
+ unordered_test_guard.dismiss()) \
+
+#define UNORDERED_EPOINT(name) \
+ if(::test::exceptions_enabled) { \
+ UNORDERED_EPOINT_IMPL(name); \
+ } \
+
+#define ENABLE_EXCEPTIONS \
+ ::test::exceptions_enable BOOST_PP_CAT( \
+ ENABLE_EXCEPTIONS_, __LINE__)(true) \
+
+#define DISABLE_EXCEPTIONS \
+ ::test::exceptions_enable BOOST_PP_CAT( \
+ ENABLE_EXCEPTIONS_, __LINE__)(false) \
namespace test {
static char const* scope = "";
@@ -114,21 +120,24 @@
};
template <class T, class P1, class P2, class T2>
- inline void call_ignore_extra_parameters(void (T::*fn)() const, T2 const& obj,
+ inline void call_ignore_extra_parameters(
+ void (T::*fn)() const, T2 const& obj,
P1&, P2&)
{
(obj.*fn)();
}
template <class T, class P1, class P2, class T2>
- inline void call_ignore_extra_parameters(void (T::*fn)(P1&) const, T2 const& obj,
+ inline void call_ignore_extra_parameters(
+ void (T::*fn)(P1&) const, T2 const& obj,
P1& p1, P2&)
{
(obj.*fn)(p1);
}
template <class T, class P1, class P2, class T2>
- inline void call_ignore_extra_parameters(void (T::*fn)(P1&, P2&) const, T2 const& obj,
+ inline void call_ignore_extra_parameters(
+ void (T::*fn)(P1&, P2&) const, T2 const& obj,
P1& p1, P2& p2)
{
(obj.*fn)(p1, p2);
@@ -156,11 +165,18 @@
strong.store(x);
try {
ENABLE_EXCEPTIONS;
- call_ignore_extra_parameters<Test, BOOST_DEDUCED_TYPENAME Test::data_type, BOOST_DEDUCED_TYPENAME Test::strong_type>(&Test::run, test_, x, strong);
+ call_ignore_extra_parameters<
+ Test,
+ BOOST_DEDUCED_TYPENAME Test::data_type,
+ BOOST_DEDUCED_TYPENAME Test::strong_type
+ >(&Test::run, test_, x, strong);
}
catch(...) {
- call_ignore_extra_parameters<Test, BOOST_DEDUCED_TYPENAME Test::data_type const, BOOST_DEDUCED_TYPENAME Test::strong_type const>(&Test::check, test_,
- constant(x), constant(strong));
+ call_ignore_extra_parameters<
+ Test,
+ BOOST_DEDUCED_TYPENAME Test::data_type const,
+ BOOST_DEDUCED_TYPENAME Test::strong_type const
+ >(&Test::check, test_, constant(x), constant(strong));
throw;
}
}
Modified: trunk/libs/unordered/test/helpers/helpers.hpp
==============================================================================
--- trunk/libs/unordered/test/helpers/helpers.hpp (original)
+++ trunk/libs/unordered/test/helpers/helpers.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -19,13 +19,15 @@
}
template <class T>
- static key_type const& get_key(std::pair<key_type, T> const& x, char = 0)
+ static key_type const& get_key(
+ std::pair<key_type, T> const& x, char = 0)
{
return x.first;
}
template <class T>
- static key_type const& get_key(std::pair<key_type const, T> const& x, unsigned char = 0)
+ static key_type const& get_key(std::pair<key_type const, T> const& x,
+ unsigned char = 0)
{
return x.first;
}
Modified: trunk/libs/unordered/test/helpers/invariants.hpp
==============================================================================
--- trunk/libs/unordered/test/helpers/invariants.hpp (original)
+++ trunk/libs/unordered/test/helpers/invariants.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -17,8 +17,9 @@
#if defined(BOOST_MSVC)
#pragma warning(push)
-#pragma warning(disable:4127) // conditional expression is constant
-#pragma warning(disable:4267) // conversion from 'size_t' to 'unsigned int', possible loss of data
+#pragma warning(disable:4127) // conditional expression is constant
+#pragma warning(disable:4267) // conversion from 'size_t' to 'unsigned int',
+ // possible loss of data
#endif
namespace test
@@ -30,9 +31,11 @@
typedef BOOST_DEDUCED_TYPENAME X::key_type key_type;
// Boost.Test was reporting memory leaks for std::set on g++-3.3.
// So I work around it by using malloc.
- std::set<key_type, std::less<key_type>, test::malloc_allocator<key_type> > found_;
+ std::set<key_type, std::less<key_type>,
+ test::malloc_allocator<key_type> > found_;
- BOOST_DEDUCED_TYPENAME X::const_iterator it = x1.begin(), end = x1.end();
+ BOOST_DEDUCED_TYPENAME X::const_iterator
+ it = x1.begin(), end = x1.end();
BOOST_DEDUCED_TYPENAME X::size_type size = 0;
while(it != end) {
// First test that the current key has not occured before, required
@@ -72,7 +75,8 @@
// // Check that the keys are in the correct bucket and are
// // adjacent in the bucket.
// BOOST_DEDUCED_TYPENAME X::size_type bucket = x1.bucket(key);
- // BOOST_DEDUCED_TYPENAME X::const_local_iterator lit = x1.begin(bucket), lend = x1.end(bucket);
+ // BOOST_DEDUCED_TYPENAME X::const_local_iterator
+ // lit = x1.begin(bucket), lend = x1.end(bucket);
// for(; lit != lend && !eq(get_key<X>(*lit), key); ++lit) continue;
// if(lit == lend)
// BOOST_ERROR("Unable to find element with a local_iterator");
@@ -82,7 +86,8 @@
// BOOST_ERROR("Element count doesn't match local_iterator.");
// for(; lit != lend; ++lit) {
// if(eq(get_key<X>(*lit), key)) {
- // BOOST_ERROR("Non-adjacent element with equivalent key in bucket.");
+ // BOOST_ERROR("Non-adjacent element with equivalent key "
+ // "in bucket.");
// break;
// }
// }
@@ -91,7 +96,8 @@
// Finally, check that size matches up.
if(x1.size() != size)
BOOST_ERROR("x1.size() doesn't match actual size.");
- float load_factor = static_cast<float>(size) / static_cast<float>(x1.bucket_count());
+ float load_factor =
+ static_cast<float>(size) / static_cast<float>(x1.bucket_count());
using namespace std;
if(fabs(x1.load_factor() - load_factor) > x1.load_factor() / 64)
BOOST_ERROR("x1.load_factor() doesn't match actual load_factor.");
Modified: trunk/libs/unordered/test/helpers/list.hpp
==============================================================================
--- trunk/libs/unordered/test/helpers/list.hpp (original)
+++ trunk/libs/unordered/test/helpers/list.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -126,12 +126,29 @@
T const& operator*() const { return ptr_->value_; }
T const* operator->() const { return &ptr_->value_; }
- list_const_iterator& operator++() {
- ptr_ = ptr_->next_; return *this; }
- list_const_iterator operator++(int) {
- list_const_iterator tmp = *this; ptr_ = ptr_->next_; return tmp; }
- bool operator==(const_iterator y) const { return ptr_ == y.ptr_; }
- bool operator!=(const_iterator y) const { return ptr_ != y.ptr_; }
+
+ list_const_iterator& operator++()
+ {
+ ptr_ = ptr_->next_;
+ return *this;
+ }
+
+ list_const_iterator operator++(int)
+ {
+ list_const_iterator tmp = *this;
+ ptr_ = ptr_->next_;
+ return tmp;
+ }
+
+ bool operator==(const_iterator y) const
+ {
+ return ptr_ == y.ptr_;
+ }
+
+ bool operator!=(const_iterator y) const
+ {
+ return ptr_ != y.ptr_;
+ }
};
}
Modified: trunk/libs/unordered/test/helpers/memory.hpp
==============================================================================
--- trunk/libs/unordered/test/helpers/memory.hpp (original)
+++ trunk/libs/unordered/test/helpers/memory.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -62,7 +62,8 @@
#if defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
template <>
struct allocator_memory_type_gen<int> {
- typedef std::map<memory_area, memory_track, memory_area_compare> type;
+ typedef std::map<memory_area, memory_track, memory_area_compare>
+ type;
};
#endif
@@ -73,7 +74,8 @@
std::pair<memory_area const, memory_track> >::type
allocator_type;
- typedef BOOST_DEDUCED_TYPENAME allocator_memory_type_gen<allocator_type>::type
+ typedef BOOST_DEDUCED_TYPENAME
+ allocator_memory_type_gen<allocator_type>::type
allocated_memory_type;
allocated_memory_type allocated_memory;
@@ -106,7 +108,8 @@
bool no_constructions_left = (count_constructions == 0);
bool allocated_memory_empty = allocated_memory.empty();
- // Clearing the data before the checks terminate the tests.
+ // Clearing the data before the checks terminate the
+ // tests.
count_allocations = 0;
count_constructions = 0;
allocated_memory.clear();
@@ -118,7 +121,8 @@
}
}
- void track_allocate(void *ptr, std::size_t n, std::size_t size, int tag)
+ void track_allocate(void *ptr, std::size_t n, std::size_t size,
+ int tag)
{
if(n == 0) {
BOOST_ERROR("Allocating 0 length array.");
@@ -132,10 +136,12 @@
}
}
- void track_deallocate(void* ptr, std::size_t n, std::size_t size, int tag)
+ void track_deallocate(void* ptr, std::size_t n, std::size_t size,
+ int tag)
{
- BOOST_DEDUCED_TYPENAME allocated_memory_type::iterator pos
- = allocated_memory.find(memory_area(ptr, (char*) ptr + n * size));
+ BOOST_DEDUCED_TYPENAME allocated_memory_type::iterator pos =
+ allocated_memory.find(
+ memory_area(ptr, (char*) ptr + n * size));
if(pos == allocated_memory.end()) {
BOOST_ERROR("Deallocating unknown pointer.");
} else {
@@ -148,12 +154,14 @@
if(count_allocations > 0) --count_allocations;
}
- void track_construct(void* /*ptr*/, std::size_t /*size*/, int /*tag*/)
+ void track_construct(void* /*ptr*/, std::size_t /*size*/,
+ int /*tag*/)
{
++count_constructions;
}
- void track_destroy(void* /*ptr*/, std::size_t /*size*/, int /*tag*/)
+ void track_destroy(void* /*ptr*/, std::size_t /*size*/,
+ int /*tag*/)
{
BOOST_TEST(count_constructions > 0);
if(count_constructions > 0) --count_constructions;
Modified: trunk/libs/unordered/test/helpers/prefix.hpp
==============================================================================
--- trunk/libs/unordered/test/helpers/prefix.hpp (original)
+++ trunk/libs/unordered/test/helpers/prefix.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -6,5 +6,6 @@
#if defined(_WIN32_WCE)
// The standard windows mobile headers trigger this warning so I disable it
// before doing anything else.
-#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union
+#pragma warning(disable:4201) // nonstandard extension used :
+ // nameless struct/union
#endif
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 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -71,7 +71,9 @@
type_ == generate_collisions ?
generate(int_ptr) % 10 : 1;
count; --count) {
- x.push_back(std::pair<key_type const, mapped_type>(key, generate(mapped_ptr)));
+ x.push_back(
+ std::pair<key_type const, mapped_type>(
+ key, generate(mapped_ptr)));
}
}
}
Modified: trunk/libs/unordered/test/helpers/test.hpp
==============================================================================
--- trunk/libs/unordered/test/helpers/test.hpp (original)
+++ trunk/libs/unordered/test/helpers/test.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -11,19 +11,20 @@
#include <boost/preprocessor/stringize.hpp>
#include <iostream>
-#define UNORDERED_AUTO_TEST(x) \
- struct BOOST_PP_CAT(x, _type) : public ::test::registered_test_base { \
- BOOST_PP_CAT(x, _type)() \
- : ::test::registered_test_base(BOOST_PP_STRINGIZE(x)) \
- { \
- ::test::test_list::add_test(this); \
- } \
- void run(); \
- }; \
- BOOST_PP_CAT(x, _type) x; \
- void BOOST_PP_CAT(x, _type)::run()
-#define RUN_TESTS() int main(int, char**) \
- { ::test::test_list::run_tests(); return boost::report_errors(); }
+#define UNORDERED_AUTO_TEST(x) \
+ struct BOOST_PP_CAT(x, _type) : public ::test::registered_test_base { \
+ BOOST_PP_CAT(x, _type)() \
+ : ::test::registered_test_base(BOOST_PP_STRINGIZE(x)) \
+ { \
+ ::test::test_list::add_test(this); \
+ } \
+ void run(); \
+ }; \
+ BOOST_PP_CAT(x, _type) x; \
+ void BOOST_PP_CAT(x, _type)::run() \
+
+#define RUN_TESTS() int main(int, char**) \
+ { ::test::test_list::run_tests(); return boost::report_errors(); } \
namespace test {
struct registered_test_base {
@@ -74,20 +75,22 @@
#include <boost/preprocessor/cat.hpp>
// Run test with every combination of the parameters (a sequence of sequences)
-#define UNORDERED_TEST(name, parameters) \
- BOOST_PP_SEQ_FOR_EACH_PRODUCT(UNORDERED_TEST_OP, ((name)) parameters)
+#define UNORDERED_TEST(name, parameters) \
+ BOOST_PP_SEQ_FOR_EACH_PRODUCT(UNORDERED_TEST_OP, ((name)) parameters) \
-#define UNORDERED_TEST_OP(r, product) \
- UNORDERED_TEST_OP2( \
- BOOST_PP_SEQ_HEAD(product), \
- BOOST_PP_SEQ_TAIL(product))
-
-#define UNORDERED_TEST_OP2(name, params) \
- UNORDERED_AUTO_TEST(BOOST_PP_SEQ_FOLD_LEFT(UNORDERED_TEST_OP_JOIN, name, params)) { \
- name BOOST_PP_SEQ_TO_TUPLE(params); \
- }
+#define UNORDERED_TEST_OP(r, product) \
+ UNORDERED_TEST_OP2( \
+ BOOST_PP_SEQ_HEAD(product), \
+ BOOST_PP_SEQ_TAIL(product)) \
+
+#define UNORDERED_TEST_OP2(name, params) \
+ UNORDERED_AUTO_TEST( \
+ BOOST_PP_SEQ_FOLD_LEFT(UNORDERED_TEST_OP_JOIN, name, params)) \
+ { \
+ name BOOST_PP_SEQ_TO_TUPLE(params); \
+ } \
-#define UNORDERED_TEST_OP_JOIN(s, state, elem) \
- BOOST_PP_CAT(state, BOOST_PP_CAT(_, elem))
+#define UNORDERED_TEST_OP_JOIN(s, state, elem) \
+ BOOST_PP_CAT(state, BOOST_PP_CAT(_, elem)) \
#endif
Modified: trunk/libs/unordered/test/helpers/tracker.hpp
==============================================================================
--- trunk/libs/unordered/test/helpers/tracker.hpp (original)
+++ trunk/libs/unordered/test/helpers/tracker.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -27,7 +27,8 @@
{
template <class X>
struct equals_to_compare2
- : public boost::mpl::identity<std::less<BOOST_DEDUCED_TYPENAME X::first_argument_type> >
+ : public boost::mpl::identity<
+ std::less<BOOST_DEDUCED_TYPENAME X::first_argument_type> >
{
};
@@ -62,37 +63,55 @@
values1.sort();
values2.sort();
BOOST_TEST(values1.size() == values2.size() &&
- test::equal(values1.begin(), values1.end(), values2.begin(), test::equivalent));
+ test::equal(values1.begin(), values1.end(),
+ values2.begin(), test::equivalent));
}
template <class X>
- struct ordered_set
- : public boost::mpl::if_<
+ struct ordered_set : public
+ boost::mpl::if_<
test::has_unique_keys<X>,
- std::set<BOOST_DEDUCED_TYPENAME X::value_type,
- BOOST_DEDUCED_TYPENAME equals_to_compare<BOOST_DEDUCED_TYPENAME X::key_equal>::type>,
- std::multiset<BOOST_DEDUCED_TYPENAME X::value_type,
- BOOST_DEDUCED_TYPENAME equals_to_compare<BOOST_DEDUCED_TYPENAME X::key_equal>::type>
- > {};
+ std::set<
+ BOOST_DEDUCED_TYPENAME X::value_type,
+ BOOST_DEDUCED_TYPENAME equals_to_compare<
+ BOOST_DEDUCED_TYPENAME X::key_equal
+ >::type
+ >,
+ std::multiset<
+ BOOST_DEDUCED_TYPENAME X::value_type,
+ BOOST_DEDUCED_TYPENAME equals_to_compare<
+ BOOST_DEDUCED_TYPENAME X::key_equal
+ >::type
+ >
+ > {};
template <class X>
- struct ordered_map
- : public boost::mpl::if_<
+ struct ordered_map : public
+ boost::mpl::if_<
test::has_unique_keys<X>,
- std::map<BOOST_DEDUCED_TYPENAME X::key_type, BOOST_DEDUCED_TYPENAME X::mapped_type,
- BOOST_DEDUCED_TYPENAME equals_to_compare<BOOST_DEDUCED_TYPENAME X::key_equal>::type>,
- std::multimap<BOOST_DEDUCED_TYPENAME X::key_type, BOOST_DEDUCED_TYPENAME X::mapped_type,
- BOOST_DEDUCED_TYPENAME equals_to_compare<BOOST_DEDUCED_TYPENAME X::key_equal>::type>
- > {};
+ std::map<
+ BOOST_DEDUCED_TYPENAME X::key_type,
+ BOOST_DEDUCED_TYPENAME X::mapped_type,
+ BOOST_DEDUCED_TYPENAME equals_to_compare<
+ BOOST_DEDUCED_TYPENAME X::key_equal
+ >::type
+ >,
+ std::multimap<
+ BOOST_DEDUCED_TYPENAME X::key_type,
+ BOOST_DEDUCED_TYPENAME X::mapped_type,
+ BOOST_DEDUCED_TYPENAME equals_to_compare<
+ BOOST_DEDUCED_TYPENAME X::key_equal
+ >::type
+ >
+ > {};
template <class X>
- struct ordered_base
- : public boost::mpl::eval_if<
+ struct ordered_base : public
+ boost::mpl::eval_if<
test::is_set<X>,
test::ordered_set<X>,
- test::ordered_map<X> >
- {
- };
+ test::ordered_map<X>
+ > {};
template <class X>
class ordered : public ordered_base<X>::type
@@ -114,7 +133,8 @@
compare_range(x, *this);
}
- void compare_key(X const& x, BOOST_DEDUCED_TYPENAME X::value_type const& val)
+ void compare_key(X const& x,
+ BOOST_DEDUCED_TYPENAME X::value_type const& val)
{
compare_pairs(
x.equal_range(get_key<X>(val)),
@@ -132,7 +152,8 @@
};
template <class Equals>
- BOOST_DEDUCED_TYPENAME equals_to_compare<Equals>::type create_compare(Equals const&)
+ BOOST_DEDUCED_TYPENAME
+ equals_to_compare<Equals>::type create_compare(Equals const&)
{
BOOST_DEDUCED_TYPENAME equals_to_compare<Equals>::type x;
return x;
Modified: trunk/libs/unordered/test/objects/minimal.hpp
==============================================================================
--- trunk/libs/unordered/test/objects/minimal.hpp (original)
+++ trunk/libs/unordered/test/objects/minimal.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -46,31 +46,61 @@
class copy_constructible_equality_comparable
{
public:
- static copy_constructible_equality_comparable create() { return copy_constructible_equality_comparable(); }
- copy_constructible_equality_comparable(copy_constructible_equality_comparable const&) {}
- ~copy_constructible_equality_comparable() {}
+ static copy_constructible_equality_comparable create() {
+ return copy_constructible_equality_comparable();
+ }
+
+ copy_constructible_equality_comparable(
+ copy_constructible_equality_comparable const&)
+ {
+ }
+
+ ~copy_constructible_equality_comparable()
+ {
+ }
+
private:
- copy_constructible_equality_comparable& operator=(copy_constructible_equality_comparable const&);
+ copy_constructible_equality_comparable& operator=(
+ copy_constructible_equality_comparable const&);
copy_constructible_equality_comparable() {}
};
- bool operator==(copy_constructible_equality_comparable, copy_constructible_equality_comparable) {
+ bool operator==(
+ copy_constructible_equality_comparable,
+ copy_constructible_equality_comparable)
+ {
return true;
}
- bool operator!=(copy_constructible_equality_comparable, copy_constructible_equality_comparable) {
+ bool operator!=(
+ copy_constructible_equality_comparable,
+ copy_constructible_equality_comparable)
+ {
return false;
}
class default_copy_constructible
{
public:
- static default_copy_constructible create() { return default_copy_constructible(); }
- default_copy_constructible() {}
- default_copy_constructible(default_copy_constructible const&) {}
- ~default_copy_constructible() {}
+ static default_copy_constructible create()
+ {
+ return default_copy_constructible();
+ }
+
+ default_copy_constructible()
+ {
+ }
+
+ default_copy_constructible(default_copy_constructible const&)
+ {
+ }
+
+ ~default_copy_constructible()
+ {
+ }
private:
- default_copy_constructible& operator=(default_copy_constructible const&);
+ default_copy_constructible& operator=(
+ default_copy_constructible const&);
};
class assignable
@@ -130,7 +160,8 @@
ptr& operator++() { ++ptr_; return *this; }
ptr operator++(int) { ptr tmp(*this); ++ptr_; return tmp; }
ptr operator+(std::ptrdiff_t s) const { return ptr<T>(ptr_ + s); }
- friend ptr operator+(std::ptrdiff_t s, ptr p) { return ptr<T>(s + p.ptr_); }
+ friend ptr operator+(std::ptrdiff_t s, ptr p)
+ { return ptr<T>(s + p.ptr_); }
T& operator[](std::ptrdiff_t s) const { return ptr_[s]; }
bool operator!() const { return !ptr_; }
@@ -169,8 +200,10 @@
T const* operator->() const { return ptr_; }
const_ptr& operator++() { ++ptr_; return *this; }
const_ptr operator++(int) { const_ptr tmp(*this); ++ptr_; return tmp; }
- const_ptr operator+(std::ptrdiff_t s) const { return const_ptr(ptr_ + s); }
- friend const_ptr operator+(std::ptrdiff_t s, const_ptr p) { return ptr<T>(s + p.ptr_); }
+ const_ptr operator+(std::ptrdiff_t s) const
+ { return const_ptr(ptr_ + s); }
+ friend const_ptr operator+(std::ptrdiff_t s, const_ptr p)
+ { return ptr<T>(s + p.ptr_); }
T const& operator[](int s) const { return ptr_[s]; }
bool operator!() const { return !ptr_; }
operator bool() const { return !!ptr_; }
@@ -272,7 +305,9 @@
namespace test {
namespace minimal {
#endif
- std::size_t hash_value(test::minimal::copy_constructible_equality_comparable) {
+ std::size_t hash_value(
+ test::minimal::copy_constructible_equality_comparable)
+ {
return 1;
}
#if !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
Modified: trunk/libs/unordered/test/objects/test.hpp
==============================================================================
--- trunk/libs/unordered/test/objects/test.hpp (original)
+++ trunk/libs/unordered/test/objects/test.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -190,13 +190,37 @@
template <class U> struct rebind { typedef allocator<U> other; };
- explicit allocator(int t = 0) : tag_(t) { detail::tracker.allocator_ref(); }
- template <class Y> allocator(allocator<Y> const& x) : tag_(x.tag_) { detail::tracker.allocator_ref(); }
- allocator(allocator const& x) : tag_(x.tag_) { detail::tracker.allocator_ref(); }
- ~allocator() { detail::tracker.allocator_unref(); }
+ explicit allocator(int t = 0) : tag_(t)
+ {
+ detail::tracker.allocator_ref();
+ }
+
+ template <class Y> allocator(allocator<Y> const& x)
+ : tag_(x.tag_)
+ {
+ detail::tracker.allocator_ref();
+ }
- pointer address(reference r) { return pointer(&r); }
- const_pointer address(const_reference r) { return const_pointer(&r); }
+ allocator(allocator const& x)
+ : tag_(x.tag_)
+ {
+ detail::tracker.allocator_ref();
+ }
+
+ ~allocator()
+ {
+ detail::tracker.allocator_unref();
+ }
+
+ pointer address(reference r)
+ {
+ return pointer(&r);
+ }
+
+ const_pointer address(const_reference r)
+ {
+ return const_pointer(&r);
+ }
pointer allocate(size_type n) {
pointer ptr(static_cast<T*>(::operator new(n * sizeof(T))));
@@ -250,7 +274,9 @@
};
template <class T>
- bool equivalent_impl(allocator<T> const& x, allocator<T> const& y, test::derived_type) {
+ bool equivalent_impl(allocator<T> const& x, allocator<T> const& y,
+ test::derived_type)
+ {
return x == y;
}
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 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -20,7 +20,8 @@
test::seed_t seed(96785);
template <class T>
-void assign_tests1(T*, test::random_generator generator = test::default_generator)
+void assign_tests1(T*,
+ test::random_generator generator = test::default_generator)
{
BOOST_DEDUCED_TYPENAME T::hasher hf;
BOOST_DEDUCED_TYPENAME T::key_equal eq;
@@ -54,7 +55,8 @@
}
template <class T>
-void assign_tests2(T*, test::random_generator generator = test::default_generator)
+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);
@@ -87,10 +89,18 @@
}
}
-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;
using test::default_generator;
using test::generate_collisions;
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 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -43,24 +43,40 @@
if(bucket < x.max_bucket_count()) {
// lit? lend?? I need a new naming scheme.
const_local_iterator lit = x.begin(bucket), lend = x.end(bucket);
- while(lit != lend && test::get_key<X>(*it) != test::get_key<X>(*lit)) ++lit;
+ while(lit != lend
+ && test::get_key<X>(*it) != test::get_key<X>(*lit))
+ {
+ ++lit;
+ }
BOOST_TEST(lit != lend);
}
}
for(size_type i = 0; i < x.bucket_count(); ++i) {
- BOOST_TEST(x.bucket_size(i) == (size_type) std::distance(x.begin(i), x.end(i)));
- BOOST_TEST(x.bucket_size(i) == (size_type) std::distance(x.cbegin(i), x.cend(i)));
+ BOOST_TEST(x.bucket_size(i) == static_cast<size_type>(
+ std::distance(x.begin(i), x.end(i))));
+ BOOST_TEST(x.bucket_size(i) == static_cast<size_type>(
+ std::distance(x.cbegin(i), x.cend(i))));
X const& x_ref = x;
- BOOST_TEST(x.bucket_size(i) == (size_type) std::distance(x_ref.begin(i), x_ref.end(i)));
- BOOST_TEST(x.bucket_size(i) == (size_type) std::distance(x_ref.cbegin(i), x_ref.cend(i)));
+ BOOST_TEST(x.bucket_size(i) == static_cast<size_type>(
+ std::distance(x_ref.begin(i), x_ref.end(i))));
+ BOOST_TEST(x.bucket_size(i) == static_cast<size_type>(
+ std::distance(x_ref.cbegin(i), x_ref.cend(i))));
}
}
-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;
UNORDERED_TEST(tests, ((test_set)(test_multiset)(test_map)(test_multimap)))
Modified: trunk/libs/unordered/test/unordered/compile_tests.hpp
==============================================================================
--- trunk/libs/unordered/test/unordered/compile_tests.hpp (original)
+++ trunk/libs/unordered/test/unordered/compile_tests.hpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -37,10 +37,15 @@
typedef BOOST_DEDUCED_TYPENAME X::difference_type difference_type;
typedef BOOST_DEDUCED_TYPENAME X::size_type size_type;
- typedef BOOST_DEDUCED_TYPENAME boost::iterator_value<iterator>::type iterator_value_type;
- typedef BOOST_DEDUCED_TYPENAME boost::iterator_value<const_iterator>::type const_iterator_value_type;
- typedef BOOST_DEDUCED_TYPENAME boost::iterator_difference<iterator>::type iterator_difference_type;
- typedef BOOST_DEDUCED_TYPENAME boost::iterator_difference<const_iterator>::type const_iterator_difference_type;
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::iterator_value<iterator>::type iterator_value_type;
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::iterator_value<const_iterator>::type const_iterator_value_type;
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::iterator_difference<iterator>::type iterator_difference_type;
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::iterator_difference<const_iterator>::type
+ const_iterator_difference_type;
typedef BOOST_DEDUCED_TYPENAME X::value_type value_type;
typedef BOOST_DEDUCED_TYPENAME X::reference reference;
@@ -149,7 +154,8 @@
{
typedef BOOST_DEDUCED_TYPENAME X::value_type value_type;
typedef BOOST_DEDUCED_TYPENAME X::key_type key_type;
- BOOST_MPL_ASSERT((boost::is_same<value_type, std::pair<key_type const, T> >));
+ BOOST_MPL_ASSERT((
+ boost::is_same<value_type, std::pair<key_type const, T> >));
r.insert(std::pair<Key const, T>(k, v));
@@ -212,25 +218,57 @@
typedef BOOST_DEDUCED_TYPENAME X::local_iterator local_iterator;
typedef BOOST_DEDUCED_TYPENAME X::const_local_iterator const_local_iterator;
- typedef BOOST_DEDUCED_TYPENAME boost::BOOST_ITERATOR_CATEGORY<iterator>::type iterator_category;
- typedef BOOST_DEDUCED_TYPENAME boost::iterator_difference<iterator>::type iterator_difference;
- typedef BOOST_DEDUCED_TYPENAME boost::iterator_pointer<iterator>::type iterator_pointer;
- typedef BOOST_DEDUCED_TYPENAME boost::iterator_reference<iterator>::type iterator_reference;
-
- typedef BOOST_DEDUCED_TYPENAME boost::BOOST_ITERATOR_CATEGORY<local_iterator>::type local_iterator_category;
- typedef BOOST_DEDUCED_TYPENAME boost::iterator_difference<local_iterator>::type local_iterator_difference;
- typedef BOOST_DEDUCED_TYPENAME boost::iterator_pointer<local_iterator>::type local_iterator_pointer;
- typedef BOOST_DEDUCED_TYPENAME boost::iterator_reference<local_iterator>::type local_iterator_reference;
-
- typedef BOOST_DEDUCED_TYPENAME boost::BOOST_ITERATOR_CATEGORY<const_iterator>::type const_iterator_category;
- typedef BOOST_DEDUCED_TYPENAME boost::iterator_difference<const_iterator>::type const_iterator_difference;
- typedef BOOST_DEDUCED_TYPENAME boost::iterator_pointer<const_iterator>::type const_iterator_pointer;
- typedef BOOST_DEDUCED_TYPENAME boost::iterator_reference<const_iterator>::type const_iterator_reference;
-
- typedef BOOST_DEDUCED_TYPENAME boost::BOOST_ITERATOR_CATEGORY<const_local_iterator>::type const_local_iterator_category;
- typedef BOOST_DEDUCED_TYPENAME boost::iterator_difference<const_local_iterator>::type const_local_iterator_difference;
- typedef BOOST_DEDUCED_TYPENAME boost::iterator_pointer<const_local_iterator>::type const_local_iterator_pointer;
- typedef BOOST_DEDUCED_TYPENAME boost::iterator_reference<const_local_iterator>::type const_local_iterator_reference;
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::BOOST_ITERATOR_CATEGORY<iterator>::type
+ iterator_category;
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::iterator_difference<iterator>::type
+ iterator_difference;
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::iterator_pointer<iterator>::type
+ iterator_pointer;
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::iterator_reference<iterator>::type
+ iterator_reference;
+
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::BOOST_ITERATOR_CATEGORY<local_iterator>::type
+ local_iterator_category;
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::iterator_difference<local_iterator>::type
+ local_iterator_difference;
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::iterator_pointer<local_iterator>::type
+ local_iterator_pointer;
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::iterator_reference<local_iterator>::type
+ local_iterator_reference;
+
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::BOOST_ITERATOR_CATEGORY<const_iterator>::type
+ const_iterator_category;
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::iterator_difference<const_iterator>::type
+ const_iterator_difference;
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::iterator_pointer<const_iterator>::type
+ const_iterator_pointer;
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::iterator_reference<const_iterator>::type
+ const_iterator_reference;
+
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::BOOST_ITERATOR_CATEGORY<const_local_iterator>::type
+ const_local_iterator_category;
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::iterator_difference<const_local_iterator>::type
+ const_local_iterator_difference;
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::iterator_pointer<const_local_iterator>::type
+ const_local_iterator_pointer;
+ typedef BOOST_DEDUCED_TYPENAME
+ boost::iterator_reference<const_local_iterator>::type
+ const_local_iterator_reference;
BOOST_MPL_ASSERT((boost::is_same<Key, key_type>));
boost::function_requires<boost::CopyConstructibleConcept<key_type> >();
@@ -243,16 +281,25 @@
test::check_return_type<bool>::convertible(eq(k, k));
boost::function_requires<boost::InputIteratorConcept<local_iterator> >();
- BOOST_MPL_ASSERT((boost::is_same<local_iterator_category, iterator_category>));
- BOOST_MPL_ASSERT((boost::is_same<local_iterator_difference, iterator_difference>));
- BOOST_MPL_ASSERT((boost::is_same<local_iterator_pointer, iterator_pointer>));
- BOOST_MPL_ASSERT((boost::is_same<local_iterator_reference, iterator_reference>));
-
- boost::function_requires<boost::InputIteratorConcept<const_local_iterator> >();
- BOOST_MPL_ASSERT((boost::is_same<const_local_iterator_category, const_iterator_category>));
- BOOST_MPL_ASSERT((boost::is_same<const_local_iterator_difference, const_iterator_difference>));
- BOOST_MPL_ASSERT((boost::is_same<const_local_iterator_pointer, const_iterator_pointer>));
- BOOST_MPL_ASSERT((boost::is_same<const_local_iterator_reference, const_iterator_reference>));
+ BOOST_MPL_ASSERT((boost::is_same<local_iterator_category,
+ iterator_category>));
+ BOOST_MPL_ASSERT((boost::is_same<local_iterator_difference,
+ iterator_difference>));
+ BOOST_MPL_ASSERT((boost::is_same<local_iterator_pointer,
+ iterator_pointer>));
+ BOOST_MPL_ASSERT((boost::is_same<local_iterator_reference,
+ iterator_reference>));
+
+ boost::function_requires<
+ boost::InputIteratorConcept<const_local_iterator> >();
+ BOOST_MPL_ASSERT((boost::is_same<const_local_iterator_category,
+ const_iterator_category>));
+ BOOST_MPL_ASSERT((boost::is_same<const_local_iterator_difference,
+ const_iterator_difference>));
+ BOOST_MPL_ASSERT((boost::is_same<const_local_iterator_pointer,
+ const_iterator_pointer>));
+ BOOST_MPL_ASSERT((boost::is_same<const_local_iterator_reference,
+ const_iterator_reference>));
X(10, hf, eq);
X a(10, hf, eq);
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 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -22,7 +22,8 @@
test::seed_t seed(356730);
template <class T>
-void constructor_tests1(T*, test::random_generator generator = test::default_generator)
+void constructor_tests1(T*,
+ test::random_generator generator = test::default_generator)
{
BOOST_DEDUCED_TYPENAME T::hasher hf;
BOOST_DEDUCED_TYPENAME T::key_equal eq;
@@ -152,7 +153,8 @@
}
template <class T>
-void constructor_tests2(T*, test::random_generator const& generator = test::default_generator)
+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);
@@ -247,10 +249,12 @@
test::random_values<T> v(100, generator);
BOOST_DEDUCED_TYPENAME test::random_values<T>::const_iterator
v_begin = v.begin(), v_end = v.end();
- T x(test::input_iterator(v_begin), test::input_iterator(v_end), 0, hf1, eq1);
+ T x(test::input_iterator(v_begin),
+ test::input_iterator(v_end), 0, hf1, eq1);
BOOST_DEDUCED_TYPENAME T::const_iterator
x_begin = x.begin(), x_end = x.end();
- T y(test::input_iterator(x_begin), test::input_iterator(x_end), 0, hf2, eq2);
+ T y(test::input_iterator(x_begin),
+ test::input_iterator(x_end), 0, hf2, eq2);
test::check_container(x, v);
test::check_container(y, x);
test::check_equivalent_keys(x);
@@ -325,11 +329,17 @@
}
template <class T>
-void map_constructor_test(T* = 0, test::random_generator const& generator = test::default_generator)
+void map_constructor_test(T* = 0,
+ test::random_generator const& generator = test::default_generator)
{
std::cerr<<"map_constructor_test\n";
- typedef test::list<std::pair<BOOST_DEDUCED_TYPENAME T::key_type, BOOST_DEDUCED_TYPENAME T::mapped_type> > list;
+ typedef test::list<
+ std::pair<
+ BOOST_DEDUCED_TYPENAME T::key_type,
+ BOOST_DEDUCED_TYPENAME T::mapped_type
+ >
+ > list;
test::random_values<T> v(1000, generator);
list l(v.begin(), v.end());
T x(l.begin(), l.end());
@@ -338,10 +348,18 @@
test::check_equivalent_keys(x);
}
-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;
using test::default_generator;
using test::generate_collisions;
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 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -20,7 +20,8 @@
{
template <class T>
-void copy_construct_tests1(T*, test::random_generator const& generator = test::default_generator)
+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;
@@ -65,7 +66,8 @@
}
template <class T>
-void copy_construct_tests2(T* ptr, test::random_generator const& generator = test::default_generator)
+void copy_construct_tests2(T* ptr,
+ test::random_generator const& generator = test::default_generator)
{
copy_construct_tests1(ptr);
@@ -119,10 +121,18 @@
}
}
-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;
using test::default_generator;
using test::generate_collisions;
Modified: trunk/libs/unordered/test/unordered/equality_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/equality_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/equality_tests.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -30,36 +30,39 @@
}
};
-#define UNORDERED_EQUALITY_SET_TEST(seq1, op, seq2) \
- { \
- boost::unordered_set<int, mod_compare, mod_compare> set1, set2; \
- BOOST_PP_SEQ_FOR_EACH(UNORDERED_SET_INSERT, set1, seq1) \
- BOOST_PP_SEQ_FOR_EACH(UNORDERED_SET_INSERT, set2, seq2) \
- BOOST_TEST(set1 op set2); \
- }
-
-#define UNORDERED_EQUALITY_MULTISET_TEST(seq1, op, seq2) \
- { \
- boost::unordered_multiset<int, mod_compare, mod_compare> set1, set2; \
- BOOST_PP_SEQ_FOR_EACH(UNORDERED_SET_INSERT, set1, seq1) \
- BOOST_PP_SEQ_FOR_EACH(UNORDERED_SET_INSERT, set2, seq2) \
- BOOST_TEST(set1 op set2); \
- }
-
-#define UNORDERED_EQUALITY_MAP_TEST(seq1, op, seq2) \
- { \
- boost::unordered_map<int, int, mod_compare, mod_compare> map1, map2; \
- BOOST_PP_SEQ_FOR_EACH(UNORDERED_MAP_INSERT, map1, seq1) \
- BOOST_PP_SEQ_FOR_EACH(UNORDERED_MAP_INSERT, map2, seq2) \
- BOOST_TEST(map1 op map2); \
- }
-
-#define UNORDERED_EQUALITY_MULTIMAP_TEST(seq1, op, seq2) \
- { \
- boost::unordered_multimap<int, int, mod_compare, mod_compare> map1, map2; \
- BOOST_PP_SEQ_FOR_EACH(UNORDERED_MAP_INSERT, map1, seq1) \
- BOOST_PP_SEQ_FOR_EACH(UNORDERED_MAP_INSERT, map2, seq2) \
- BOOST_TEST(map1 op map2); \
+#define UNORDERED_EQUALITY_SET_TEST(seq1, op, seq2) \
+ { \
+ boost::unordered_set<int, mod_compare, mod_compare> set1, set2; \
+ BOOST_PP_SEQ_FOR_EACH(UNORDERED_SET_INSERT, set1, seq1) \
+ BOOST_PP_SEQ_FOR_EACH(UNORDERED_SET_INSERT, set2, seq2) \
+ BOOST_TEST(set1 op set2); \
+ }
+
+#define UNORDERED_EQUALITY_MULTISET_TEST(seq1, op, seq2) \
+ { \
+ boost::unordered_multiset<int, mod_compare, mod_compare> \
+ set1, set2; \
+ BOOST_PP_SEQ_FOR_EACH(UNORDERED_SET_INSERT, set1, seq1) \
+ BOOST_PP_SEQ_FOR_EACH(UNORDERED_SET_INSERT, set2, seq2) \
+ BOOST_TEST(set1 op set2); \
+ }
+
+#define UNORDERED_EQUALITY_MAP_TEST(seq1, op, seq2) \
+ { \
+ boost::unordered_map<int, int, mod_compare, mod_compare> \
+ map1, map2; \
+ BOOST_PP_SEQ_FOR_EACH(UNORDERED_MAP_INSERT, map1, seq1) \
+ BOOST_PP_SEQ_FOR_EACH(UNORDERED_MAP_INSERT, map2, seq2) \
+ BOOST_TEST(map1 op map2); \
+ }
+
+#define UNORDERED_EQUALITY_MULTIMAP_TEST(seq1, op, seq2) \
+ { \
+ boost::unordered_multimap<int, int, mod_compare, mod_compare> \
+ map1, map2; \
+ BOOST_PP_SEQ_FOR_EACH(UNORDERED_MAP_INSERT, map1, seq1) \
+ BOOST_PP_SEQ_FOR_EACH(UNORDERED_MAP_INSERT, map2, seq2) \
+ BOOST_TEST(map1 op map2); \
}
#define UNORDERED_SET_INSERT(r, set, item) set.insert(item);
Modified: trunk/libs/unordered/test/unordered/equivalent_keys_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/equivalent_keys_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/equivalent_keys_tests.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -44,17 +44,20 @@
{986, 25, 986}
};
- test_equal_insertion<boost::unordered_set<int> >(values[0], values[0] + 1);
- test_equal_insertion<boost::unordered_set<int> >(values[1], values[1] + 2);
- test_equal_insertion<boost::unordered_set<int> >(values[2], values[2] + 2);
- test_equal_insertion<boost::unordered_set<int> >(values[3], values[3] + 2);
- test_equal_insertion<boost::unordered_set<int> >(values[4], values[4] + 3);
-
- test_equal_insertion<boost::unordered_multiset<int> >(values[0], values[0] + 1);
- test_equal_insertion<boost::unordered_multiset<int> >(values[1], values[1] + 2);
- test_equal_insertion<boost::unordered_multiset<int> >(values[2], values[2] + 2);
- test_equal_insertion<boost::unordered_multiset<int> >(values[3], values[3] + 2);
- test_equal_insertion<boost::unordered_multiset<int> >(values[4], values[4] + 3);
+ typedef boost::unordered_set<int> set;
+ typedef boost::unordered_multiset<int> multiset;
+
+ test_equal_insertion<set>(values[0], values[0] + 1);
+ test_equal_insertion<set>(values[1], values[1] + 2);
+ test_equal_insertion<set>(values[2], values[2] + 2);
+ test_equal_insertion<set>(values[3], values[3] + 2);
+ test_equal_insertion<set>(values[4], values[4] + 3);
+
+ test_equal_insertion<multiset>(values[0], values[0] + 1);
+ test_equal_insertion<multiset>(values[1], values[1] + 2);
+ test_equal_insertion<multiset>(values[2], values[2] + 2);
+ test_equal_insertion<multiset>(values[3], values[3] + 2);
+ test_equal_insertion<multiset>(values[4], values[4] + 3);
}
UNORDERED_AUTO_TEST(map_tests)
Modified: trunk/libs/unordered/test/unordered/erase_equiv_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/erase_equiv_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/erase_equiv_tests.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -135,7 +135,8 @@
void erase_subrange_tests(Container const& x)
{
for(std::size_t length = 0; length < x.size(); ++length) {
- for(std::size_t position = 0; position < x.size() - length; ++position) {
+ for(std::size_t position = 0; position < x.size() - length; ++position)
+ {
Container y(x);
collide_list init(y.begin(), y.end());
if(!general_erase_range_test(y, position, position + length)) {
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 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -23,14 +23,15 @@
test::seed_t seed(85638);
template <class Container>
-void erase_tests1(Container*, test::random_generator generator = test::default_generator)
+void erase_tests1(Container*,
+ test::random_generator generator = test::default_generator)
{
std::cerr<<"Erase by key.\n";
{
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)
+ for(BOOST_DEDUCED_TYPENAME test::random_values<Container>::iterator
+ it = v.begin(); it != v.end(); ++it)
{
std::size_t count = x.count(test::get_key<Container>(*it));
std::size_t old_size = x.size();
@@ -48,9 +49,11 @@
std::size_t size = x.size();
while(size > 0 && !x.empty())
{
- BOOST_DEDUCED_TYPENAME Container::key_type key = test::get_key<Container>(*x.begin());
+ BOOST_DEDUCED_TYPENAME Container::key_type
+ key = test::get_key<Container>(*x.begin());
std::size_t count = x.count(key);
- BOOST_DEDUCED_TYPENAME Container::iterator pos = x.erase(x.begin());
+ BOOST_DEDUCED_TYPENAME Container::iterator
+ pos = x.erase(x.begin());
--size;
BOOST_TEST(pos == x.begin());
BOOST_TEST(x.count(key) == count - 1);
@@ -77,7 +80,8 @@
pos = boost::next(prev);
}
next = boost::next(pos);
- BOOST_DEDUCED_TYPENAME Container::key_type key = test::get_key<Container>(*pos);
+ BOOST_DEDUCED_TYPENAME Container::key_type
+ key = test::get_key<Container>(*pos);
std::size_t count = x.count(key);
BOOST_TEST(next == x.erase(pos));
--size;
@@ -119,7 +123,8 @@
std::size_t size = x.size();
while(size > 0 && !x.empty())
{
- BOOST_DEDUCED_TYPENAME Container::key_type key = test::get_key<Container>(*x.begin());
+ BOOST_DEDUCED_TYPENAME Container::key_type
+ key = test::get_key<Container>(*x.begin());
std::size_t count = x.count(key);
x.erase_return_void(x.begin());
--size;
@@ -147,7 +152,8 @@
pos = boost::next(prev);
}
next = boost::next(pos);
- BOOST_DEDUCED_TYPENAME Container::key_type key = test::get_key<Container>(*pos);
+ BOOST_DEDUCED_TYPENAME Container::key_type
+ key = test::get_key<Container>(*pos);
std::size_t count = x.count(key);
x.erase_return_void(pos);
--size;
@@ -173,10 +179,18 @@
std::cerr<<"\n";
}
-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;
using test::default_generator;
using test::generate_collisions;
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 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -35,7 +35,8 @@
{
BOOST_DEDUCED_TYPENAME X::key_type key = test::get_key<X>(*it1);
iterator pos = x.find(key);
- BOOST_DEDUCED_TYPENAME X::const_iterator const_pos = x_const.find(key);
+ BOOST_DEDUCED_TYPENAME X::const_iterator
+ const_pos = x_const.find(key);
BOOST_TEST(pos != x.end() &&
x.key_eq()(key, test::get_key<X>(*pos)));
BOOST_TEST(const_pos != x_const.end() &&
@@ -109,10 +110,12 @@
};
template <class X>
-void find_compatible_keys_test(X*, test::random_generator generator = test::default_generator)
+void find_compatible_keys_test(X*,
+ test::random_generator generator = test::default_generator)
{
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
- typedef BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator value_iterator;
+ typedef BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator
+ value_iterator;
test::random_values<X> v(500, generator);
X x(v.begin(), v.end());
@@ -132,10 +135,18 @@
}
}
-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;
using test::default_generator;
using test::generate_collisions;
Modified: trunk/libs/unordered/test/unordered/fwd_set_test.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/fwd_set_test.cpp (original)
+++ trunk/libs/unordered/test/unordered/fwd_set_test.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -47,7 +47,8 @@
#include "../helpers/test.hpp"
UNORDERED_AUTO_TEST(use_fwd_declared_trait_without_definition) {
- BOOST_TEST(sizeof(is_unordered_set_impl((int_set*) 0)) == sizeof(true_type));
+ BOOST_TEST(sizeof(is_unordered_set_impl((int_set*) 0))
+ == sizeof(true_type));
}
#include <boost/unordered_set.hpp>
Modified: trunk/libs/unordered/test/unordered/incomplete_test.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/incomplete_test.cpp (original)
+++ trunk/libs/unordered/test/unordered/incomplete_test.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -25,10 +25,14 @@
// Declare some instances
- typedef boost::unordered_map<value, value, hash, equals, malloc_allocator<std::pair<value const, value> > > map;
- typedef boost::unordered_multimap<value, value, hash, equals, malloc_allocator<std::pair<value const, value> > > multimap;
- typedef boost::unordered_set<value, hash, equals, malloc_allocator<value> > set;
- typedef boost::unordered_multiset<value, hash, equals, malloc_allocator<value> > multiset;
+ typedef boost::unordered_map<value, value, hash, equals,
+ malloc_allocator<std::pair<value const, value> > > map;
+ typedef boost::unordered_multimap<value, value, hash, equals,
+ malloc_allocator<std::pair<value const, value> > > multimap;
+ typedef boost::unordered_set<value, hash, equals,
+ malloc_allocator<value> > set;
+ typedef boost::unordered_multiset<value, hash, equals,
+ malloc_allocator<value> > multiset;
// Now define the types which are stored as members, as they are needed for
// declaring struct members.
@@ -51,19 +55,24 @@
{
// Declare some members of a structs.
//
- // Incomplete hash, equals and allocator aren't here supported at the moment.
+ // Incomplete hash, equals and allocator aren't here supported at the
+ // moment.
struct struct1 {
- boost::unordered_map<struct1, struct1, hash, equals, malloc_allocator<std::pair<struct1 const, struct1> > > x;
+ boost::unordered_map<struct1, struct1, hash, equals,
+ malloc_allocator<std::pair<struct1 const, struct1> > > x;
};
struct struct2 {
- boost::unordered_multimap<struct2, struct2, hash, equals, malloc_allocator<std::pair<struct2 const, struct2> > > x;
+ boost::unordered_multimap<struct2, struct2, hash, equals,
+ malloc_allocator<std::pair<struct2 const, struct2> > > x;
};
struct struct3 {
- boost::unordered_set<struct3, hash, equals, malloc_allocator<struct3> > x;
+ boost::unordered_set<struct3, hash, equals,
+ malloc_allocator<struct3> > x;
};
struct struct4 {
- boost::unordered_multiset<struct4, hash, equals, malloc_allocator<struct4> > x;
+ boost::unordered_multiset<struct4, hash, equals,
+ malloc_allocator<struct4> > x;
};
// Now define the value type.
@@ -81,7 +90,9 @@
test::struct2 c2;
test::struct3 c3;
test::struct4 c4;
- // Now declare, but don't define, the operators required for comparing elements.
+
+ // Now declare, but don't define, the operators required for comparing
+ // elements.
std::size_t hash_value(value const&);
bool operator==(value const&, value const&);
Modified: trunk/libs/unordered/test/unordered/insert_stable_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/insert_stable_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/insert_stable_tests.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -48,7 +48,8 @@
x.insert(insert_stable::member(1,2));
x.insert(insert_stable::member(1,3));
- boost::unordered_multiset<insert_stable::member>::const_iterator it = x.begin(), end = x.end();
+ boost::unordered_multiset<insert_stable::member>::const_iterator
+ it = x.begin(), end = x.end();
BOOST_TEST(it != end);
if(it != end) { BOOST_TEST(it->tag2_ == 1); ++it; }
BOOST_TEST(it != end);
@@ -60,9 +61,12 @@
UNORDERED_AUTO_TEST(stable_insert_test2) {
boost::unordered_multimap<insert_stable::member, int> x;
- typedef boost::unordered_multimap<insert_stable::member, int>::const_iterator iterator;
+ typedef
+ boost::unordered_multimap<insert_stable::member, int>::const_iterator
+ iterator;
- iterator it = x.insert(x.end(), std::make_pair(insert_stable::member(1,1), 1));
+ iterator it
+ = x.insert(x.end(), std::make_pair(insert_stable::member(1,1), 1));
it = x.insert(it, std::make_pair(insert_stable::member(1,2), 2));
it = x.insert(it, std::make_pair(insert_stable::member(1,3), 3));
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 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -23,7 +23,8 @@
test::seed_t seed(243432);
template <class X>
-void unique_insert_tests1(X*, test::random_generator generator = test::default_generator)
+void unique_insert_tests1(X*,
+ test::random_generator generator = test::default_generator)
{
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
typedef test::ordered<X> ordered;
@@ -43,7 +44,8 @@
float b = x.max_load_factor();
std::pair<iterator, bool> r1 = x.insert(*it);
- std::pair<BOOST_DEDUCED_TYPENAME ordered::iterator, bool> r2 = tracker.insert(*it);
+ std::pair<BOOST_DEDUCED_TYPENAME ordered::iterator, bool>
+ r2 = tracker.insert(*it);
BOOST_TEST(r1.second == r2.second);
BOOST_TEST(*r1.first == *r2.first);
@@ -58,7 +60,8 @@
}
template <class X>
-void equivalent_insert_tests1(X*, test::random_generator generator = test::default_generator)
+void equivalent_insert_tests1(X*,
+ test::random_generator generator = test::default_generator)
{
std::cerr<<"insert(value) tests for containers with equivalent keys.\n";
@@ -73,7 +76,8 @@
float b = x.max_load_factor();
BOOST_DEDUCED_TYPENAME X::iterator r1 = x.insert(*it);
- BOOST_DEDUCED_TYPENAME test::ordered<X>::iterator r2 = tracker.insert(*it);
+ BOOST_DEDUCED_TYPENAME test::ordered<X>::iterator r2
+ = tracker.insert(*it);
BOOST_TEST(*r1 == *r2);
@@ -87,7 +91,8 @@
}
template <class X>
-void insert_tests2(X*, test::random_generator generator = test::default_generator)
+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;
@@ -101,10 +106,11 @@
tracker_type tracker = test::create_ordered(x);
test::random_values<X> v(1000, generator);
- for(BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin();
- it != v.end(); ++it)
+ for(BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator
+ it = v.begin(); it != v.end(); ++it)
{
- BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
+ BOOST_DEDUCED_TYPENAME X::size_type
+ old_bucket_count = x.bucket_count();
float b = x.max_load_factor();
iterator r1 = x.insert(x.begin(), *it);
@@ -127,10 +133,11 @@
tracker_type tracker = test::create_ordered(x);
test::random_values<X> v(100, generator);
- for(BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin();
- it != v.end(); ++it)
+ for(BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator
+ it = v.begin(); it != v.end(); ++it)
{
- BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
+ BOOST_DEDUCED_TYPENAME X::size_type
+ old_bucket_count = x.bucket_count();
float b = x.max_load_factor();
const_iterator r1 = x.insert(x_const.end(), *it);
@@ -153,10 +160,11 @@
tracker_type tracker = test::create_ordered(x);
test::random_values<X> v(1000, generator);
- for(BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin();
- it != v.end(); ++it)
+ for(BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator
+ it = v.begin(); it != v.end(); ++it)
{
- BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
+ BOOST_DEDUCED_TYPENAME X::size_type
+ old_bucket_count = x.bucket_count();
float b = x.max_load_factor();
pos = x.insert(pos, *it);
@@ -178,10 +186,11 @@
tracker_type tracker = test::create_ordered(x);
test::random_values<X> v(1000, generator);
- for(BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator it = v.begin();
- it != v.end(); ++it)
+ for(BOOST_DEDUCED_TYPENAME test::random_values<X>::iterator
+ it = v.begin(); it != v.end(); ++it)
{
- BOOST_DEDUCED_TYPENAME X::size_type old_bucket_count = x.bucket_count();
+ BOOST_DEDUCED_TYPENAME X::size_type
+ old_bucket_count = x.bucket_count();
float b = x.max_load_factor();
x.insert(it, boost::next(it));
@@ -225,7 +234,8 @@
#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
template <class X>
-void unique_emplace_tests1(X*, test::random_generator generator = test::default_generator)
+void unique_emplace_tests1(X*,
+ test::random_generator generator = test::default_generator)
{
typedef BOOST_DEDUCED_TYPENAME X::iterator iterator;
typedef test::ordered<X> ordered;
@@ -245,7 +255,8 @@
float b = x.max_load_factor();
std::pair<iterator, bool> r1 = x.emplace(*it);
- std::pair<BOOST_DEDUCED_TYPENAME ordered::iterator, bool> r2 = tracker.insert(*it);
+ std::pair<BOOST_DEDUCED_TYPENAME ordered::iterator, bool>
+ r2 = tracker.insert(*it);
BOOST_TEST(r1.second == r2.second);
BOOST_TEST(*r1.first == *r2.first);
@@ -260,7 +271,8 @@
}
template <class X>
-void equivalent_emplace_tests1(X*, test::random_generator generator = test::default_generator)
+void equivalent_emplace_tests1(X*,
+ test::random_generator generator = test::default_generator)
{
std::cerr<<"emplace(value) tests for containers with equivalent keys.\n";
@@ -275,7 +287,8 @@
float b = x.max_load_factor();
BOOST_DEDUCED_TYPENAME X::iterator r1 = x.emplace(*it);
- BOOST_DEDUCED_TYPENAME test::ordered<X>::iterator r2 = tracker.insert(*it);
+ BOOST_DEDUCED_TYPENAME test::ordered<X>::iterator
+ r2 = tracker.insert(*it);
BOOST_TEST(*r1 == *r2);
@@ -317,14 +330,21 @@
test::check_equivalent_keys(x);
}
-// Some tests for when the range's value type doesn't match the container's value type.
+// Some tests for when the range's value type doesn't match the container's
+// value type.
template <class X>
-void map_insert_range_test1(X*, test::random_generator generator = test::default_generator)
+void map_insert_range_test1(X*,
+ test::random_generator generator = test::default_generator)
{
std::cerr<<"map_insert_range_test1\n";
- typedef test::list<std::pair<BOOST_DEDUCED_TYPENAME X::key_type, BOOST_DEDUCED_TYPENAME X::mapped_type> > list;
+ typedef test::list<
+ std::pair<
+ BOOST_DEDUCED_TYPENAME X::key_type,
+ BOOST_DEDUCED_TYPENAME X::mapped_type
+ >
+ > list;
test::random_values<X> v(1000, generator);
list l(v.begin(), v.end());
@@ -334,12 +354,17 @@
}
template <class X>
-void map_insert_range_test2(X*, test::random_generator generator = test::default_generator)
+void map_insert_range_test2(X*,
+ test::random_generator generator = test::default_generator)
{
std::cerr<<"map_insert_range_test2\n";
- typedef test::list<std::pair<BOOST_DEDUCED_TYPENAME X::key_type const, int> > list;
- test::random_values<boost::unordered_map<BOOST_DEDUCED_TYPENAME X::key_type, int> > v(1000, generator);
+ typedef test::list<
+ std::pair<BOOST_DEDUCED_TYPENAME X::key_type const, int>
+ > list;
+ test::random_values<
+ boost::unordered_map<BOOST_DEDUCED_TYPENAME X::key_type, int>
+ > v(1000, generator);
list l(v.begin(), v.end());
X x; x.insert(l.begin(), l.end());
@@ -347,10 +372,18 @@
test::check_equivalent_keys(x);
}
-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;
using test::default_generator;
using test::generate_collisions;
Modified: trunk/libs/unordered/test/unordered/load_factor_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/load_factor_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/load_factor_tests.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -36,7 +36,8 @@
}
template <class X>
-void insert_test(X*, float mlf, test::random_generator generator = test::default_generator)
+void insert_test(X*, float mlf,
+ test::random_generator generator = test::default_generator)
{
X x;
x.max_load_factor(mlf);
Modified: trunk/libs/unordered/test/unordered/move_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/move_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/move_tests.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -46,7 +46,8 @@
}
template <class T>
- void move_construct_tests1(T* ptr, test::random_generator const& generator = test::default_generator)
+ void move_construct_tests1(T* ptr,
+ test::random_generator const& generator = test::default_generator)
{
BOOST_DEDUCED_TYPENAME T::hasher hf;
BOOST_DEDUCED_TYPENAME T::key_equal eq;
@@ -75,7 +76,8 @@
}
template <class T>
- void move_assign_tests1(T*, test::random_generator const& generator = test::default_generator)
+ void move_assign_tests1(T*,
+ test::random_generator const& generator = test::default_generator)
{
{
test::random_values<T> v(500, generator);
@@ -116,7 +118,8 @@
}
{
- // TODO: To do this correctly requires the fancy new allocator stuff.
+ // TODO: To do this correctly requires the fancy new allocator
+ // stuff.
test::random_values<T> v(500, generator);
T y(create(v, count, hf, eq, al, 2.0), al2);
BOOST_TEST(count != test::global_object_count);
@@ -134,7 +137,8 @@
#if defined(BOOST_HAS_RVALUE_REFS)
BOOST_TEST(count == test::global_object_count);
#else
- BOOST_TEST(test::global_object_count.constructions - count.constructions <=
+ BOOST_TEST(
+ test::global_object_count.constructions - count.constructions <=
(test::is_map<T>::value ? 50 : 25));
BOOST_TEST(count.instances == test::global_object_count.instances);
#endif
@@ -147,10 +151,18 @@
}
*/ }
- 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;
using test::default_generator;
using test::generate_collisions;
Modified: trunk/libs/unordered/test/unordered/rehash_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/rehash_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/rehash_tests.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -19,7 +19,8 @@
template <class X>
bool postcondition(X const& x, BOOST_DEDUCED_TYPENAME X::size_type n)
{
- return x.bucket_count() > x.size() / x.max_load_factor() && x.bucket_count() >= n;
+ return x.bucket_count() > x.size() / x.max_load_factor() &&
+ x.bucket_count() >= n;
}
template <class X>
@@ -35,7 +36,8 @@
}
template <class X>
-void rehash_empty_test2(X* = 0, test::random_generator generator = test::default_generator)
+void rehash_empty_test2(X* = 0,
+ test::random_generator generator = test::default_generator)
{
test::random_values<X> v(1000, generator);
test::ordered<X> tracker;
@@ -53,7 +55,8 @@
}
template <class X>
-void rehash_empty_test3(X* = 0, test::random_generator generator = test::default_generator)
+void rehash_empty_test3(X* = 0,
+ test::random_generator generator = test::default_generator)
{
test::random_values<X> v(1000, generator);
test::ordered<X> tracker;
@@ -72,7 +75,8 @@
template <class X>
-void rehash_test1(X* = 0, test::random_generator generator = test::default_generator)
+void rehash_test1(X* = 0,
+ test::random_generator generator = test::default_generator)
{
test::random_values<X> v(1000, generator);
test::ordered<X> tracker;
Modified: trunk/libs/unordered/test/unordered/simple_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/simple_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/simple_tests.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -72,7 +72,8 @@
{
BOOST_TEST(a.size() ==
- (BOOST_DEDUCED_TYPENAME X::size_type) std::distance(a.begin(), a.end()));
+ static_cast<BOOST_DEDUCED_TYPENAME X::size_type>(
+ std::distance(a.begin(), a.end())));
}
{
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 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -62,7 +62,8 @@
}
template <class X>
-void swap_tests2(X* ptr = 0, test::random_generator generator = test::default_generator)
+void swap_tests2(X* ptr = 0,
+ test::random_generator generator = test::default_generator)
{
swap_tests1(ptr);
@@ -98,7 +99,8 @@
X y(vy.begin(), vy.end(), 0, hasher(), key_equal(), allocator_type(2));
try {
swap_test_impl(x, y);
- BOOST_ERROR("Using swap method 1, swapping with unequal allocators didn't throw.");
+ BOOST_ERROR("Using swap method 1, "
+ "swapping with unequal allocators didn't throw.");
} catch (std::runtime_error) {}
}
#else
@@ -111,18 +113,28 @@
{
test::random_values<X> vx(100, generator), vy(100, generator);
- X x(vx.begin(), vx.end(), 0, hasher(1), key_equal(1), allocator_type(1));
- X y(vy.begin(), vy.end(), 0, hasher(2), key_equal(2), allocator_type(2));
+ X x(vx.begin(), vx.end(), 0, hasher(1), key_equal(1),
+ allocator_type(1));
+ X y(vy.begin(), vy.end(), 0, hasher(2), key_equal(2),
+ allocator_type(2));
swap_test_impl(x, y);
swap_test_impl(x, y);
}
#endif
}
-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;
UNORDERED_TEST(swap_tests1,
((test_set)(test_multiset)(test_map)(test_multimap))
Modified: trunk/libs/unordered/test/unordered/unnecessary_copy_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/unnecessary_copy_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/unnecessary_copy_tests.cpp 2010-01-04 17:49:39 EST (Mon, 04 Jan 2010)
@@ -67,25 +67,33 @@
}
}
-#define COPY_COUNT(n) \
- if(count_copies::copies != n) { \
- BOOST_ERROR("Wrong number of copies."); \
- std::cerr<<"Number of copies: "<<count_copies::copies<<" expecting: "<<n<<std::endl; \
- }
-#define MOVE_COUNT(n) \
- if(count_copies::moves != n) { \
- BOOST_ERROR("Wrong number of moves."); \
- std::cerr<<"Number of moves: "<<count_copies::moves<<" expecting: "<<n<<std::endl; \
- }
-#define COPY_COUNT_RANGE(a, b) \
- if(count_copies::copies < a || count_copies::copies > b) { \
- BOOST_ERROR("Wrong number of copies."); \
- std::cerr<<"Number of copies: "<<count_copies::copies<<" expecting: ["<<a<<", "<<b<<"]"<<std::endl; \
- }
-#define MOVE_COUNT_RANGE(a, b) \
- if(count_copies::moves < a || count_copies::moves > b) { \
- BOOST_ERROR("Wrong number of moves."); \
- std::cerr<<"Number of moves: "<<count_copies::copies<<" expecting: ["<<a<<", "<<b<<"]"<<std::endl; \
+#define COPY_COUNT(n) \
+ if(count_copies::copies != n) { \
+ BOOST_ERROR("Wrong number of copies."); \
+ std::cerr \
+ << "Number of copies: " << count_copies::copies \
+ << " expecting: " << n << std::endl; \
+ }
+#define MOVE_COUNT(n) \
+ if(count_copies::moves != n) { \
+ BOOST_ERROR("Wrong number of moves."); \
+ std::cerr \
+ << "Number of moves: " << count_copies::moves \
+ << " expecting: " <<n << std::endl; \
+ }
+#define COPY_COUNT_RANGE(a, b) \
+ if(count_copies::copies < a || count_copies::copies > b) { \
+ BOOST_ERROR("Wrong number of copies."); \
+ std::cerr \
+ << "Number of copies: " << count_copies::copies \
+ << " expecting: [" << a << ", " << b << "]" << std::endl; \
+ }
+#define MOVE_COUNT_RANGE(a, b) \
+ if(count_copies::moves < a || count_copies::moves > b) { \
+ BOOST_ERROR("Wrong number of moves."); \
+ std::cerr \
+ << "Number of moves: " << count_copies::copies \
+ << " expecting: [" << a << ", " << b << "]" << std::endl; \
}
namespace unnecessary_copy_tests
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