]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/range/test/ticket_5486.cpp
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)
9 // For more information, see http://www.boost.org/libs/range/
11 #include <boost/range/adaptor/adjacent_filtered.hpp>
12 #include <boost/range/algorithm_ext/push_back.hpp>
14 #include <boost/test/test_tools.hpp>
15 #include <boost/test/unit_test.hpp>
23 class TestTicket5486Pred
26 typedef int first_argument_type
;
27 typedef int second_argument_type
;
28 typedef bool result_type
;
30 explicit TestTicket5486Pred(int x
) {}
31 bool operator()(int,int) const { return true; }
36 // Ticket 5486 - pertained to predicates erroneous
37 // requiring default construction
38 void test_ticket_5486()
41 boost::push_back(v
, v
| boost::adaptors::adjacent_filtered(TestTicket5486Pred(1)));
43 BOOST_CHECK_EQUAL_COLLECTIONS( v
.begin(), v
.end(),
49 boost::unit_test::test_suite
*
50 init_unit_test_suite(int argc
, char* argv
[])
52 boost::unit_test::test_suite
* test
53 = BOOST_TEST_SUITE( "RangeTestSuite.ticket_5486" );
55 test
->add( BOOST_TEST_CASE( &boost::test_ticket_5486
) );