diff --git a/doc/examples.rst b/doc/examples.rst index e0cf1af7..213094bf 100644 --- a/doc/examples.rst +++ b/doc/examples.rst @@ -110,9 +110,9 @@ Some examples are given here and in the accompanying test files: // ... fill the container somehow - auto_type ptr = deq.release_back(); // remove back element from container and give up ownership + auto_type ptr = deq.pop_back(); // remove back element from container and give up ownership auto_type ptr2 = deq.release( deq.begin() + 2 ); // use an iterator to determine the element to release - ptr = deq.release_front(); // supported for 'ptr_list' and 'ptr_deque' + ptr = deq.pop_front(); // supported for 'ptr_list' and 'ptr_deque' deq.push_back( ptr.release() ); // give ownership back to the container diff --git a/include/boost/ptr_container/detail/associative_ptr_container.hpp b/include/boost/ptr_container/detail/associative_ptr_container.hpp index c2033fa3..56854e79 100644 --- a/include/boost/ptr_container/detail/associative_ptr_container.hpp +++ b/include/boost/ptr_container/detail/associative_ptr_container.hpp @@ -13,7 +13,7 @@ #ifndef BOOST_PTR_CONTAINER_DETAIL_ASSOCIATIVE_PTR_CONTAINER_HPP #define BOOST_PTR_CONTAINER_DETAIL_ASSOCIATIVE_PTR_CONTAINER_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif diff --git a/include/boost/ptr_container/detail/default_deleter.hpp b/include/boost/ptr_container/detail/default_deleter.hpp old mode 100755 new mode 100644 index 44647990..86914b29 --- a/include/boost/ptr_container/detail/default_deleter.hpp +++ b/include/boost/ptr_container/detail/default_deleter.hpp @@ -61,7 +61,7 @@ struct default_deleter { default_deleter() { } template - default_deleter(default_deleter tt) { } + default_deleter(default_deleter) { } }; } } } // End namespaces ptr_container_detail, move_ptrs, boost. diff --git a/include/boost/ptr_container/detail/map_iterator.hpp b/include/boost/ptr_container/detail/map_iterator.hpp index e3ff4f2b..fa51e923 100644 --- a/include/boost/ptr_container/detail/map_iterator.hpp +++ b/include/boost/ptr_container/detail/map_iterator.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_MAP_ITERATOR_HPP #define BOOST_PTR_CONTAINER_MAP_ITERATOR_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif diff --git a/include/boost/ptr_container/detail/reversible_ptr_container.hpp b/include/boost/ptr_container/detail/reversible_ptr_container.hpp index 47c3903f..45e6120e 100644 --- a/include/boost/ptr_container/detail/reversible_ptr_container.hpp +++ b/include/boost/ptr_container/detail/reversible_ptr_container.hpp @@ -13,7 +13,7 @@ #ifndef BOOST_PTR_CONTAINER_DETAIL_REVERSIBLE_PTR_CONTAINER_HPP #define BOOST_PTR_CONTAINER_DETAIL_REVERSIBLE_PTR_CONTAINER_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif @@ -41,6 +41,7 @@ #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) #pragma warning(push) #pragma warning(disable:4127) +#pragma warning(disable:4224) // formal parameter was previously defined as a type. #endif namespace boost diff --git a/include/boost/ptr_container/detail/scoped_deleter.hpp b/include/boost/ptr_container/detail/scoped_deleter.hpp index a2e7aba2..8406c585 100755 --- a/include/boost/ptr_container/detail/scoped_deleter.hpp +++ b/include/boost/ptr_container/detail/scoped_deleter.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_SCOPED_DELETER_HPP #define BOOST_PTR_CONTAINER_SCOPED_DELETER_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif diff --git a/include/boost/ptr_container/detail/static_move_ptr.hpp b/include/boost/ptr_container/detail/static_move_ptr.hpp index 6af3461a..e9515ff5 100644 --- a/include/boost/ptr_container/detail/static_move_ptr.hpp +++ b/include/boost/ptr_container/detail/static_move_ptr.hpp @@ -151,7 +151,7 @@ class static_move_ptr deleter_const_reference get_deleter() const { return impl_.second(); } private: template - void check(const static_move_ptr& ptr) + void check(const static_move_ptr&) { typedef move_ptrs::is_smart_ptr_convertible convertible; BOOST_STATIC_ASSERT(convertible::value); diff --git a/include/boost/ptr_container/detail/void_ptr_iterator.hpp b/include/boost/ptr_container/detail/void_ptr_iterator.hpp old mode 100755 new mode 100644 index 937ffb4a..f5907eea --- a/include/boost/ptr_container/detail/void_ptr_iterator.hpp +++ b/include/boost/ptr_container/detail/void_ptr_iterator.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_DETAIL_VOID_PTR_ITERATOR_HPP #define BOOST_PTR_CONTAINER_DETAIL_VOID_PTR_ITERATOR_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif @@ -161,8 +161,22 @@ namespace boost return r; } + + namespace ptr_container_detail + { + template + struct is_compatible + { + static const bool value = boost::is_same< typename boost::remove_const::type, typename boost::remove_const::type >::value; + }; + } + + template< class VoidIter, class T, class VoidIterU, class U > - inline BOOST_DEDUCED_TYPENAME void_ptr_iterator::difference_type + inline BOOST_DEDUCED_TYPENAME boost::enable_if< + ptr_container_detail::is_compatible, + BOOST_DEDUCED_TYPENAME void_ptr_iterator::difference_type + >::type operator-( void_ptr_iterator l, void_ptr_iterator r ) @@ -173,7 +187,11 @@ namespace boost template< class VoidIterT, class T, class VoidIterU, class U > - inline bool operator==( const void_ptr_iterator& l, + inline BOOST_DEDUCED_TYPENAME boost::enable_if< + ptr_container_detail::is_compatible, + bool + >::type + operator==( const void_ptr_iterator& l, const void_ptr_iterator& r ) { return l.base() == r.base(); @@ -182,7 +200,11 @@ namespace boost template< class VoidIterT, class T, class VoidIterU, class U > - inline bool operator!=( const void_ptr_iterator& l, + inline BOOST_DEDUCED_TYPENAME boost::enable_if< + ptr_container_detail::is_compatible, + bool + >::type + operator!=( const void_ptr_iterator& l, const void_ptr_iterator& r ) { return l.base() != r.base(); @@ -191,7 +213,11 @@ namespace boost template< class VoidIterT, class T, class VoidIterU, class U > - inline bool operator<( const void_ptr_iterator& l, + inline BOOST_DEDUCED_TYPENAME boost::enable_if< + ptr_container_detail::is_compatible, + bool + >::type + operator<( const void_ptr_iterator& l, const void_ptr_iterator& r ) { return l.base() < r.base(); @@ -200,7 +226,11 @@ namespace boost template< class VoidIterT, class T, class VoidIterU, class U > - inline bool operator<=( const void_ptr_iterator& l, + inline BOOST_DEDUCED_TYPENAME boost::enable_if< + ptr_container_detail::is_compatible, + bool + >::type + operator<=( const void_ptr_iterator& l, const void_ptr_iterator& r ) { return l.base() <= r.base(); @@ -209,7 +239,11 @@ namespace boost template< class VoidIterT, class T, class VoidIterU, class U > - inline bool operator>( const void_ptr_iterator& l, + inline BOOST_DEDUCED_TYPENAME boost::enable_if< + ptr_container_detail::is_compatible, + bool + >::type + operator>( const void_ptr_iterator& l, const void_ptr_iterator& r ) { return l.base() > r.base(); @@ -218,7 +252,11 @@ namespace boost template< class VoidIterT, class T, class VoidIterU, class U > - inline bool operator>=( const void_ptr_iterator& l, + inline BOOST_DEDUCED_TYPENAME boost::enable_if< + ptr_container_detail::is_compatible, + bool + >::type + operator>=( const void_ptr_iterator& l, const void_ptr_iterator& r ) { return l.base() >= r.base(); diff --git a/include/boost/ptr_container/exception.hpp b/include/boost/ptr_container/exception.hpp old mode 100755 new mode 100644 index d9a5ffea..4582a229 --- a/include/boost/ptr_container/exception.hpp +++ b/include/boost/ptr_container/exception.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_EXCEPTION_HPP #define BOOST_PTR_CONTAINER_EXCEPTION_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif diff --git a/include/boost/ptr_container/indirect_fun.hpp b/include/boost/ptr_container/indirect_fun.hpp index 0c572650..8ee8524f 100644 --- a/include/boost/ptr_container/indirect_fun.hpp +++ b/include/boost/ptr_container/indirect_fun.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_INDIRECT_FUN_HPP #define BOOST_PTR_CONTAINER_INDIRECT_FUN_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) #pragma once #endif diff --git a/include/boost/ptr_container/nullable.hpp b/include/boost/ptr_container/nullable.hpp index b3e4603d..a9f39378 100755 --- a/include/boost/ptr_container/nullable.hpp +++ b/include/boost/ptr_container/nullable.hpp @@ -13,7 +13,7 @@ #ifndef BOOST_INDIRECT_CONTAINER_NULLABLE_HPP #define BOOST_INDIRECT_CONTAINER_NULLABLE_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif diff --git a/include/boost/ptr_container/ptr_array.hpp b/include/boost/ptr_container/ptr_array.hpp index 9ab6473e..92b4ef68 100644 --- a/include/boost/ptr_container/ptr_array.hpp +++ b/include/boost/ptr_container/ptr_array.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_PTR_ARRAY_HPP #define BOOST_PTR_CONTAINER_PTR_ARRAY_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif diff --git a/include/boost/ptr_container/ptr_circular_buffer.hpp b/include/boost/ptr_container/ptr_circular_buffer.hpp index bfd1be60..7b29f5b8 100644 --- a/include/boost/ptr_container/ptr_circular_buffer.hpp +++ b/include/boost/ptr_container/ptr_circular_buffer.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_PTR_CIRCULAR_BUFFER_HPP #define BOOST_PTR_CONTAINER_PTR_CIRCULAR_BUFFER_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif diff --git a/include/boost/ptr_container/ptr_container.hpp b/include/boost/ptr_container/ptr_container.hpp index 6b1c92d5..ab6caecd 100644 --- a/include/boost/ptr_container/ptr_container.hpp +++ b/include/boost/ptr_container/ptr_container.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_HPP #define BOOST_PTR_CONTAINER_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif diff --git a/include/boost/ptr_container/ptr_deque.hpp b/include/boost/ptr_container/ptr_deque.hpp index 0223fc79..4ac94612 100644 --- a/include/boost/ptr_container/ptr_deque.hpp +++ b/include/boost/ptr_container/ptr_deque.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_PTR_DEQUE_HPP #define BOOST_PTR_CONTAINER_PTR_DEQUE_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif diff --git a/include/boost/ptr_container/ptr_inserter.hpp b/include/boost/ptr_container/ptr_inserter.hpp index 71d1b60e..ce1f8e93 100644 --- a/include/boost/ptr_container/ptr_inserter.hpp +++ b/include/boost/ptr_container/ptr_inserter.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_PTR_INSERTER_HPP #define BOOST_PTR_CONTAINER_PTR_INSERTER_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) #pragma once #endif diff --git a/include/boost/ptr_container/ptr_list.hpp b/include/boost/ptr_container/ptr_list.hpp index 7c900fa2..d33ac414 100644 --- a/include/boost/ptr_container/ptr_list.hpp +++ b/include/boost/ptr_container/ptr_list.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_PTR_LIST_HPP #define BOOST_PTR_CONTAINER_PTR_LIST_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif diff --git a/include/boost/ptr_container/ptr_map.hpp b/include/boost/ptr_container/ptr_map.hpp index cbd39d7b..9f524065 100644 --- a/include/boost/ptr_container/ptr_map.hpp +++ b/include/boost/ptr_container/ptr_map.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_PTR_MAP_HPP #define BOOST_PTR_CONTAINER_PTR_MAP_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif diff --git a/include/boost/ptr_container/ptr_map_adapter.hpp b/include/boost/ptr_container/ptr_map_adapter.hpp index f3ce83af..4040b6a1 100644 --- a/include/boost/ptr_container/ptr_map_adapter.hpp +++ b/include/boost/ptr_container/ptr_map_adapter.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_DETAIL_PTR_MAP_ADAPTER_HPP #define BOOST_PTR_CONTAINER_DETAIL_PTR_MAP_ADAPTER_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif diff --git a/include/boost/ptr_container/ptr_sequence_adapter.hpp b/include/boost/ptr_container/ptr_sequence_adapter.hpp index a7717ed8..b1595da1 100644 --- a/include/boost/ptr_container/ptr_sequence_adapter.hpp +++ b/include/boost/ptr_container/ptr_sequence_adapter.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_PTR_SEQUENCE_ADAPTER_HPP #define BOOST_PTR_CONTAINER_PTR_SEQUENCE_ADAPTER_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif @@ -664,7 +664,7 @@ namespace ptr_container_detail } - void range_check_impl( iterator first, iterator last, + void range_check_impl( iterator, iterator, std::bidirectional_iterator_tag ) { /* do nothing */ } diff --git a/include/boost/ptr_container/ptr_set.hpp b/include/boost/ptr_container/ptr_set.hpp index 74bfa412..24c8aa7b 100644 --- a/include/boost/ptr_container/ptr_set.hpp +++ b/include/boost/ptr_container/ptr_set.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_PTR_SET_HPP #define BOOST_PTR_CONTAINER_PTR_SET_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif diff --git a/include/boost/ptr_container/ptr_set_adapter.hpp b/include/boost/ptr_container/ptr_set_adapter.hpp index 4b6aacd6..1d47359c 100644 --- a/include/boost/ptr_container/ptr_set_adapter.hpp +++ b/include/boost/ptr_container/ptr_set_adapter.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_PTR_SET_ADAPTER_HPP #define BOOST_PTR_CONTAINER_PTR_SET_ADAPTER_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif diff --git a/include/boost/ptr_container/ptr_unordered_map.hpp b/include/boost/ptr_container/ptr_unordered_map.hpp index b881584a..8dd75109 100644 --- a/include/boost/ptr_container/ptr_unordered_map.hpp +++ b/include/boost/ptr_container/ptr_unordered_map.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_PTR_UNORDERED_MAP_HPP #define BOOST_PTR_CONTAINER_PTR_UNORDERED_MAP_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif diff --git a/include/boost/ptr_container/ptr_unordered_set.hpp b/include/boost/ptr_container/ptr_unordered_set.hpp index 49ec464e..827524e8 100644 --- a/include/boost/ptr_container/ptr_unordered_set.hpp +++ b/include/boost/ptr_container/ptr_unordered_set.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_PTR_UNORDERED_SET_HPP #define BOOST_PTR_CONTAINER_PTR_UNORDERED_SET_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif diff --git a/include/boost/ptr_container/ptr_vector.hpp b/include/boost/ptr_container/ptr_vector.hpp index ee42095b..12596110 100644 --- a/include/boost/ptr_container/ptr_vector.hpp +++ b/include/boost/ptr_container/ptr_vector.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_PTR_CONTAINER_PTR_VECTOR_HPP #define BOOST_PTR_CONTAINER_PTR_VECTOR_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) # pragma once #endif diff --git a/test/associative_test_data.hpp b/test/associative_test_data.hpp index 3f3d9ad8..b689fe29 100644 --- a/test/associative_test_data.hpp +++ b/test/associative_test_data.hpp @@ -55,7 +55,7 @@ void ptr_set_test() { using namespace boost; - BOOST_MESSAGE( "starting associative container test" ); + BOOST_TEST_MESSAGE( "starting associative container test" ); enum { max_cnt = 10, size = 100 }; C c; BOOST_CHECK( c.size() == 0 ); @@ -67,7 +67,7 @@ void ptr_set_test() C c3; - BOOST_MESSAGE( "finished construction test" ); + BOOST_TEST_MESSAGE( "finished construction test" ); C a_copy( c ); BOOST_CHECK_EQUAL( a_copy.size(), c.size() ); @@ -78,7 +78,7 @@ void ptr_set_test() a_copy = a_copy; BOOST_CHECK( a_copy.empty() ); - BOOST_MESSAGE( "finished copying test" ); + BOOST_TEST_MESSAGE( "finished copying test" ); BOOST_DEDUCED_TYPENAME C::allocator_type alloc = c.get_allocator(); BOOST_DEDUCED_TYPENAME C::iterator i = c.begin(); @@ -88,7 +88,7 @@ void ptr_set_test() BOOST_DEDUCED_TYPENAME C::iterator i2 = c.end(); BOOST_DEDUCED_TYPENAME C::const_iterator ci2 = c2.begin(); - BOOST_MESSAGE( "finished iterator test" ); + BOOST_TEST_MESSAGE( "finished iterator test" ); BOOST_DEDUCED_TYPENAME C::size_type s = c.size(); BOOST_DEDUCED_TYPENAME C::size_type s2 = c.max_size(); @@ -96,7 +96,7 @@ void ptr_set_test() BOOST_CHECK_EQUAL( c.size(), s ); bool b = c.empty(); hide_warning(b); - BOOST_MESSAGE( "finished accessors test" ); + BOOST_TEST_MESSAGE( "finished accessors test" ); T* t = new T; c.insert( c.end(), t ); @@ -126,13 +126,13 @@ void ptr_set_test() // c3.erase( boost::make_iterator_range(c3) ); BOOST_CHECK( c3.empty() ); - BOOST_MESSAGE( "finished modifiers test" ); + BOOST_TEST_MESSAGE( "finished modifiers test" ); c.insert( c.end(), new T ); typename C::auto_type ptr2 = c.release( c.begin() ); std::auto_ptr ap2 = c.release(); c = c2.clone(); - BOOST_MESSAGE( "finished release/clone test" ); + BOOST_TEST_MESSAGE( "finished release/clone test" ); c3.insert( new T ); c3.insert( new T ); @@ -165,12 +165,12 @@ void ptr_set_test() BOOST_CHECK( c3.empty() ); #endif - BOOST_MESSAGE( "finished transfer test" ); + BOOST_TEST_MESSAGE( "finished transfer test" ); C c4; c4.swap(c3); swap(c4,c3); - BOOST_MESSAGE( "finished set/map interface test" ); + BOOST_TEST_MESSAGE( "finished set/map interface test" ); sub_range sub; sub_range csub; @@ -185,7 +185,7 @@ void ptr_set_test() csub = c2.equal_range( *t ); delete t; - BOOST_MESSAGE( "finished algorithms interface test" ); + BOOST_TEST_MESSAGE( "finished algorithms interface test" ); } diff --git a/test/ptr_array.cpp b/test/ptr_array.cpp old mode 100755 new mode 100644 index 0d9718ee..ea12db25 --- a/test/ptr_array.cpp +++ b/test/ptr_array.cpp @@ -97,7 +97,7 @@ void test_array() derived.replace( 1, new Derived_class ); ptr_array base( derived ); - BOOST_MESSAGE( "finished derived to base test" ); + BOOST_TEST_MESSAGE( "finished derived to base test" ); base = derived; ptr_array base2( base ); @@ -124,12 +124,12 @@ void test_array_interface() BOOST_DEDUCED_TYPENAME C::reverse_iterator rv2 = c.rend(); BOOST_DEDUCED_TYPENAME C::const_reverse_iterator cvr2 = c2.rend(); - BOOST_MESSAGE( "finished iterator test" ); + BOOST_TEST_MESSAGE( "finished iterator test" ); BOOST_CHECK_EQUAL( c.empty(), false ); BOOST_CHECK_EQUAL( c.size(), c.max_size() ); - BOOST_MESSAGE( "finished capacity test" ); + BOOST_TEST_MESSAGE( "finished capacity test" ); BOOST_CHECK_EQUAL( c.is_null(0), false ); BOOST_CHECK_EQUAL( c.is_null(1), false ); @@ -154,7 +154,7 @@ void test_array_interface() for( size_t i = 0; i < c3.size(); ++i ) BOOST_CHECK_EQUAL( c3.is_null(i), true ); - BOOST_MESSAGE( "finished element access test" ); + BOOST_TEST_MESSAGE( "finished element access test" ); } using boost::unit_test::test_suite; diff --git a/test/ptr_circular_buffer.cpp b/test/ptr_circular_buffer.cpp index 90d1b8b4..95a532a9 100644 --- a/test/ptr_circular_buffer.cpp +++ b/test/ptr_circular_buffer.cpp @@ -53,7 +53,7 @@ void test_ptr_circular_buffer() random_access_algorithms_test< ptr_circular_buffer >(); - BOOST_MESSAGE( "starting ptr_circular_buffer test" ); + BOOST_TEST_MESSAGE( "starting ptr_circular_buffer test" ); ptr_circular_buffer vec( 100u ); BOOST_CHECK( vec.capacity() >= 100u ); @@ -89,7 +89,7 @@ void test_ptr_circular_buffer() BOOST_CHECK( vec2 <= vec ); BOOST_CHECK( vec >= vec2 ); - BOOST_MESSAGE( "push_front test" ); + BOOST_TEST_MESSAGE( "push_front test" ); assign::push_front( vec2 ) ( new int(2) ) ( new int(4) ) @@ -105,7 +105,7 @@ void test_ptr_circular_buffer() vec2.rresize( 0 ); //vec2.reverse(); - BOOST_MESSAGE( "when full test" ); + BOOST_TEST_MESSAGE( "when full test" ); ptr_circular_buffer vec3; BOOST_CHECK_EQUAL( vec3.capacity(), 0u ); @@ -134,7 +134,7 @@ void test_ptr_circular_buffer() BOOST_CHECK_EQUAL( vec3.front(), 6 ); BOOST_CHECK_EQUAL( vec3.back(), 2 ); - BOOST_MESSAGE( "transfer test" ); + BOOST_TEST_MESSAGE( "transfer test" ); ptr_circular_buffer vec4(2u); vec4.transfer( vec4.end(), vec3 ); BOOST_CHECK_EQUAL( vec4.size(), 2u ); @@ -145,11 +145,11 @@ void test_ptr_circular_buffer() BOOST_CHECK_EQUAL( vec3.size(), 1u ); BOOST_CHECK_EQUAL( vec3.front(), 2 ); - BOOST_MESSAGE( "rerase test" ); + BOOST_TEST_MESSAGE( "rerase test" ); vec.rerase( vec.begin() ); vec.rerase( boost::make_iterator_range( vec ) ); - BOOST_MESSAGE( "array test" ); + BOOST_TEST_MESSAGE( "array test" ); const int data_size = 10; int** array = new int*[data_size]; for( int i = 0; i != data_size; ++i ) @@ -165,7 +165,7 @@ void test_ptr_circular_buffer() const_array_range = const_cast< const ptr_circular_buffer& >(vec).array_one(); const_array_range = const_cast< const ptr_circular_buffer& >(vec).array_two(); - BOOST_MESSAGE( "finishing ptr_circular_buffer test" ); + BOOST_TEST_MESSAGE( "finishing ptr_circular_buffer test" ); } diff --git a/test/ptr_container_adapter.cpp b/test/ptr_container_adapter.cpp old mode 100755 new mode 100644 index 2dcc978b..33664298 --- a/test/ptr_container_adapter.cpp +++ b/test/ptr_container_adapter.cpp @@ -51,9 +51,9 @@ void test_container_adapter() // algo_test_polymorphic< ptr_list, Derived_class >(); } -#include +#include -using boost::unit_test_framework::test_suite; +using boost::unit_test::test_suite; test_suite* init_unit_test_suite( int argc, char* argv[] ) { diff --git a/test/ptr_map.cpp b/test/ptr_map.cpp index 9b5cc709..68f09a48 100644 --- a/test/ptr_map.cpp +++ b/test/ptr_map.cpp @@ -85,7 +85,7 @@ void ptr_map_test() { using namespace boost; - BOOST_MESSAGE( "starting associative container test" ); + BOOST_TEST_MESSAGE( "starting associative container test" ); enum { max_cnt = 10, size = 100 }; C c; BOOST_CHECK( c.size() == 0 ); @@ -95,7 +95,7 @@ void ptr_map_test() C c3; - BOOST_MESSAGE( "finished construction test" ); + BOOST_TEST_MESSAGE( "finished construction test" ); BOOST_DEDUCED_TYPENAME C::allocator_type alloc = c.get_allocator(); BOOST_DEDUCED_TYPENAME C::iterator i = c.begin(); @@ -109,7 +109,7 @@ void ptr_map_test() BOOST_DEDUCED_TYPENAME C::key_type a_key; - BOOST_MESSAGE( "finished iterator test" ); + BOOST_TEST_MESSAGE( "finished iterator test" ); BOOST_DEDUCED_TYPENAME C::size_type s = c.size(); BOOST_DEDUCED_TYPENAME C::size_type s2 = c.max_size(); @@ -117,7 +117,7 @@ void ptr_map_test() BOOST_CHECK_EQUAL( c.size(), s ); bool b = c.empty(); hide_warning(b); - BOOST_MESSAGE( "finished accessors test" ); + BOOST_TEST_MESSAGE( "finished accessors test" ); a_key = get_next_key( a_key ); c.insert( a_key, new T ); @@ -136,7 +136,7 @@ void ptr_map_test() BOOST_CHECK( !c3.empty() ); c3.clear(); BOOST_CHECK( c3.empty() ); - BOOST_MESSAGE( "finished modifiers test" ); + BOOST_TEST_MESSAGE( "finished modifiers test" ); a_key = get_next_key( a_key ); @@ -146,7 +146,7 @@ void ptr_map_test() typename C::auto_type ptr2 = c.release( c.begin() ); std::auto_ptr ap = c.release(); c = c2.clone(); - BOOST_MESSAGE( "finished release/clone test" ); + BOOST_TEST_MESSAGE( "finished release/clone test" ); a_key = get_next_key( a_key ); @@ -168,12 +168,12 @@ void ptr_map_test() BOOST_CHECK( c3.empty() ); c3. BOOST_NESTED_TEMPLATE transfer(c); #endif - BOOST_MESSAGE( "finished transfer test" ); + BOOST_TEST_MESSAGE( "finished transfer test" ); BOOST_CHECK( !c3.empty() ); c3.replace( c3.begin(), new T ); c3.replace( c3.begin(), std::auto_ptr( new T ) ); - BOOST_MESSAGE( "finished set/map interface test" ); + BOOST_TEST_MESSAGE( "finished set/map interface test" ); // @todo: make macro with algorithms so that the right erase() is called. // c.unique(); @@ -208,7 +208,7 @@ void ptr_map_test() catch( const bad_ptr_container_operation& ) { } - BOOST_MESSAGE( "finished algorithms interface test" ); + BOOST_TEST_MESSAGE( "finished algorithms interface test" ); typename C::iterator it = c.begin(), e = c.end(); for( ; it != e; ++it ) @@ -235,7 +235,7 @@ void ptr_map_test() // << crit.base().value() << " key = " << crit.base().key(); } - BOOST_MESSAGE( "finished iterator test" ); + BOOST_TEST_MESSAGE( "finished iterator test" ); a_key = get_next_key( a_key ); c.insert( a_key, new T ); diff --git a/test/ptr_map_adapter.cpp b/test/ptr_map_adapter.cpp index ba94c97c..af5d0b70 100644 --- a/test/ptr_map_adapter.cpp +++ b/test/ptr_map_adapter.cpp @@ -61,9 +61,9 @@ void test_ptr_map_adapter() } -#include +#include -using boost::unit_test_framework::test_suite; +using boost::unit_test::test_suite; test_suite* init_unit_test_suite( int argc, char* argv[] ) { diff --git a/test/ptr_unordered_map.cpp b/test/ptr_unordered_map.cpp index 5685a162..f01818c8 100644 --- a/test/ptr_unordered_map.cpp +++ b/test/ptr_unordered_map.cpp @@ -91,7 +91,7 @@ void ptr_map_test() { using namespace boost; - BOOST_MESSAGE( "starting associative container test" ); + BOOST_TEST_MESSAGE( "starting associative container test" ); enum { max_cnt = 10, size = 100 }; C c; BOOST_CHECK( c.size() == 0 ); @@ -101,7 +101,7 @@ void ptr_map_test() C c3; - BOOST_MESSAGE( "finished construction test" ); + BOOST_TEST_MESSAGE( "finished construction test" ); BOOST_DEDUCED_TYPENAME C::allocator_type alloc = c.get_allocator(); BOOST_DEDUCED_TYPENAME C::iterator i = c.begin(); @@ -113,7 +113,7 @@ void ptr_map_test() BOOST_DEDUCED_TYPENAME C::key_type a_key; - BOOST_MESSAGE( "finished iterator test" ); + BOOST_TEST_MESSAGE( "finished iterator test" ); BOOST_DEDUCED_TYPENAME C::size_type s = c.size(); BOOST_DEDUCED_TYPENAME C::size_type s2 = c.max_size(); @@ -121,7 +121,7 @@ void ptr_map_test() BOOST_CHECK_EQUAL( c.size(), s ); bool b = c.empty(); hide_warning(b); - BOOST_MESSAGE( "finished accessors test" ); + BOOST_TEST_MESSAGE( "finished accessors test" ); a_key = get_next_key( a_key ); c.insert( a_key, new T ); @@ -140,7 +140,7 @@ void ptr_map_test() BOOST_CHECK( !c3.empty() ); c3.clear(); BOOST_CHECK( c3.empty() ); - BOOST_MESSAGE( "finished modifiers test" ); + BOOST_TEST_MESSAGE( "finished modifiers test" ); a_key = get_next_key( a_key ); @@ -150,7 +150,7 @@ void ptr_map_test() typename C::auto_type ptr2 = c.release( c.begin() ); std::auto_ptr ap = c.release(); c = c2.clone(); - BOOST_MESSAGE( "finished release/clone test" ); + BOOST_TEST_MESSAGE( "finished release/clone test" ); a_key = get_next_key( a_key ); @@ -172,12 +172,12 @@ void ptr_map_test() BOOST_CHECK( c3.empty() ); c3. BOOST_NESTED_TEMPLATE transfer(c); #endif - BOOST_MESSAGE( "finished transfer test" ); + BOOST_TEST_MESSAGE( "finished transfer test" ); BOOST_CHECK( !c3.empty() ); c3.replace( c3.begin(), new T ); c3.replace( c3.begin(), std::auto_ptr( new T ) ); - BOOST_MESSAGE( "finished set/map interface test" ); + BOOST_TEST_MESSAGE( "finished set/map interface test" ); // @todo: make macro with algorithms so that the right erase() is called. // c.unique(); @@ -208,7 +208,7 @@ void ptr_map_test() catch( const bad_ptr_container_operation& ) { } - BOOST_MESSAGE( "finished algorithms interface test" ); + BOOST_TEST_MESSAGE( "finished algorithms interface test" ); typename C::iterator it = c.begin(), e = c.end(); for( ; it != e; ++it ) @@ -217,7 +217,7 @@ void ptr_map_test() //std::cout << "\n mapped value = " << it.value() << " key = " << it.key(); } - BOOST_MESSAGE( "finished iterator test" ); + BOOST_TEST_MESSAGE( "finished iterator test" ); a_key = get_next_key( a_key ); c.insert( a_key, new T ); diff --git a/test/sequence_test_data.hpp b/test/sequence_test_data.hpp index e9cf8732..d6f40904 100644 --- a/test/sequence_test_data.hpp +++ b/test/sequence_test_data.hpp @@ -24,7 +24,7 @@ void reversible_container_test() { using namespace boost; - BOOST_MESSAGE( "starting reversible container test" ); + BOOST_TEST_MESSAGE( "starting reversible container test" ); enum { max_cnt = 10, size = 100 }; C c; set_capacity()( c ); @@ -46,7 +46,7 @@ void reversible_container_test() c.assign( c3 ); set_capacity()( c ); - BOOST_MESSAGE( "finished construction test" ); + BOOST_TEST_MESSAGE( "finished construction test" ); C a_copy( c ); BOOST_CHECK_EQUAL( a_copy.size(), c.size() ); @@ -56,7 +56,7 @@ void reversible_container_test() a_copy = a_copy; BOOST_CHECK( a_copy.empty() ); BOOST_CHECK( !c.empty() ); - BOOST_MESSAGE( "finished copying test" ); + BOOST_TEST_MESSAGE( "finished copying test" ); BOOST_DEDUCED_TYPENAME C::allocator_type alloc = c.get_allocator(); hide_warning(alloc); @@ -75,7 +75,7 @@ void reversible_container_test() BOOST_CHECK_EQUAL( std::distance( c.rbegin(), c.rend() ), std::distance( c.begin(), c.end() ) ); - BOOST_MESSAGE( "finished iterator test" ); + BOOST_TEST_MESSAGE( "finished iterator test" ); BOOST_DEDUCED_TYPENAME C::size_type s = c.size(); hide_warning(s); @@ -95,7 +95,7 @@ void reversible_container_test() hide_warning(r2); BOOST_DEDUCED_TYPENAME C::const_reference cr2 = c2.back(); hide_warning(cr2); - BOOST_MESSAGE( "finished accessors test" ); + BOOST_TEST_MESSAGE( "finished accessors test" ); c.push_back( new T ); BOOST_CHECK_EQUAL( c.size(), 4u ); @@ -127,7 +127,7 @@ void reversible_container_test() #else swap(c4,c3); #endif - BOOST_MESSAGE( "finished modifiers test" ); + BOOST_TEST_MESSAGE( "finished modifiers test" ); c.push_back( new T ); c.push_back( new T ); c.push_back( new T ); typedef BOOST_DEDUCED_TYPENAME C::auto_type auto_type; @@ -141,7 +141,7 @@ void reversible_container_test() BOOST_CHECK( !c.empty() ); auto_type ptr2 = c.replace( c.begin(), new T ); ptr2 = c.replace( c.begin(), std::auto_ptr( new T ) ); - BOOST_MESSAGE( "finished release/clone/replace test" ); + BOOST_TEST_MESSAGE( "finished release/clone/replace test" ); c3.push_back( new T ); c3.push_back( new T ); @@ -157,7 +157,7 @@ void reversible_container_test() c3. BOOST_NESTED_TEMPLATE transfer( c3.begin(), c ); BOOST_CHECK( !c3.empty() ); BOOST_CHECK( c.empty() ); - BOOST_MESSAGE( "finished transfer test" ); + BOOST_TEST_MESSAGE( "finished transfer test" ); c3.resize( 0u ); BOOST_CHECK( c3.empty() ); @@ -165,7 +165,7 @@ void reversible_container_test() BOOST_CHECK_EQUAL( c3.size(), 10u ); c3.resize( 12u, &*c3.begin() ); BOOST_CHECK_EQUAL( c3.size(), 12u ); - BOOST_MESSAGE( "finished resize test" ); + BOOST_TEST_MESSAGE( "finished resize test" ); } @@ -174,7 +174,7 @@ void reversible_container_test() template< class CDerived, class CBase, class T > void test_transfer() { - BOOST_MESSAGE( "starting transfer test" ); + BOOST_TEST_MESSAGE( "starting transfer test" ); CDerived from; CBase to; @@ -184,7 +184,7 @@ void test_transfer() from.push_back( new T ); from.push_back( new T ); to. BOOST_NESTED_TEMPLATE transfer( to.end(), from ); - BOOST_MESSAGE( "finished transfer test" ); + BOOST_TEST_MESSAGE( "finished transfer test" ); } @@ -236,7 +236,7 @@ struct equal_to_int template< class IntContainer > void random_access_algorithms_test() { - BOOST_MESSAGE( "starting random accessors algorithms test" ); + BOOST_TEST_MESSAGE( "starting random accessors algorithms test" ); IntContainer c; set_capacity()( c ); @@ -296,6 +296,6 @@ void random_access_algorithms_test() BOOST_CHECK( c2.empty() ); BOOST_CHECK( c.size() == 9u ); BOOST_CHECK( is_sorted< std::less_equal >( c ) ); - BOOST_MESSAGE( "finished random accessors algorithms test" ); + BOOST_TEST_MESSAGE( "finished random accessors algorithms test" ); } diff --git a/test/test_data.hpp b/test/test_data.hpp index 148d78ae..64f9d497 100644 --- a/test/test_data.hpp +++ b/test/test_data.hpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include @@ -287,11 +287,11 @@ struct set_capacity template< class Cont1, class Cont2 > void transfer_test( Cont1& from, Cont2& to ) { - BOOST_MESSAGE( "starting container transfer test" ); + BOOST_TEST_MESSAGE( "starting container transfer test" ); BOOST_CHECK( !from.empty() ); to. BOOST_NESTED_TEMPLATE transfer( from ); BOOST_CHECK( !to.empty() ); - BOOST_MESSAGE( "finishing container transfer test" ); + BOOST_TEST_MESSAGE( "finishing container transfer test" ); } @@ -302,7 +302,7 @@ void transfer_test( Cont1& from, Cont2& to ) template< class BaseContainer, class DerivedContainer, class Derived > void container_assignment_test() { - BOOST_MESSAGE( "starting container assignment test" ); + BOOST_TEST_MESSAGE( "starting container assignment test" ); DerivedContainer derived; set_capacity()( derived ); @@ -320,7 +320,7 @@ void container_assignment_test() BOOST_CHECK_EQUAL( base2.size(), base.size() ); base = base; - BOOST_MESSAGE( "finished container assignment test" ); + BOOST_TEST_MESSAGE( "finished container assignment test" ); }