]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/objectstore: fix a -Wsign-compare warning in compiling.
authorDongsheng Yang <dongsheng.yang@easystack.cn>
Wed, 30 Mar 2016 02:36:49 +0000 (22:36 -0400)
committerDongsheng Yang <dongsheng.yang@easystack.cn>
Thu, 31 Mar 2016 04:08:21 +0000 (00:08 -0400)
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<true>::Compare(const char*, const char*, const T1&, const T2&, typename testing::internal::EnableIf<(! testing::internal::is_pointer<T2>::value)>::type*) [with T1 = unsigned int; T2 = int; typename testing::internal::EnableIf<(! testing::internal::is_pointer<T2>::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 <dongsheng.yang@easystack.cn>
src/test/objectstore/store_test.cc

index d6e9203da6c03fc6672fe3d42cebf95d2c96a100..9a5de2e629f3cefdc5c4e6f1c14e210911f25e06 100644 (file)
@@ -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);