]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/interprocess/test/map_test.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / interprocess / test / map_test.hpp
index 0a20a787621739ffaaa7e60e482ad1c57499328e..a54f41dba60db891c64451aa0ec5a00d54ecf1b6 100644 (file)
@@ -52,7 +52,7 @@ int map_test ()
    const char *const shMemName = test::get_process_id_name();
    const int max = 100;
 
-   try{
+   BOOST_TRY{
       //Create shared memory
       shared_memory_object::remove(shMemName);
       ManagedSharedMemory segment(create_only, shMemName, memsize);
@@ -172,13 +172,13 @@ int map_test ()
       }
       {
          //This is really nasty, but we have no other simple choice
-         IntPairType aux_vect[max];
+         IntPairType aux_vect[std::size_t(max)];
          for(int i = 0; i < max; ++i){
             IntType i1(i);
             IntType i2(i);
             new(&aux_vect[i])IntPairType(boost::move(i1), boost::move(i2));
          }
-         IntPairType aux_vect3[max];
+         IntPairType aux_vect3[std::size_t(max)];
          for(int i = 0; i < max; ++i){
             IntType i1(i);
             IntType i2(i);
@@ -320,13 +320,13 @@ int map_test ()
 
       {
          //This is really nasty, but we have no other simple choice
-         IntPairType aux_vect[max];
+         IntPairType aux_vect[std::size_t(max)];
          for(int i = 0; i < max; ++i){
             IntType i1(i);
             IntType i2(i);
             new(&aux_vect[i])IntPairType(boost::move(i1), boost::move(i2));
          }
-         IntPairType aux_vect3[max];
+         IntPairType aux_vect3[std::size_t(max)];
          for(int i = 0; i < max; ++i){
             IntType i1(i);
             IntType i2(i);
@@ -452,6 +452,8 @@ int map_test ()
          shmmap->clear();
          shmmultimap->clear();
 
+         typedef typename MyShmMultiMap::size_type map_size_type;
+
          for(int j = 0; j < 3; ++j)
          for(int i = 0; i < 100; ++i){
             IntPairType intpair;
@@ -465,9 +467,9 @@ int map_test ()
                new(&intpair)IntPairType(boost::move(i1), boost::move(i2));
             }
             shmmultimap->insert(boost::move(intpair));
-            if(shmmap->count(IntType(i)) != typename MyShmMultiMap::size_type(1))
+            if(shmmap->count(IntType(i)) != map_size_type(1u))
                return 1;
-            if(shmmultimap->count(IntType(i)) != typename MyShmMultiMap::size_type(j+1))
+            if(shmmultimap->count(IntType(i)) != map_size_type(j)+1u)
                return 1;
          }
       }
@@ -482,10 +484,10 @@ int map_test ()
       if(!segment.all_memory_deallocated())
          return 1;
    }
-   catch(...){
+   BOOST_CATCH(...){
       shared_memory_object::remove(shMemName);
-      throw;
-   }
+      BOOST_RETHROW
+   } BOOST_CATCH_END
    shared_memory_object::remove(shMemName);
    return 0;
 }
@@ -505,7 +507,7 @@ int map_test_copyable ()
    const char *const shMemName = test::get_process_id_name();
    const int max = 100;
 
-   try{
+   BOOST_TRY{
    //Create shared memory
    shared_memory_object::remove(shMemName);
    ManagedSharedMemory segment(create_only, shMemName, memsize);
@@ -576,10 +578,10 @@ int map_test_copyable ()
       if(!segment.all_memory_deallocated())
          return 1;
    }
-   catch(...){
+   BOOST_CATCH(...){
       shared_memory_object::remove(shMemName);
-      throw;
-   }
+      BOOST_RETHROW
+   } BOOST_CATCH_END
    shared_memory_object::remove(shMemName);
    return 0;
 }