From 1f0c6e29c7483be5aa13e286d696123821ad9168 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 31 Aug 2016 18:44:36 +0800 Subject: [PATCH] test,pybind: silence -Wsign-compare warnings Signed-off-by: Kefu Chai --- src/pybind/rbd/rbd.pyx | 2 +- src/test/msgr/test_msgr.cc | 2 +- src/test/objectstore/Allocator_test.cc | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pybind/rbd/rbd.pyx b/src/pybind/rbd/rbd.pyx index 3fefadca3de..792b07a2125 100644 --- a/src/pybind/rbd/rbd.pyx +++ b/src/pybind/rbd/rbd.pyx @@ -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 == length: return ret elif ret < 0: raise make_ex(ret, "error writing to %s" % (self.name,)) diff --git a/src/test/msgr/test_msgr.cc b/src/test/msgr/test_msgr.cc index bb1a55ae274..1c87a354ce8 100644 --- a/src/test/msgr/test_msgr.cc +++ b/src/test/msgr/test_msgr.cc @@ -558,7 +558,7 @@ TEST_P(MessengerTest, StatelessTest) { while (!srv_dispatcher.got_new) srv_dispatcher.cond.Wait(srv_dispatcher.lock); } - ASSERT_EQ(static_cast(server_conn->get_priv())->get_count(), 1); + ASSERT_EQ(1U, static_cast(server_conn->get_priv())->get_count()); // 2. test for client lossy server_conn->mark_down(); diff --git a/src/test/objectstore/Allocator_test.cc b/src/test/objectstore/Allocator_test.cc index c72468141f6..16abd35be60 100644 --- a/src/test/objectstore/Allocator_test.cc +++ b/src/test/objectstore/Allocator_test.cc @@ -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(); -- 2.39.5