diff options
author | Kefu Chai <kchai@redhat.com> | 2018-08-20 19:27:30 +0200 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2018-08-21 15:41:50 +0200 |
commit | e8efb01a6490878514c3d594167d2eac4d35604d (patch) | |
tree | 13704833256e99651c32051213d88abc289d42e3 /src/test/objectstore | |
parent | Merge pull request #23657 from trociny/wip-wsign-compare (diff) | |
download | ceph-e8efb01a6490878514c3d594167d2eac4d35604d.tar.xz ceph-e8efb01a6490878514c3d594167d2eac4d35604d.zip |
test: silence -Wsign-compare warnings
Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'src/test/objectstore')
-rwxr-xr-x | src/test/objectstore/Allocator_bench.cc | 3 | ||||
-rw-r--r-- | src/test/objectstore/Allocator_test.cc | 12 | ||||
-rw-r--r-- | src/test/objectstore/store_test.cc | 4 | ||||
-rw-r--r-- | src/test/objectstore/test_bluestore_types.cc | 2 |
4 files changed, 12 insertions, 9 deletions
diff --git a/src/test/objectstore/Allocator_bench.cc b/src/test/objectstore/Allocator_bench.cc index 470fd32fc29..8b6563387d6 100755 --- a/src/test/objectstore/Allocator_bench.cc +++ b/src/test/objectstore/Allocator_bench.cc @@ -150,7 +150,8 @@ TEST_P(AllocTest, test_alloc_bench_seq) for (uint64_t i = 0; i < capacity; i += want_size) { tmp.clear(); - EXPECT_EQ(want_size, alloc->allocate(want_size, alloc_unit, 0, 0, &tmp)); + EXPECT_EQ(static_cast<int64_t>(want_size), + alloc->allocate(want_size, alloc_unit, 0, 0, &tmp)); if (0 == (i % (1 * 1024 * _1m))) { std::cout << "alloc " << i / 1024 / 1024 << " mb of " << capacity / 1024 / 1024 << std::endl; diff --git a/src/test/objectstore/Allocator_test.cc b/src/test/objectstore/Allocator_test.cc index 959932af9e5..8900da7dcbd 100644 --- a/src/test/objectstore/Allocator_test.cc +++ b/src/test/objectstore/Allocator_test.cc @@ -241,7 +241,8 @@ TEST_P(AllocTest, test_alloc_fragmentation) for (size_t i = 0; i < capacity / alloc_unit; ++i) { tmp.clear(); - EXPECT_EQ(want_size, alloc->allocate(want_size, alloc_unit, 0, 0, &tmp)); + EXPECT_EQ(static_cast<int64_t>(want_size), + alloc->allocate(want_size, alloc_unit, 0, 0, &tmp)); allocated.insert(allocated.end(), tmp.begin(), tmp.end()); // bitmap fragmentation calculation doesn't provide such constant @@ -267,7 +268,7 @@ TEST_P(AllocTest, test_alloc_fragmentation) } if (bitmap_alloc) { // fragmentation = one l1 slot is free + one l1 slot is partial - EXPECT_EQ(50, uint64_t(alloc->get_fragmentation(alloc_unit) * 100)); + EXPECT_EQ(50U, uint64_t(alloc->get_fragmentation(alloc_unit) * 100)); } else { // fragmentation approx = 257 intervals / 768 max intervals EXPECT_EQ(33, uint64_t(alloc->get_fragmentation(alloc_unit) * 100)); @@ -310,9 +311,10 @@ TEST_P(AllocTest, test_alloc_bug_24598) alloc->init_add_free(0x4900000, 0x100000); alloc->init_add_free(0x4b00000, 0x200000); - EXPECT_EQ(want_size, alloc->allocate(want_size, 0x100000, 0, 0, &tmp)); - EXPECT_EQ(tmp[0].offset, 0x4b00000); - EXPECT_EQ(tmp[0].length, 0x200000); + EXPECT_EQ(static_cast<int64_t>(want_size), + alloc->allocate(want_size, 0x100000, 0, 0, &tmp)); + EXPECT_EQ(tmp[0].offset, 0x4b00000U); + EXPECT_EQ(tmp[0].length, 0x200000U); EXPECT_EQ(tmp.size(), 1); } diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index 67de69f1048..57b98969653 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -6467,7 +6467,7 @@ TEST_P(StoreTestSpecificAUSize, ExcessiveFragmentation) { stringify((uint64_t)2048 * 1024 * 1024).c_str()); ASSERT_EQ(g_conf().get_val<Option::size_t>("bluefs_alloc_size"), - 1024 * 1024); + 1024 * 1024U); size_t block_size = 0x10000; StartDeferred(block_size); @@ -7025,7 +7025,7 @@ TEST_P(StoreTest, BluestoreStatistics) { { bufferlist readback; r = store->read(ch, hoid, 0, bl.length(), readback); - ASSERT_EQ(r, bl.length()); + ASSERT_EQ(static_cast<int>(bl.length()), r); ASSERT_TRUE(bl_eq(bl, readback)); } Formatter *f = Formatter::create("store_test", "json-pretty", "json-pretty"); diff --git a/src/test/objectstore/test_bluestore_types.cc b/src/test/objectstore/test_bluestore_types.cc index 09fd4d3a6c6..1f64d770f41 100644 --- a/src/test/objectstore/test_bluestore_types.cc +++ b/src/test/objectstore/test_bluestore_types.cc @@ -1447,7 +1447,7 @@ TEST(BlueStoreRepairer, StoreSpaceTracker) { BlueStoreRepairer::StoreSpaceTracker bmap0; bmap0.init((uint64_t)4096 * 1024 * 1024 * 1024, 0x1000); - ASSERT_EQ(bmap0.granularity, 2 * 1024 * 1024); + ASSERT_EQ(bmap0.granularity, 2 * 1024 * 1024U); ASSERT_EQ(bmap0.collections_bfs.size(), 2048 * 1024); ASSERT_EQ(bmap0.objects_bfs.size(), 2048 * 1024); |