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 | #include <boost/test/unit_test.hpp> |
---|
13 | #include "sequence_test_data.hpp" |
---|
14 | #include <boost/ptr_container/ptr_deque.hpp> |
---|
15 | |
---|
16 | void test_ptr_deque() |
---|
17 | { |
---|
18 | reversible_container_test< ptr_deque<Base>, Base, Derived_class >(); |
---|
19 | reversible_container_test< ptr_deque<Value>, Value, Value >(); |
---|
20 | reversible_container_test< ptr_deque< nullable<Base> >, Base, Derived_class >(); |
---|
21 | reversible_container_test< ptr_deque< nullable<Value> >, Value, Value >(); |
---|
22 | |
---|
23 | test_transfer< ptr_deque<Derived_class>, ptr_deque<Base>, Derived_class>(); |
---|
24 | |
---|
25 | |
---|
26 | random_access_algorithms_test< ptr_deque<int> >(); |
---|
27 | ptr_deque<int> di; |
---|
28 | di.push_front( new int(0) ); |
---|
29 | BOOST_CHECK_EQUAL( di.size(), 1u ); |
---|
30 | di.push_front( std::auto_ptr<int>( new int(1) ) ); |
---|
31 | BOOST_CHECK_EQUAL( di.size(), 2u ); |
---|
32 | } |
---|
33 | |
---|
34 | using boost::unit_test::test_suite; |
---|
35 | |
---|
36 | test_suite* init_unit_test_suite( int argc, char* argv[] ) |
---|
37 | { |
---|
38 | test_suite* test = BOOST_TEST_SUITE( "Pointer Container Test Suite" ); |
---|
39 | |
---|
40 | test->add( BOOST_TEST_CASE( &test_ptr_deque ) ); |
---|
41 | |
---|
42 | return test; |
---|
43 | } |
---|
44 | |
---|