]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/ptr_container/test/ptr_set.cpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / libs / ptr_container / test / ptr_set.cpp
index dcc9ea77e77365073ba6fe8a2b65af53eee933b8..c68e77dd239a84d9ac1a731012c6594fbe300ec9 100644 (file)
@@ -12,6 +12,7 @@
 #include <boost/test/unit_test.hpp>
 #include "associative_test_data.hpp"
 #include <boost/ptr_container/ptr_set.hpp>
+#include <boost/ptr_container/detail/ptr_container_disable_deprecated.hpp>
 
 template< class SetDerived, class SetBase, class T >
 void test_transfer()
@@ -61,7 +62,10 @@ void test_erase()
     BOOST_CHECK( n > 0 );   
 }
 
-
+#if defined(BOOST_PTR_CONTAINER_DISABLE_DEPRECATED)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
 
 void test_set()
 {    
@@ -84,15 +88,30 @@ void test_set()
 
     BOOST_CHECK_THROW( set.insert( 0 ), bad_ptr_container_operation );
     set.insert( new int(0) );
+#ifndef BOOST_NO_AUTO_PTR
     std::auto_ptr<int> ap( new int(1) );
     set.insert( ap );
+#endif
+#ifndef BOOST_NO_CXX11_SMART_PTR
+    std::unique_ptr<int> up( new int(2) );
+    set.insert( std::move( up ) );
+#endif
     BOOST_CHECK_THROW( (set.replace(set.begin(), 0 )), bad_ptr_container_operation );
+#ifndef BOOST_NO_AUTO_PTR
     BOOST_CHECK_THROW( (set.replace(set.begin(), std::auto_ptr<int>(0) )), bad_ptr_container_operation );
+#endif
+#ifndef BOOST_NO_CXX11_SMART_PTR
+    BOOST_CHECK_THROW( (set.replace(set.begin(), std::unique_ptr<int>(nullptr) )), bad_ptr_container_operation );
+#endif
 
     test_erase< ptr_set<Base> >();
     test_erase< ptr_multiset<Base> >();
 }
 
+#if defined(BOOST_PTR_CONTAINER_DISABLE_DEPRECATED)
+#pragma GCC diagnostic pop
+#endif
+
 using boost::unit_test::test_suite;
 
 test_suite* init_unit_test_suite( int argc, char* argv[] )
@@ -103,9 +122,3 @@ test_suite* init_unit_test_suite( int argc, char* argv[] )
 
     return test;
 }
-
-
-
-
-
-