Refactor initializer_list tests to avoid code duplication and add some missing initializer_list overload tests

This commit is contained in:
Ion Gaztañaga
2015-02-27 19:24:46 +01:00
parent 90b3af4229
commit 7239c8e262
9 changed files with 132 additions and 105 deletions

View File

@@ -389,12 +389,17 @@ template<typename VectorContainerType>
bool test_vector_methods_with_initializer_list_as_argument_for()
{
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
typedef typename VectorContainerType::allocator_type allocator_type;
{
const VectorContainerType testedVector = {1, 2, 3};
const std::vector<int> expectedVector = {1, 2, 3};
if(!test::CheckEqualContainers(testedVector, expectedVector)) return false;
}
{
const VectorContainerType testedVector( { 1, 2, 3 }, allocator_type() );
const std::vector<int> expectedVector = {1, 2, 3};
if(!test::CheckEqualContainers(testedVector, expectedVector)) return false;
}
{
VectorContainerType testedVector = {1, 2, 3};
testedVector = {11, 12, 13};