diff --git a/test/list_test.hpp b/test/list_test.hpp index 7016eac..aec82c6 100644 --- a/test/list_test.hpp +++ b/test/list_test.hpp @@ -410,6 +410,56 @@ int list_test (bool copied_allocators_equal = true) return 0; } +template +bool test_list_methods_with_initializer_list_as_argument_for() +{ +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + const std::initializer_list il = {5, 10, 15}; + const List expected_list(il.begin(), il.end()); + { + List sl = il; + if(sl != expected_list) + return false; + } + + { + List sl = {1, 2}; + sl = il; + if(sl != expected_list) + return false; + } + { + List sl({ 1, 2 }, typename List::allocator_type()); + sl = il; + if (sl != expected_list) + return false; + } + { + List sl = {4, 5}; + sl.assign(il); + if(sl != expected_list) + return false; + } + + { + List sl = {15}; + sl.insert(sl.cbegin(), {5, 10}); + if(sl != expected_list) + return false; + } + + { + List sl = {5}; + sl.insert_after(sl.cbegin(), {10, 15}); + if(sl != expected_list) + return false; + } + return true; +#endif + return true; +} + + } //namespace test{ } //namespace container { } //namespace boost{ diff --git a/test/stable_vector_test.cpp b/test/stable_vector_test.cpp index afc998f..3ff73e3 100644 --- a/test/stable_vector_test.cpp +++ b/test/stable_vector_test.cpp @@ -199,9 +199,8 @@ int main() //////////////////////////////////// // Initializer lists testing //////////////////////////////////// - if(!boost::container::test::test_vector_methods_with_initializer_list_as_argument_for< - boost::container::stable_vector - >()) + if(!boost::container::test::test_vector_methods_with_initializer_list_as_argument_for + < boost::container::stable_vector >()) { std::cerr << "test_methods_with_initializer_list_as_argument failed" << std::endl; return 1;