]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test,pybind: silence -Wsign-compare warnings
authorKefu Chai <kchai@redhat.com>
Wed, 31 Aug 2016 10:44:36 +0000 (18:44 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 31 Aug 2016 10:44:36 +0000 (18:44 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/rbd/rbd.pyx
src/test/msgr/test_msgr.cc
src/test/objectstore/Allocator_test.cc

index 3fefadca3ded46b10b5860f6e0ac2f3376cb147f..792b07a21251bed7abb714732595e69b3f06b9c7 100644 (file)
@@ -1808,7 +1808,7 @@ cdef class Image(object):
         with nogil:
             ret = rbd_write2(self.image, _offset, length, _data, _fadvise_flags)
 
-        if ret == length:
+        if ret == <ssize_t>length:
             return ret
         elif ret < 0:
             raise make_ex(ret, "error writing to %s" % (self.name,))
index bb1a55ae274a4f422370550bd934f4e6a670a7a5..1c87a354ce8128e4245e346979b1d3ef2255aca5 100644 (file)
@@ -558,7 +558,7 @@ TEST_P(MessengerTest, StatelessTest) {
     while (!srv_dispatcher.got_new)
       srv_dispatcher.cond.Wait(srv_dispatcher.lock);
   }
-  ASSERT_EQ(static_cast<Session*>(server_conn->get_priv())->get_count(), 1);
+  ASSERT_EQ(1U, static_cast<Session*>(server_conn->get_priv())->get_count());
 
   // 2. test for client lossy
   server_conn->mark_down();
index c72468141f6b7c584ae4327dc5a7f2a0fcef4ae6..16abd35be6027f3654beb992780b9380f2ef2880 100644 (file)
@@ -41,7 +41,7 @@ TEST_P(AllocTest, test_alloc_init)
   alloc->shutdown(); 
   blocks = BitMapZone::get_total_blocks() * 2 + 16;
   init_alloc(blocks, 1);
-  ASSERT_EQ(alloc->get_free(), 0);
+  ASSERT_EQ(0U, alloc->get_free());
   alloc->shutdown(); 
   blocks = BitMapZone::get_total_blocks() * 2;
   init_alloc(blocks, 1);
@@ -91,7 +91,7 @@ TEST_P(AllocTest, test_alloc_min_alloc)
                                    0, (int64_t) 0, &extents, &count), 0);
     EXPECT_EQ(extents[0].length, 2 * block_size);
     EXPECT_EQ(extents[1].length, 2 * block_size);
-    EXPECT_EQ(extents[2].length, 0);
+    EXPECT_EQ(0U, extents[2].length);
     EXPECT_EQ(count, 2);
   }
   alloc->shutdown();