]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: Suppress cppcheck error 14446/head
authorBrad Hubbard <bhubbard@redhat.com>
Tue, 11 Apr 2017 01:54:32 +0000 (11:54 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Wed, 12 Apr 2017 05:24:21 +0000 (15:24 +1000)
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
src/test/librados/io.cc
src/test/on_exit.cc

index f1a53642fa99da1101b3474e8e78a458a873303c..e3f83a63845e631e3e3929654e6df69e6d0d92c7 100644 (file)
@@ -827,12 +827,12 @@ TEST_F(LibRadosIoEC, OverlappingWriteRoundTrip) {
   char *buf = (char *)new char[dbsize];
   char *buf2 = (char *)new char[bsize];
   char *buf3 = (char *)new char[dbsize];
-  auto lam = [&] {
-            delete[] buf;
-            delete[] buf2;
-            delete[] buf3;
-          };
-  scope_guard<decltype(lam)> sg(std::forward<decltype(lam)>(lam));
+  auto cleanup = [&] {
+    delete[] buf;
+    delete[] buf2;
+    delete[] buf3;
+  };
+  scope_guard<decltype(cleanup)> sg(std::move(cleanup));
   memset(buf, 0xcc, dbsize);
   ASSERT_EQ(0, rados_write(ioctx, "foo", buf, dbsize, 0));
   memset(buf2, 0xdd, bsize);
@@ -848,11 +848,11 @@ TEST_F(LibRadosIoECPP, OverlappingWriteRoundTripPP) {
   int dbsize = bsize * 2;
   char *buf = (char *)new char[dbsize];
   char *buf2 = (char *)new char[bsize];
-  auto lam = [&] {
-            delete[] buf;
-            delete[] buf2;
-          };
-  scope_guard<decltype(lam)> sg(std::forward<decltype(lam)>(lam));
+  auto cleanup = [&] {
+    delete[] buf;
+    delete[] buf2;
+  };
+  scope_guard<decltype(cleanup)> sg(std::move(cleanup));
   memset(buf, 0xcc, dbsize);
   bufferlist bl1;
   bl1.append(buf, dbsize);
@@ -918,13 +918,13 @@ TEST_F(LibRadosIoEC, AppendRoundTrip) {
   char *buf3 = (char *)new char[alignment *2];
   int uasize = alignment/2;
   char *unalignedbuf = (char *)new char[uasize];
-  auto lam = [&] {
-            delete[] buf;
-            delete[] buf2;
-            delete[] buf3;
-            delete[] unalignedbuf;
-          };
-  scope_guard<decltype(lam)> sg(std::forward<decltype(lam)>(lam));
+  auto cleanup = [&] {
+    delete[] buf;
+    delete[] buf2;
+    delete[] buf3;
+    delete[] unalignedbuf;
+  };
+  scope_guard<decltype(cleanup)> sg(std::move(cleanup));
   memset(buf, 0xde, alignment);
   ASSERT_EQ(0, rados_append(ioctx, "foo", buf, alignment));
   memset(buf2, 0xad, alignment);
@@ -941,11 +941,11 @@ TEST_F(LibRadosIoEC, AppendRoundTrip) {
 TEST_F(LibRadosIoECPP, AppendRoundTripPP) {
   char *buf = (char *)new char[alignment];
   char *buf2 = (char *)new char[alignment];
-  auto lam = [&] {
-            delete[] buf;
-            delete[] buf2;
-          };
-  scope_guard<decltype(lam)> sg(std::forward<decltype(lam)>(lam));
+  auto cleanup = [&] {
+    delete[] buf;
+    delete[] buf2;
+  };
+  scope_guard<decltype(cleanup)> sg(std::move(cleanup));
   memset(buf, 0xde, alignment);
   bufferlist bl1;
   bl1.append(buf, alignment);
index b28d7e29f9d0307dd395e333f8ae8046679faf34..50721ac0da70a239c0f88441e65ad710a5915d01 100644 (file)
@@ -10,6 +10,7 @@
 # ifdef MAP_ANON
 #  define MAP_ANONYMOUS MAP_ANON
 # else
+// cppcheck-suppress preprocessorErrorDirective
 #  error "Don't know how to create anonymous mmap"
 # endif
 #endif