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 "associative_test_data.hpp" |
---|
14 | #include <boost/ptr_container/ptr_set.hpp> |
---|
15 | |
---|
16 | void test_set() |
---|
17 | { |
---|
18 | |
---|
19 | ptr_set_test< ptr_set<Base>, Base, Derived_class >(); |
---|
20 | ptr_set_test< ptr_set<Value>, Value, Value >(); |
---|
21 | |
---|
22 | ptr_set_test< ptr_multiset<Base>, Base, Derived_class >(); |
---|
23 | ptr_set_test< ptr_multiset<Value>, Value, Value >(); |
---|
24 | |
---|
25 | ptr_set<int> set; |
---|
26 | |
---|
27 | BOOST_CHECK_THROW( set.insert( 0 ), bad_ptr_container_operation ); |
---|
28 | set.insert( new int(0) ); |
---|
29 | BOOST_CHECK_THROW( (set.replace(set.begin(), 0 )), bad_ptr_container_operation ); |
---|
30 | } |
---|
31 | |
---|
32 | using boost::unit_test::test_suite; |
---|
33 | |
---|
34 | test_suite* init_unit_test_suite( int argc, char* argv[] ) |
---|
35 | { |
---|
36 | test_suite* test = BOOST_TEST_SUITE( "Pointer Container Test Suite" ); |
---|
37 | |
---|
38 | test->add( BOOST_TEST_CASE( &test_set ) ); |
---|
39 | |
---|
40 | return test; |
---|
41 | } |
---|
42 | |
---|
43 | |
---|
44 | |
---|
45 | |
---|
46 | |
---|
47 | |
---|