diff options
Diffstat (limited to 'libs/container/test/deque_test.cpp')
-rw-r--r-- | libs/container/test/deque_test.cpp | 55 |
1 files changed, 22 insertions, 33 deletions
diff --git a/libs/container/test/deque_test.cpp b/libs/container/test/deque_test.cpp index 4e0b30e27..3a32e6bf5 100644 --- a/libs/container/test/deque_test.cpp +++ b/libs/container/test/deque_test.cpp @@ -9,11 +9,9 @@ ////////////////////////////////////////////////////////////////////////////// #include <boost/container/detail/config_begin.hpp> -#include <algorithm> #include <memory> #include <deque> #include <iostream> -#include <functional> #include <list> #include <boost/container/deque.hpp> @@ -337,36 +335,21 @@ int test_cont_variants() return 0; } -bool test_support_for_initialization_list() -{ -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - const std::initializer_list<int> il = {1, 10, 11}; - const deque<int> expectedDeque(il.begin(), il.end()); - - const deque<int> testConstructor = il; - if(testConstructor != expectedDeque) - return false; - - deque<int> testAssignmentOperator = {11, 12, 23}; - testAssignmentOperator = il; - if(testConstructor != expectedDeque) - return false; +struct boost_container_deque; - deque<int> testAssignmentMethod = {11, 12, 23}; - testAssignmentMethod.assign(il); - if(testConstructor != expectedDeque) - return false; +namespace boost { namespace container { namespace test { - deque<int> testInsertMethod = {11}; - testInsertMethod.insert(testInsertMethod.cbegin(), {12, 23}); - if(testConstructor != expectedDeque) - return false; - - return true; -#endif - return true; +template<> +struct alloc_propagate_base<boost_container_deque> +{ + template <class T, class Allocator> + struct apply + { + typedef boost::container::deque<T, Allocator> type; + }; +}; -} +}}} //namespace boost::container::test int main () { @@ -422,9 +405,6 @@ int main () return 1; } - if(!test_support_for_initialization_list()) - return 1; - //////////////////////////////////// // Emplace testing //////////////////////////////////// @@ -436,8 +416,17 @@ int main () //////////////////////////////////// // Allocator propagation testing //////////////////////////////////// - if(!boost::container::test::test_propagate_allocator<deque>()) + if(!boost::container::test::test_propagate_allocator<boost_container_deque>()) + return 1; + + //////////////////////////////////// + // Initializer lists testing + //////////////////////////////////// + if(!boost::container::test::test_vector_methods_with_initializer_list_as_argument_for + < boost::container::deque<int> >()) { return 1; + } + return 0; return 0; } |