From c97ce4fc16e06a8ddc5a12c83ef5025cb4de4f79 Mon Sep 17 00:00:00 2001 From: Dongsheng Yang Date: Tue, 29 Mar 2016 22:36:49 -0400 Subject: [PATCH] test/objectstore: fix a -Wsign-compare warning in compiling. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/test/objectstore/store_test.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index d6e9203da6c..9a5de2e629f 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); -- 2.47.3