]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_objectstore_test: fix warnings
authorSage Weil <sage@redhat.com>
Mon, 14 Sep 2015 19:24:08 +0000 (15:24 -0400)
committerSage Weil <sage@redhat.com>
Mon, 14 Sep 2015 20:33:39 +0000 (16:33 -0400)
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<lhs_is_null_literal>::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<lhs_is_null_literal>::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<lhs_is_null_literal>::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<lhs_is_null_literal>::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 <sage@redhat.com>
src/test/objectstore/store_test.cc

index 8e9ca112226036ce4c1b3e0416b7bae048f60778..3a47d120f1437f24e25b3d8874fc0db6e88a4b49 100644 (file)
@@ -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<string,bufferlist> 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<string,bufferlist> 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();