forked from boostorg/range
type_erased unit test reduce dependencies of the recently split type_erased tests.
This commit is contained in:
@ -10,11 +10,6 @@
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <boost/range/value_type.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
|
@ -8,20 +8,15 @@
|
||||
#include <boost/range/adaptor/type_erased.hpp>
|
||||
#include "type_erased_test.hpp"
|
||||
|
||||
#include <boost/test/test_tools.hpp>
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <boost/assign.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
namespace boost_range_adaptor_type_erased_test
|
||||
{
|
||||
namespace
|
||||
{
|
||||
|
||||
class dummy_interface
|
||||
{
|
||||
public:
|
||||
@ -80,10 +75,10 @@ void test_type_erased_abstract()
|
||||
} // namespace boost_range_adaptor_type_erased_test
|
||||
|
||||
boost::unit_test::test_suite*
|
||||
init_unit_test_suite(int argc, char* argv[])
|
||||
init_unit_test_suite(int, char*[])
|
||||
{
|
||||
boost::unit_test::test_suite* test
|
||||
= BOOST_TEST_SUITE( "RangeTestSuite.adaptor.type_erased_abstract" );
|
||||
= BOOST_TEST_SUITE("RangeTestSuite.adaptor.type_erased_abstract");
|
||||
|
||||
test->add(
|
||||
BOOST_TEST_CASE(
|
||||
|
@ -10,11 +10,6 @@
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <boost/range/value_type.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <list>
|
||||
#include <deque>
|
||||
#include <vector>
|
||||
@ -49,7 +44,7 @@ void test_bidirectional()
|
||||
} // namespace boost_range_adaptor_type_erased_test
|
||||
|
||||
boost::unit_test::test_suite*
|
||||
init_unit_test_suite(int argc, char* argv[])
|
||||
init_unit_test_suite(int, char*[])
|
||||
{
|
||||
boost::unit_test::test_suite* test =
|
||||
BOOST_TEST_SUITE("RangeTestSuite.adaptor.type_erased_bidirectional");
|
||||
|
@ -10,13 +10,6 @@
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <boost/range/value_type.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <list>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
namespace boost_range_adaptor_type_erased_test
|
||||
@ -24,7 +17,7 @@ namespace boost_range_adaptor_type_erased_test
|
||||
namespace
|
||||
{
|
||||
|
||||
void test_type_erased_operator_brackets()
|
||||
void test_operator_brackets()
|
||||
{
|
||||
typedef boost::adaptors::type_erased<> type_erased_t;
|
||||
|
||||
@ -55,7 +48,7 @@ void test_type_erased_operator_brackets()
|
||||
|
||||
for (int i = 0; i < 10; ++i)
|
||||
{
|
||||
BOOST_CHECK_EQUAL( rng[i], i );
|
||||
BOOST_CHECK_EQUAL(rng[i], i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,12 +56,14 @@ void test_type_erased_operator_brackets()
|
||||
} // namespace boost_range_adaptor_type_erased_test
|
||||
|
||||
boost::unit_test::test_suite*
|
||||
init_unit_test_suite(int argc, char* argv[])
|
||||
init_unit_test_suite(int, char*[])
|
||||
{
|
||||
boost::unit_test::test_suite* test
|
||||
= BOOST_TEST_SUITE( "RangeTestSuite.adaptor.type_erased" );
|
||||
= BOOST_TEST_SUITE("RangeTestSuite.adaptor.type_erased_brackets");
|
||||
|
||||
test->add( BOOST_TEST_CASE( &boost_range_adaptor_type_erased_test::test_type_erased_operator_brackets ) );
|
||||
test->add(
|
||||
BOOST_TEST_CASE(
|
||||
&boost_range_adaptor_type_erased_test::test_operator_brackets));
|
||||
|
||||
return test;
|
||||
}
|
||||
|
@ -10,13 +10,8 @@
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <boost/range/value_type.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <list>
|
||||
#include <deque>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
namespace boost_range_adaptor_type_erased_test
|
||||
@ -49,7 +44,7 @@ void test_forward()
|
||||
} // namespace boost_range_adaptor_type_erased_test
|
||||
|
||||
boost::unit_test::test_suite*
|
||||
init_unit_test_suite(int argc, char* argv[])
|
||||
init_unit_test_suite(int, char*[])
|
||||
{
|
||||
boost::unit_test::test_suite* test =
|
||||
BOOST_TEST_SUITE( "RangeTestSuite.adaptor.type_erased_forward" );
|
||||
|
@ -10,13 +10,6 @@
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <boost/range/value_type.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <list>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
namespace boost_range_adaptor_type_erased_test
|
||||
@ -34,7 +27,7 @@ template<
|
||||
>
|
||||
void mix_values_impl()
|
||||
{
|
||||
typedef std::vector< ValueType > Container;
|
||||
typedef std::vector<ValueType> Container;
|
||||
|
||||
typedef typename boost::any_range_type_generator<
|
||||
Container
|
||||
@ -56,13 +49,13 @@ void mix_values_impl()
|
||||
|
||||
const source_type source_data(test_data);
|
||||
target_type t1(source_data);
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS( source_data.begin(), source_data.end(),
|
||||
t1.begin(), t1.end() );
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(source_data.begin(), source_data.end(),
|
||||
t1.begin(), t1.end());
|
||||
|
||||
target_type t2;
|
||||
t2 = source_data;
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS( source_data.begin(), source_data.end(),
|
||||
t2.begin(), t2.end() );
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(source_data.begin(), source_data.end(),
|
||||
t2.begin(), t2.end());
|
||||
}
|
||||
|
||||
template<class Traversal>
|
||||
@ -78,17 +71,17 @@ void mix_values_driver()
|
||||
|
||||
void mix_values()
|
||||
{
|
||||
mix_values_driver< boost::single_pass_traversal_tag >();
|
||||
mix_values_driver< boost::forward_traversal_tag >();
|
||||
mix_values_driver< boost::bidirectional_traversal_tag >();
|
||||
mix_values_driver< boost::random_access_traversal_tag >();
|
||||
mix_values_driver<boost::single_pass_traversal_tag >();
|
||||
mix_values_driver<boost::forward_traversal_tag >();
|
||||
mix_values_driver<boost::bidirectional_traversal_tag >();
|
||||
mix_values_driver<boost::random_access_traversal_tag >();
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
} // namespace boost_range_adaptor_type_erased_test
|
||||
|
||||
boost::unit_test::test_suite*
|
||||
init_unit_test_suite(int argc, char* argv[])
|
||||
init_unit_test_suite(int, char*[])
|
||||
{
|
||||
boost::unit_test::test_suite* test =
|
||||
BOOST_TEST_SUITE("RangeTestSuite.adaptor.type_erased_mix_values");
|
||||
|
@ -10,11 +10,6 @@
|
||||
|
||||
#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 <vector>
|
||||
|
||||
|
@ -10,11 +10,6 @@
|
||||
|
||||
#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>
|
||||
|
@ -10,10 +10,6 @@
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <boost/range/value_type.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
|
Reference in New Issue
Block a user