char nspace[4];
ASSERT_EQ(-ERANGE, rados_ioctx_get_namespace(ioctx, nspace, 3));
- ASSERT_EQ(strlen("ns2"), rados_ioctx_get_namespace(ioctx, nspace, sizeof(nspace)));
+ ASSERT_EQ(static_cast<int>(strlen("ns2")),
+ rados_ioctx_get_namespace(ioctx, nspace, sizeof(nspace)));
ASSERT_EQ(0, strcmp("ns2", nspace));
std::set<std::string> def, ns1, ns2, all;
} catch (buffer::error& err) {
ASSERT_TRUE(0);
}
- ASSERT_EQ(1, read_ret.refs.size());
+ ASSERT_EQ(1U, read_ret.refs.size());
}
// chunk's refcount
{
{
bufferlist in, out;
cache_ioctx.exec("bar", "refcount", "chunk_read", in, out);
- ASSERT_EQ(0, out.length());
+ ASSERT_EQ(0U, out.length());
}
// chunk's refcount
{
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;
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
}
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));
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);
}
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);
{
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");
{
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);
ObjectStore::Transaction t2;
t2.touch(test_coll, ghobject_t(existing_oid));
t2.setattr(test_coll, ghobject_t(existing_oid), OI_ATTR, enc_oi);
- ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t2)));
+ ASSERT_EQ(0, store->queue_transaction(ch, std::move(t2)));
info.last_backfill = hobject_t::get_max();
info.last_complete = eversion_t();
}