bufferlist bl;
bl.append(std::string(4096, '1'));
for (size_t i = 0; i < m_image_size; i += bl.length()) {
- ASSERT_EQ(bl.length(), ictx->io_work_queue->write(i, bl.length(),
- bufferlist{bl}, 0));
+ ASSERT_EQ((ssize_t)bl.length(),
+ ictx->io_work_queue->write(i, bl.length(),
+ bufferlist{bl}, 0));
}
ASSERT_EQ(0, snap_create(*ictx, "snap1"));
librbd::io::ReadResult read_result{&read_bl};
for (size_t i = 2 << order; i < m_image_size; i += bl.length()) {
- ASSERT_EQ(bl.length(),
+ ASSERT_EQ((ssize_t)bl.length(),
ictx2->io_work_queue->read(i, bl.length(),
librbd::io::ReadResult{read_result},
0));
bufferlist bl;
bl.append(std::string(4096, '1'));
for (size_t i = 0; i < m_image_size; i += bl.length()) {
- ASSERT_EQ(bl.length(), ictx->io_work_queue->write(i, bl.length(),
- bufferlist{bl}, 0));
+ ASSERT_EQ((ssize_t)bl.length(),
+ ictx->io_work_queue->write(i, bl.length(),
+ bufferlist{bl}, 0));
}
ASSERT_EQ(0, snap_create(*ictx, "snap1"));
librbd::io::ReadResult read_result{&read_bl};
for (size_t i = 0; i < m_image_size; i += bl.length()) {
- ASSERT_EQ(bl.length(),
+ ASSERT_EQ((ssize_t)bl.length(),
ictx2->io_work_queue->read(i, bl.length(),
librbd::io::ReadResult{read_result},
0));
bufferlist bl;
bl.append(std::string(1 << ictx->order, '1'));
- ASSERT_EQ(bl.length(),
+ ASSERT_EQ((ssize_t)bl.length(),
ictx->io_work_queue->write(0, bl.length(), bufferlist{bl}, 0));
ASSERT_EQ(0, librbd::flush(ictx));
bufferlist write_full_bl;
write_full_bl.append(std::string(1 << ictx2->order, '2'));
- ASSERT_EQ(write_full_bl.length(),
+ ASSERT_EQ((ssize_t)write_full_bl.length(),
ictx2->io_work_queue->write(0, write_full_bl.length(),
bufferlist{write_full_bl}, 0));
read_bl.push_back(read_ptr);
librbd::io::ReadResult read_result{&read_bl};
- ASSERT_EQ(read_bl.length(),
+ ASSERT_EQ((ssize_t)read_bl.length(),
ictx2->io_work_queue->read(0, read_bl.length(),
librbd::io::ReadResult{read_result}, 0));
ASSERT_TRUE(write_full_bl.contents_equal(read_bl));
ASSERT_EQ(0, librbd::snap_set(ictx2,
cls::rbd::UserSnapshotNamespace(),
"snap1"));
- ASSERT_EQ(read_bl.length(),
+ ASSERT_EQ((ssize_t)read_bl.length(),
ictx2->io_work_queue->read(0, read_bl.length(),
librbd::io::ReadResult{read_result}, 0));
ASSERT_TRUE(bl.contents_equal(read_bl));
sizeof(read_iovs) / sizeof(struct iovec),
1<<order, comp));
ASSERT_EQ(0, rbd_aio_wait_for_complete(comp));
- ASSERT_EQ(10U, rbd_aio_get_return_value(comp));
+ ASSERT_EQ(10, rbd_aio_get_return_value(comp));
rbd_aio_release(comp);
ASSERT_EQ("This1111 is a ", read_buffer);
sizeof(linear_iovs) / sizeof(struct iovec),
1<<order, comp));
ASSERT_EQ(0, rbd_aio_wait_for_complete(comp));
- ASSERT_EQ(4U, rbd_aio_get_return_value(comp));
+ ASSERT_EQ(4, rbd_aio_get_return_value(comp));
rbd_aio_release(comp);
ASSERT_EQ("1111This111111", linear_buffer);
bufferlist bl;
bl.append(std::string(4096, '1'));
- ASSERT_EQ(bl.length(), parent_image.write(0, bl.length(), bl));
+ ASSERT_EQ((ssize_t)bl.length(), parent_image.write(0, bl.length(), bl));
ASSERT_EQ(0, parent_image.snap_create("snap1"));
ASSERT_EQ(0, parent_image.snap_protect("snap1"));
bufferlist read_bl;
clone_image.aio_read(0, bl.length(), read_bl, read_comp);
ASSERT_EQ(0, read_comp->wait_for_complete());
- ASSERT_EQ(bl.length(), read_comp->get_return_value());
+ ASSERT_EQ((ssize_t)bl.length(), read_comp->get_return_value());
read_comp->release();
ASSERT_TRUE(bl.contents_equal(read_bl));
bufferlist bl;
bl.append(std::string(4096, '1'));
- ASSERT_EQ(bl.length(), image1.write(0, bl.length(), bl));
+ ASSERT_EQ((ssize_t)bl.length(), image1.write(0, bl.length(), bl));
bool lock_owner;
ASSERT_EQ(0, image1.is_exclusive_lock_owner(&lock_owner));
return;
}
- ASSERT_EQ(bl.length(), image.write(0, bl.length(), bl));
+ ASSERT_EQ((ssize_t)bl.length(), image.write(0, bl.length(), bl));
ASSERT_EQ(0, image.snap_create("snap1"));
- ASSERT_EQ(bl.length(), image.write(1<<order, bl.length(), bl));
+ ASSERT_EQ((ssize_t)bl.length(), image.write(1<<order, bl.length(), bl));
std::string image_id;
ASSERT_EQ(0, get_image_id(image, &image_id));
ASSERT_EQ(0, rbd.open(ioctx, image2, name.c_str(), NULL));
bufferlist read_bl;
- ASSERT_EQ(bl.length(), image2.read(0, bl.length(), read_bl));
+ ASSERT_EQ((ssize_t)bl.length(), image2.read(0, bl.length(), read_bl));
ASSERT_TRUE(bl.contents_equal(read_bl));
read_bl.clear();
- ASSERT_EQ(bl.length(), image2.read(1<<order, bl.length(), read_bl));
+ ASSERT_EQ((ssize_t)bl.length(), image2.read(1<<order, bl.length(), read_bl));
ASSERT_TRUE(bl.contents_equal(read_bl));
ASSERT_PASSED(validate_object_map, image1);
uint64_t features;
ASSERT_EQ(0, image.features(&features));
- ASSERT_EQ(bl1.length(), image.write(0, bl1.length(), bl1));
+ ASSERT_EQ((ssize_t)bl1.length(), image.write(0, bl1.length(), bl1));
ASSERT_EQ(0, image.snap_create("snap1"));
- ASSERT_EQ(bl1.length(), image.write(1<<order, bl1.length(), bl1));
+ ASSERT_EQ((ssize_t)bl1.length(), image.write(1<<order, bl1.length(), bl1));
}
librbd::Image image1;
ASSERT_LT(0, ioctx.read(object_map_oid, bl2, 1024, 0));
bool lock_owner;
- ASSERT_EQ(bl1.length(), image1.write(3 * (1 << 18), bl1.length(), bl1));
+ ASSERT_EQ((ssize_t)bl1.length(), image1.write(3 * (1 << 18), bl1.length(), bl1));
ASSERT_EQ(0, image1.is_exclusive_lock_owner(&lock_owner));
ASSERT_TRUE(lock_owner);
bufferlist read_bl;
image.aio_read(0, bl.length(), read_bl, read_comp);
ASSERT_EQ(0, read_comp->wait_for_complete());
- ASSERT_EQ(bl.length(), read_comp->get_return_value());
+ ASSERT_EQ((ssize_t)bl.length(), read_comp->get_return_value());
read_comp->release();
bufferlist expected_bl;
ASSERT_EQ(0, rbd.open(ioctx, image3, name.c_str(), NULL));
for (size_t object_no = 0; object_no < (size >> 12); ++object_no) {
bufferlist read_bl;
- ASSERT_EQ(bl.length(), image3.read(object_no << order, bl.length(),
- read_bl));
+ ASSERT_EQ((ssize_t)bl.length(), image3.read(object_no << order, bl.length(),
+ read_bl));
ASSERT_TRUE(bl.contents_equal(read_bl));
}