1 | // Boost.Range library |
---|---|
2 | // |
3 | // Copyright Neil Groves 2011. Use, modification and |
4 | // distribution is subject to the Boost Software License, Version |
5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
6 | // http://www.boost.org/LICENSE_1_0.txt) |
7 | // |
8 | // |
9 | // For more information, see http://www.boost.org/libs/range/ |
10 | // |
11 | #include <boost/concept_check.hpp> |
12 | #include <boost/iterator/iterator_adaptor.hpp> |
13 | #include <boost/range/concepts.hpp> |
14 | #include <boost/range/iterator_range.hpp> |
15 | |
16 | #include <boost/test/test_tools.hpp> |
17 | #include <boost/test/unit_test.hpp> |
18 | |
19 | #include <vector> |
20 | |
21 | namespace boost |
22 | { |
23 | typedef std::vector<int>::iterator iter_base; |
24 | struct iter : boost::iterator_adaptor<iter, iter_base, int, boost::use_default, int> {}; // will be deduced as random-access traversal but input category |
25 | typedef boost::iterator_range<iter> iter_range; |
26 | |
27 | namespace |
28 | { |
29 | // Ticket 6944 - Some Range concepts use the incorrect Iterator concept |
30 | void test_ticket_6944() |
31 | { |
32 | BOOST_CONCEPT_ASSERT(( boost::RandomAccessRangeConcept<iter_range> )); |
33 | } |
34 | } |
35 | } |
36 | |
37 | boost::unit_test::test_suite* |
38 | init_unit_test_suite(int argc, char* argv[]) |
39 | { |
40 | boost::unit_test::test_suite* test |
41 | = BOOST_TEST_SUITE( "RangeTestSuite.ticket_6944"); |
42 | |
43 | test->add( BOOST_TEST_CASE( &boost::test_ticket_6944 ) ); |
44 | |
45 | return test; |
46 | } |
47 |