From caae6c963d337df5b9bd0dd0d3144fedc0e90b0e Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Thu, 9 Jul 2015 11:05:03 +0800 Subject: [PATCH] test: fix signed/unsigned compare warning. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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::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 --- src/test/objectstore/chain_xattr.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/objectstore/chain_xattr.cc b/src/test/objectstore/chain_xattr.cc index 15190e7b67107..51efd5563b376 100644 --- a/src/test/objectstore/chain_xattr.cc +++ b/src/test/objectstore/chain_xattr.cc @@ -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)); } -- 2.39.5