]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test_cls_rbd: avoid warning -Wno-unnamed-template-args
authorNoah Watkins <noahwatkins@gmail.com>
Mon, 30 Dec 2013 20:43:57 +0000 (12:43 -0800)
committerNoah Watkins <noahwatkins@gmail.com>
Mon, 30 Dec 2013 20:58:37 +0000 (12:58 -0800)
According to this https://code.google.com/p/googletest/source/detail?r=446
the use of unnamed types (in this case the protection flag enums from
librbd/parent_types.h) as template parameters (in this case the gtest
macros) is not valid C++ pre C++0x.

As suggested, converting the enum into an int with integral promotion
via unary plus operator solves the problem.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
src/test/cls_rbd/test_cls_rbd.cc

index da41d5596728a9f0db96ebeb7b767df40f141df7..efa44fcff5dd00c1bb4b5b7a31017baab2e26325 100644 (file)
@@ -476,37 +476,37 @@ TEST(cls_rbd, protection_status)
   ASSERT_EQ(0, snapshot_add(&ioctx, "foo", 10, "snap1"));
   ASSERT_EQ(0, get_protection_status(&ioctx, "foo",
                                     10, &status));
-  ASSERT_EQ(RBD_PROTECTION_STATUS_UNPROTECTED, status);
+  ASSERT_EQ(+RBD_PROTECTION_STATUS_UNPROTECTED, status);
 
   ASSERT_EQ(0, set_protection_status(&ioctx, "foo",
                                     10, RBD_PROTECTION_STATUS_PROTECTED));
   ASSERT_EQ(0, get_protection_status(&ioctx, "foo",
                                     10, &status));
-  ASSERT_EQ(RBD_PROTECTION_STATUS_PROTECTED, status);
+  ASSERT_EQ(+RBD_PROTECTION_STATUS_PROTECTED, status);
   ASSERT_EQ(-EBUSY, snapshot_remove(&ioctx, "foo", 10));
 
   ASSERT_EQ(0, set_protection_status(&ioctx, "foo",
                                     10, RBD_PROTECTION_STATUS_UNPROTECTING));
   ASSERT_EQ(0, get_protection_status(&ioctx, "foo",
                                     10, &status));
-  ASSERT_EQ(RBD_PROTECTION_STATUS_UNPROTECTING, status);
+  ASSERT_EQ(+RBD_PROTECTION_STATUS_UNPROTECTING, status);
   ASSERT_EQ(-EBUSY, snapshot_remove(&ioctx, "foo", 10));
 
   ASSERT_EQ(-EINVAL, set_protection_status(&ioctx, "foo",
                                           10, RBD_PROTECTION_STATUS_LAST));
   ASSERT_EQ(0, get_protection_status(&ioctx, "foo",
                                     10, &status));
-  ASSERT_EQ(RBD_PROTECTION_STATUS_UNPROTECTING, status);
+  ASSERT_EQ(+RBD_PROTECTION_STATUS_UNPROTECTING, status);
 
   ASSERT_EQ(0, snapshot_add(&ioctx, "foo", 20, "snap2"));
   ASSERT_EQ(0, get_protection_status(&ioctx, "foo",
                                     20, &status));
-  ASSERT_EQ(RBD_PROTECTION_STATUS_UNPROTECTED, status);
+  ASSERT_EQ(+RBD_PROTECTION_STATUS_UNPROTECTED, status);
   ASSERT_EQ(0, set_protection_status(&ioctx, "foo",
                                     10, RBD_PROTECTION_STATUS_UNPROTECTED));
   ASSERT_EQ(0, get_protection_status(&ioctx, "foo",
                                     10, &status));
-  ASSERT_EQ(RBD_PROTECTION_STATUS_UNPROTECTED, status);
+  ASSERT_EQ(+RBD_PROTECTION_STATUS_UNPROTECTED, status);
 
   ASSERT_EQ(0, snapshot_remove(&ioctx, "foo", 10));
   ASSERT_EQ(0, snapshot_remove(&ioctx, "foo", 20));