X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fboost%2Flibs%2Fcontainer%2Ftest%2Fglobal_resource_test.cpp;h=1b2e7408515892851bcca534cfaa87a7ea6912f0;hb=20effc670b57271cb089376d6d0800990e5218d5;hp=bb6e9683727d96263ab8079c547e851b90ac122b;hpb=a71831dadd1e1f3e0fa70405511f65cc33db0498;p=ceph.git diff --git a/ceph/src/boost/libs/container/test/global_resource_test.cpp b/ceph/src/boost/libs/container/test/global_resource_test.cpp index bb6e96837..1b2e74085 100644 --- a/ceph/src/boost/libs/container/test/global_resource_test.cpp +++ b/ceph/src/boost/libs/container/test/global_resource_test.cpp @@ -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()