]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: fix signed/unsigned compare warning.
authorJianpeng Ma <jianpeng.ma@intel.com>
Thu, 9 Jul 2015 03:05:03 +0000 (11:05 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Thu, 9 Jul 2015 13:37:11 +0000 (21:37 +0800)
 In file included from test/objectstore/chain_xattr.cc:29:0:
../src/gmock/gtest/include/gtest/gtest.h: In instantiation of
‘testing::AssertionResult testing::internal::CmpHelperEQ(const char*,
const char*, const T1&, const T2&) [with T1 = long unsigned int; T2 =
int]’:
../src/gmock/gtest/include/gtest/gtest.h:1484:23:   required from
‘static testing::AssertionResult
testing::internal::EqHelper<lhs_is_null_literal>::Compare(const char*,
const char*, const T1&, const T2&) [with T1 = long unsigned int; T2 =
int; bool lhs_is_null_literal = false]’
test/objectstore/chain_xattr.cc:205:314:   required from here
../src/gmock/gtest/include/gtest/gtest.h:1448:16: warning: comparison
between signed and unsigned integer expressions [-Wsign-compare]
   if (expected == actual) {

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/test/objectstore/chain_xattr.cc

index 15190e7b671073e471d5c9cbe1fa00935ba0c16f..51efd5563b376e6c16d892edd72feaeb9fc782bb 100644 (file)
@@ -202,7 +202,7 @@ TEST(chain_xattr, chunk_aligned) {
     const char *aname = "user.baz";
     char buf[CHAIN_XATTR_SHORT_BLOCK_LEN*3];
     memset(buf, 'x', sizeof(buf));
-    ASSERT_EQ(sizeof(buf), chain_setxattr(file, aname, buf, sizeof(buf)));
+    ASSERT_EQ((int)sizeof(buf), chain_setxattr(file, aname, buf, sizeof(buf)));
     ASSERT_EQ(-ERANGE, chain_getxattr(file, aname, buf,
                                      CHAIN_XATTR_SHORT_BLOCK_LEN*2));
   }
@@ -211,7 +211,7 @@ TEST(chain_xattr, chunk_aligned) {
     const char *aname = "user.biz";
     char buf[CHAIN_XATTR_SHORT_BLOCK_LEN*3];
     memset(buf, 'x', sizeof(buf));
-    ASSERT_EQ(sizeof(buf), chain_fsetxattr(fd, aname, buf, sizeof(buf)));
+    ASSERT_EQ((int)sizeof(buf), chain_fsetxattr(fd, aname, buf, sizeof(buf)));
     ASSERT_EQ(-ERANGE, chain_fgetxattr(fd, aname, buf,
                                       CHAIN_XATTR_SHORT_BLOCK_LEN*2));
   }