From 01df4d9dc292e023507b40d858d687674354c918 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Fri, 18 Jan 2008 19:35:55 +0000 Subject: [PATCH] Merge in some changes to the unordered tests. [SVN r42856] --- test/helpers/allocator.hpp | 6 +++--- test/objects/exception.hpp | 8 +------- test/objects/memory.hpp | 30 +++++++++++++++++++++++------- test/objects/test.hpp | 2 +- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/test/helpers/allocator.hpp b/test/helpers/allocator.hpp index 36cdf173..b3ff6398 100644 --- a/test/helpers/allocator.hpp +++ b/test/helpers/allocator.hpp @@ -44,9 +44,9 @@ namespace test pointer allocate(size_type n, const_pointer u) { return allocate(n); } -#if defined(__IBMCPP__) - // Workaround for IBM Visual Age which seems to use a void pointer - // for the second argument. +#if defined(__IBMCPP__) || BOOST_WORKAROUND(BOOST_RWSTD_VER, < 0x04020000) + // Workaround for IBM Visual Age and Rogue Wave (or maybe just Apache stdcxx?) + // which seem to use a void pointer for the second argument. pointer allocate(size_type n, void const* u) { return allocate(n); } #endif diff --git a/test/objects/exception.hpp b/test/objects/exception.hpp index 240c654b..cd4f4b13 100644 --- a/test/objects/exception.hpp +++ b/test/objects/exception.hpp @@ -21,15 +21,9 @@ namespace exception { namespace detail { - struct malloc_allocator_holder { - template struct apply { - typedef test::malloc_allocator type; - }; - }; - namespace { - test::detail::memory_tracker tracker; + test::detail::memory_tracker > tracker; } } diff --git a/test/objects/memory.hpp b/test/objects/memory.hpp index 49815ce7..ff1a7e53 100644 --- a/test/objects/memory.hpp +++ b/test/objects/memory.hpp @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include "../helpers/test.hpp" namespace test @@ -56,14 +58,28 @@ namespace test } }; - struct default_allocator_holder { template struct apply { - typedef std::allocator type; }; }; - - template - struct memory_tracker { + template + struct allocator_memory_type_gen { typedef std::map >::type - > allocated_memory_type; + Alloc> type; + }; + +#if defined(BOOST_MPL_CFG_MSVC_ETI_BUG) + template <> + struct allocator_memory_type_gen { + typedef std::map type; + }; +#endif + + template > + struct memory_tracker { + typedef BOOST_DEDUCED_TYPENAME + boost::unordered_detail::rebind_wrap >::type + allocator_type; + + typedef BOOST_DEDUCED_TYPENAME allocator_memory_type_gen::type + allocated_memory_type; allocated_memory_type allocated_memory; unsigned int count_allocators; diff --git a/test/objects/test.hpp b/test/objects/test.hpp index 19750319..792d65a9 100644 --- a/test/objects/test.hpp +++ b/test/objects/test.hpp @@ -205,7 +205,7 @@ namespace test namespace detail { namespace { - test::detail::memory_tracker tracker; + test::detail::memory_tracker > tracker; } }