From: Dongsheng Yang Date: Wed, 30 Mar 2016 02:36:49 +0000 (-0400) Subject: test/objectstore: fix a -Wsign-compare warning in compiling. X-Git-Tag: v10.1.1~24^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c97ce4fc16e06a8ddc5a12c83ef5025cb4de4f79;p=ceph.git test/objectstore: fix a -Wsign-compare warning in compiling. In file included from test/objectstore/store_test.cc:33: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:1524:23: required from ‘static testing::AssertionResult testing::internal::EqHelper::Compare(const char*, const char*, const T1&, const T2&, typename testing::internal::EnableIf<(! testing::internal::is_pointer::value)>::type*) [with T1 = unsigned int; T2 = int; typename testing::internal::EnableIf<(! testing::internal::is_pointer::value)>::type = void]’ test/objectstore/store_test.cc:1088:285: 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: Dongsheng Yang --- diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index d6e9203da6c0..9a5de2e629f3 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -1242,7 +1242,7 @@ TEST_P(StoreTest, SimpleCloneTest) { ObjectStore::Transaction t; t.remove(cid, hoid); t.remove(cid, hoid2); - ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t))); + ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t))); } { bufferlist final; @@ -1271,7 +1271,7 @@ TEST_P(StoreTest, SimpleCloneTest) { ObjectStore::Transaction t; t.remove(cid, hoid); t.remove(cid, hoid2); - ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t))); + ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t))); } { bufferlist final; @@ -1303,7 +1303,7 @@ TEST_P(StoreTest, SimpleCloneTest) { ObjectStore::Transaction t; t.remove(cid, hoid); t.remove(cid, hoid2); - ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t))); + ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t))); } { bufferlist final; @@ -1324,7 +1324,7 @@ TEST_P(StoreTest, SimpleCloneTest) { al.append(a); final.append(a); t.write(cid, hoid, 17000, a.length(), al); - ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t))); + ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t))); bufferlist rl; ASSERT_EQ((int)final.length(), store->read(cid, hoid, 0, final.length(), rl)); @@ -1338,7 +1338,7 @@ TEST_P(StoreTest, SimpleCloneTest) { ObjectStore::Transaction t; t.remove(cid, hoid); t.remove(cid, hoid2); - ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t))); + ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t))); } { bufferptr p(1048576); @@ -1353,7 +1353,7 @@ TEST_P(StoreTest, SimpleCloneTest) { bufferlist al; al.append(a); t.write(cid, hoid, a.length(), a.length(), al); - ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t))); + ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t))); bufferlist rl; bufferlist final; final.substr_of(pl, 0, al.length()); @@ -1373,7 +1373,7 @@ TEST_P(StoreTest, SimpleCloneTest) { ObjectStore::Transaction t; t.remove(cid, hoid); t.remove(cid, hoid2); - ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t))); + ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t))); } { bufferptr p(65536); @@ -1388,7 +1388,7 @@ TEST_P(StoreTest, SimpleCloneTest) { bufferlist al; al.append(a); t.write(cid, hoid, 32768, a.length(), al); - ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t))); + ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t))); bufferlist rl; bufferlist final; final.substr_of(pl, 0, 32768); @@ -1408,7 +1408,7 @@ TEST_P(StoreTest, SimpleCloneTest) { ObjectStore::Transaction t; t.remove(cid, hoid); t.remove(cid, hoid2); - ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t))); + ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t))); } { bufferptr p(65536); @@ -1423,7 +1423,7 @@ TEST_P(StoreTest, SimpleCloneTest) { bufferlist al; al.append(a); t.write(cid, hoid, 33768, a.length(), al); - ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t))); + ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t))); bufferlist rl; bufferlist final; final.substr_of(pl, 0, 33768);