]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/ptr_container/test/ptr_list.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / ptr_container / test / ptr_list.cpp
1 //
2 // Boost.Pointer Container
3 //
4 // Copyright Thorsten Ottosen 2003-2005. Use, modification and
5 // distribution is subject to the Boost Software License, Version
6 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 //
9 // For more information, see http://www.boost.org/libs/ptr_container/
10 //
11
12 #define PTR_LIST_TEST 1
13 #define PTR_CONTAINER_DEBUG 0
14
15 #include <boost/test/unit_test.hpp>
16 #include "sequence_test_data.hpp"
17 #include <boost/ptr_container/ptr_list.hpp>
18
19 void test_list()
20 {
21
22 reversible_container_test< ptr_list<Base>, Base, Derived_class >();
23 reversible_container_test< ptr_list<Value>, Value, Value >();
24 reversible_container_test< ptr_list< nullable<Base> >, Base, Derived_class >();
25 reversible_container_test< ptr_list< nullable<Value> >, Value, Value >();
26
27 container_assignment_test< ptr_list<Base>, ptr_list<Derived_class>,
28 Derived_class>();
29 container_assignment_test< ptr_list< nullable<Base> >,
30 ptr_list< nullable<Derived_class> >,
31 Derived_class>();
32 container_assignment_test< ptr_list< nullable<Base> >,
33 ptr_list<Derived_class>,
34 Derived_class>();
35 container_assignment_test< ptr_list<Base>,
36 ptr_list< nullable<Derived_class> >,
37 Derived_class>();
38
39 test_transfer< ptr_list<Derived_class>, ptr_list<Base>, Derived_class>();
40
41 random_access_algorithms_test< ptr_list<int> >();
42 ptr_list<int> list;
43 list.push_back( new int(0) );
44 list.push_back( new int(2) );
45 list.push_back( new int(1) );
46 list.push_front( new int(3) );
47 list.push_front( std::auto_ptr<int>( new int(42) ) );
48 list.reverse();
49
50 }
51
52
53
54 using boost::unit_test::test_suite;
55
56 test_suite* init_unit_test_suite( int argc, char* argv[] )
57 {
58 test_suite* test = BOOST_TEST_SUITE( "Pointer Container Test Suite" );
59
60 test->add( BOOST_TEST_CASE( &test_list ) );
61
62 return test;
63 }
64
65
66
67