]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/assign/test/ptr_list_of.cpp
1 // Boost.Assign library
3 // Copyright Thorsten Ottosen 2003-2004. 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)
8 // For more information, see http://www.boost.org/libs/assign/
12 #include <boost/detail/workaround.hpp>
14 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
15 # pragma warn -8091 // suppress warning in Boost.Test
16 # pragma warn -8057 // unused argument argc/argv in Boost.Test
19 #include <boost/assign/ptr_list_of.hpp>
20 #include <boost/test/test_tools.hpp>
21 #include <boost/ptr_container/ptr_container.hpp>
31 Foo( int i
, int ) : i(i
)
33 Foo( const char*, int i
, int ) : i(i
)
37 inline bool operator<( Foo l
, Foo r
)
42 template< class PtrCont
>
43 void check_ptr_list_of_impl()
46 using namespace boost
;
47 using namespace boost::assign
;
50 deq
= ptr_list_of
<Foo
>( 42 )()()( 3, 3 )( "foo", 2, 1 );
51 BOOST_CHECK( deq
.size() == 5 );
55 void check_ptr_list_of()
57 check_ptr_list_of_impl
< boost::ptr_deque
<Foo
> >();
58 check_ptr_list_of_impl
< boost::ptr_list
<Foo
> >();
59 check_ptr_list_of_impl
< boost::ptr_vector
<Foo
> >();
63 #include <boost/test/unit_test.hpp>
64 using boost::unit_test::test_suite
;
66 test_suite
* init_unit_test_suite( int argc
, char* argv
[] )
68 test_suite
* test
= BOOST_TEST_SUITE( "List Test Suite" );
70 test
->add( BOOST_TEST_CASE( &check_ptr_list_of
) );