From: Noah Watkins Date: Mon, 30 Dec 2013 20:43:57 +0000 (-0800) Subject: test_cls_rbd: avoid warning -Wno-unnamed-template-args X-Git-Tag: v0.75~14^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9d41fd2c8510be578a43dd138fe0cb299108984f;p=ceph.git test_cls_rbd: avoid warning -Wno-unnamed-template-args 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 --- diff --git a/src/test/cls_rbd/test_cls_rbd.cc b/src/test/cls_rbd/test_cls_rbd.cc index da41d5596728..efa44fcff5dd 100644 --- a/src/test/cls_rbd/test_cls_rbd.cc +++ b/src/test/cls_rbd/test_cls_rbd.cc @@ -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));