From 07addb70302b78b534c4a814bacb68a2d28abc35 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Thu, 17 Apr 2008 07:42:47 +0000 Subject: [PATCH] A few tweaks for the unordered tests. Merged revisions 44461-44462,44466 via svnmerge from https://svn.boost.org/svn/boost/branches/unordered/trunk ........ r44461 | danieljames | 2008-04-16 18:34:48 +0100 (Wed, 16 Apr 2008) | 2 lines Try to get some more tests working on Borland. ........ r44462 | danieljames | 2008-04-16 18:34:59 +0100 (Wed, 16 Apr 2008) | 2 lines Write out the number of copies when the unnecessary copy test fails. ........ r44466 | danieljames | 2008-04-16 18:35:44 +0100 (Wed, 16 Apr 2008) | 2 lines Add compile test for get_allocator. ........ [SVN r44488] --- test/helpers/metafunctions.hpp | 15 ++++++--------- test/unordered/compile_tests.hpp | 5 +++++ test/unordered/unnecessary_copy_tests.cpp | 5 +++++ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/test/helpers/metafunctions.hpp b/test/helpers/metafunctions.hpp index 88b00e66..c0c56e71 100644 --- a/test/helpers/metafunctions.hpp +++ b/test/helpers/metafunctions.hpp @@ -8,11 +8,7 @@ #include #include -#include -#include #include -#include -#include #include #include @@ -82,7 +78,8 @@ namespace test // Non Const Value Type - struct map_non_const_value_type + template + struct non_const_value_type_impl { template struct apply { @@ -92,7 +89,8 @@ namespace test }; }; - struct set_non_const_value_type + template<> + struct non_const_value_type_impl { template struct apply { @@ -102,9 +100,8 @@ namespace test template struct non_const_value_type - : boost::mpl::apply1< - BOOST_DEDUCED_TYPENAME boost::mpl::if_, map_non_const_value_type, set_non_const_value_type>::type, - Container> + : non_const_value_type_impl< ::test::is_map::value>:: + BOOST_NESTED_TEMPLATE apply { }; } diff --git a/test/unordered/compile_tests.hpp b/test/unordered/compile_tests.hpp index c44cd02c..d7843cdf 100644 --- a/test/unordered/compile_tests.hpp +++ b/test/unordered/compile_tests.hpp @@ -127,6 +127,11 @@ void container_test(X& r, T&) test::check_return_type::equals(a.size()); test::check_return_type::equals(a.max_size()); test::check_return_type::convertible(a.empty()); + + // Allocator + + typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type; + test::check_return_type::equals(a_const.get_allocator()); } template diff --git a/test/unordered/unnecessary_copy_tests.cpp b/test/unordered/unnecessary_copy_tests.cpp index 1c713a6c..64039020 100644 --- a/test/unordered/unnecessary_copy_tests.cpp +++ b/test/unordered/unnecessary_copy_tests.cpp @@ -45,8 +45,13 @@ namespace unnecessary_copy_tests T x; BOOST_DEDUCED_TYPENAME T::value_type a; BOOST_CHECK(count_copies::count == 1); + if(count_copies::count != 1) + std::cerr<* set;