]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/container/test/global_resource_test.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / container / test / global_resource_test.cpp
index bb6e9683727d96263ab8079c547e851b90ac122b..1b2e7408515892851bcca534cfaa87a7ea6912f0 100644 (file)
@@ -86,20 +86,23 @@ void test_null_memory_resource()
 {
    //Make sure it throw or returns null
    memory_resource *mr = null_memory_resource();
+   BOOST_TEST(mr != 0);
+
    #if !defined(BOOST_NO_EXCEPTIONS)
    bool bad_allocexception_thrown = false;
-   try{
+
+   BOOST_TRY{
       mr->allocate(1, 1);
    }
-   catch(std::bad_alloc&) {
+   BOOST_CATCH(std::bad_alloc&) {
       bad_allocexception_thrown = true;
    }
-   catch(...) {
+   BOOST_CATCH(...) {
    }
+   BOOST_CATCH_END
+
    BOOST_TEST(bad_allocexception_thrown == true);
-   #else
-   BOOST_TEST(0 == mr->allocate(1, 1));
-   #endif
+   #endif   //BOOST_NO_EXCEPTIONS
 }
 
 void test_default_resource()