type_erased split out single-pass.

This commit is contained in:
Neil Groves
2014-03-04 11:41:19 +00:00
parent c96897198a
commit 438e735dcc
3 changed files with 63 additions and 12 deletions

View File

@ -54,6 +54,7 @@ test-suite range :
[ range-test adaptor_test/type_erased_brackets ]
[ range-test adaptor_test/type_erased_mix_values ]
[ range-test adaptor_test/type_erased_tparam_conv ]
[ range-test adaptor_test/type_erased_single_pass ]
[ range-test adaptor_test/uniqued ]
[ range-test adaptor_test/adjacent_filtered_example ]
[ range-test adaptor_test/copied_example ]

View File

@ -35,17 +35,6 @@ void test_type_erased()
test_driver< std::vector<MockType> >();
}
void test_type_erased_single_pass()
{
test_type_erased_exercise_buffer_types< std::list<int>, boost::single_pass_traversal_tag >();
test_type_erased_exercise_buffer_types< std::deque<int>, boost::single_pass_traversal_tag >();
test_type_erased_exercise_buffer_types< std::vector<int>, boost::single_pass_traversal_tag >();
test_type_erased_exercise_buffer_types< std::list<MockType>, boost::single_pass_traversal_tag >();
test_type_erased_exercise_buffer_types< std::deque<MockType>, boost::single_pass_traversal_tag >();
test_type_erased_exercise_buffer_types< std::vector<MockType>, boost::single_pass_traversal_tag >();
}
void test_type_erased_forward()
{
test_type_erased_exercise_buffer_types< std::list<int>, boost::forward_traversal_tag >();
@ -87,7 +76,6 @@ init_unit_test_suite(int argc, char* argv[])
= BOOST_TEST_SUITE( "RangeTestSuite.adaptor.type_erased" );
test->add( BOOST_TEST_CASE( &boost_range_adaptor_type_erased_test::test_type_erased ) );
test->add( BOOST_TEST_CASE( &boost_range_adaptor_type_erased_test::test_type_erased_single_pass ) );
test->add( BOOST_TEST_CASE( &boost_range_adaptor_type_erased_test::test_type_erased_forward ) );
test->add( BOOST_TEST_CASE( &boost_range_adaptor_type_erased_test::test_type_erased_bidirectional ) );
test->add( BOOST_TEST_CASE( &boost_range_adaptor_type_erased_test::test_type_erased_random_access ) );

View File

@ -0,0 +1,62 @@
// Boost.Range library
//
// Copyright Neil Groves 2010. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#include <boost/range/adaptor/type_erased.hpp>
#include "type_erased_test.hpp"
#include <boost/test/unit_test.hpp>
#include <boost/range/value_type.hpp>
#include <boost/array.hpp>
#include <boost/cstdint.hpp>
#include <algorithm>
#include <deque>
#include <list>
#include <vector>
namespace boost_range_adaptor_type_erased_test
{
namespace
{
void test_single_pass()
{
test_type_erased_exercise_buffer_types<
std::list<int>, boost::single_pass_traversal_tag>();
test_type_erased_exercise_buffer_types<
std::deque<int>, boost::single_pass_traversal_tag>();
test_type_erased_exercise_buffer_types<
std::vector<int>, boost::single_pass_traversal_tag>();
test_type_erased_exercise_buffer_types<
std::list<MockType>, boost::single_pass_traversal_tag>();
test_type_erased_exercise_buffer_types<
std::deque<MockType>, boost::single_pass_traversal_tag>();
test_type_erased_exercise_buffer_types<
std::vector<MockType>, boost::single_pass_traversal_tag>();
}
} // anonymous namespace
} // namespace boost_range_adaptor_type_erased_test
boost::unit_test::test_suite*
init_unit_test_suite(int argc, char* argv[])
{
boost::unit_test::test_suite* test =
BOOST_TEST_SUITE("RangeTestSuite.adaptor.type_erased_single_pass");
test->add(BOOST_TEST_CASE(
&boost_range_adaptor_type_erased_test::test_single_pass));
return test;
}