From: Sage Weil Date: Mon, 14 Sep 2015 19:24:08 +0000 (-0400) Subject: ceph_objectstore_test: fix warnings X-Git-Tag: v9.1.0~135^2~2^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=df921125b5d436bd9540b7b816710bc575494792;p=ceph.git ceph_objectstore_test: fix warnings In file included from test/objectstore/store_test.cc:34: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 = 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 = unsigned int; T2 = int; bool lhs_is_null_literal = false]’ test/objectstore/store_test.cc:411:5: 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) { ^ ../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 = int; T2 = unsigned 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 = int; T2 = unsigned int; bool lhs_is_null_literal = false]’ test/objectstore/store_test.cc:2003:7: required from here ../src/gmock/gtest/include/gtest/gtest.h:1448:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] ../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 = int; T2 = long unsigned 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 = int; T2 = long unsigned int; bool lhs_is_null_literal = false]’ test/objectstore/store_test.cc:2010:7: required from here ../src/gmock/gtest/include/gtest/gtest.h:1448:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] ../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/store_test.cc:2080:5: required from here ../src/gmock/gtest/include/gtest/gtest.h:1448:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Sage Weil --- diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index 8e9ca1122260..3a47d120f143 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -408,7 +408,7 @@ TEST_P(StoreTest, SimpleObjectTest) { bufferlist in; r = store->read(cid, hoid, 0, bl.length(), in); - ASSERT_EQ(bl.length(), r); + ASSERT_EQ((int)bl.length(), r); in.hexdump(cout); ASSERT_TRUE(in.contents_equal(bl)); } @@ -2000,14 +2000,14 @@ TEST_P(StoreTest, OMapTest) { bufferlist hdr; map m; store->omap_get(cid, hoid, &hdr, &m); - ASSERT_EQ(6, hdr.length()); + ASSERT_EQ(6u, hdr.length()); ASSERT_TRUE(m.count("2")); ASSERT_TRUE(!m.count("3")); ASSERT_TRUE(!m.count("6")); ASSERT_TRUE(m.count("7")); ASSERT_TRUE(m.count("8")); //cout << m << std::endl; - ASSERT_EQ(6, m.size()); + ASSERT_EQ(6u, m.size()); } { ObjectStore::Transaction t; @@ -2018,8 +2018,8 @@ TEST_P(StoreTest, OMapTest) { bufferlist hdr; map m; store->omap_get(cid, hoid, &hdr, &m); - ASSERT_EQ(0, hdr.length()); - ASSERT_EQ(0, m.size()); + ASSERT_EQ(0u, hdr.length()); + ASSERT_EQ(0u, m.size()); } } @@ -2077,7 +2077,7 @@ TEST_P(StoreTest, OMapIterator) { } ASSERT_EQ(correct, true); } - ASSERT_EQ(attrs.size(), count); + ASSERT_EQ((int)attrs.size(), count); // FileStore may deadlock an active iterator vs apply_transaction iter = ObjectMap::ObjectMapIterator();