mirror of
https://github.com/ceph/ceph
synced 2025-01-03 09:32:43 +00:00
Merge pull request #1668 from ceph/wip-librados-tests
ceph_test_rados_api_*: fix build warnings and memset ranges Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
This commit is contained in:
commit
29d83fef77
@ -621,9 +621,9 @@ TEST_F(LibRadosIoEC, OverlappingWriteRoundTrip) {
|
||||
char *buf3 = (char *)new char[dbsize];
|
||||
memset(buf, 0xcc, dbsize);
|
||||
ASSERT_EQ(0, rados_write(ioctx, "foo", buf, dbsize, 0));
|
||||
memset(buf2, 0xdd, sizeof(buf2));
|
||||
memset(buf2, 0xdd, bsize);
|
||||
ASSERT_EQ(-EOPNOTSUPP, rados_write(ioctx, "foo", buf2, bsize, 0));
|
||||
memset(buf3, 0xdd, sizeof(buf3));
|
||||
memset(buf3, 0xdd, dbsize);
|
||||
ASSERT_EQ(dbsize, rados_read(ioctx, "foo", buf3, dbsize, 0));
|
||||
// Read the same as first write
|
||||
ASSERT_EQ(0, memcmp(buf3, buf, dbsize));
|
||||
|
@ -451,7 +451,7 @@ TEST_F(LibRadosMiscPP, CloneRangePP) {
|
||||
memset(buf, 0xcc, sizeof(buf));
|
||||
bufferlist bl;
|
||||
bl.append(buf, sizeof(buf));
|
||||
ASSERT_EQ(0, (size_t)ioctx.write("foo", bl, sizeof(buf), 0));
|
||||
ASSERT_EQ(0, ioctx.write("foo", bl, sizeof(buf), 0));
|
||||
ioctx.locator_set_key("foo");
|
||||
ASSERT_EQ(0, ioctx.clone_range("bar", 0, "foo", 0, sizeof(buf)));
|
||||
bufferlist bl2;
|
||||
|
@ -610,7 +610,7 @@ TEST_F(LibRadosSnapshotsSelfManagedEC, Snap) {
|
||||
&my_snaps[0], my_snaps.size()));
|
||||
::std::reverse(my_snaps.begin(), my_snaps.end());
|
||||
char *buf2 = (char *)new char[bsize];
|
||||
memset(buf2, 0xdd, sizeof(buf2));
|
||||
memset(buf2, 0xdd, bsize);
|
||||
ASSERT_EQ(0, rados_write(ioctx, "foo", buf2, bsize, bsize));
|
||||
rados_ioctx_snap_set_read(ioctx, my_snaps[1]-1);
|
||||
char *buf3 = (char *)new char[bsize*2];
|
||||
@ -641,7 +641,7 @@ TEST_F(LibRadosSnapshotsSelfManagedEC, Rollback) {
|
||||
::std::reverse(my_snaps.begin(), my_snaps.end());
|
||||
int bsize = alignment;
|
||||
char *buf = (char *)new char[bsize];
|
||||
memset(buf, 0xcc, sizeof(buf));
|
||||
memset(buf, 0xcc, bsize);
|
||||
ASSERT_EQ(0, rados_write(ioctx, "foo", buf, bsize, 0));
|
||||
|
||||
my_snaps.push_back(-2);
|
||||
@ -651,7 +651,7 @@ TEST_F(LibRadosSnapshotsSelfManagedEC, Rollback) {
|
||||
&my_snaps[0], my_snaps.size()));
|
||||
::std::reverse(my_snaps.begin(), my_snaps.end());
|
||||
char *buf2 = (char *)new char[bsize];
|
||||
memset(buf2, 0xdd, sizeof(buf2));
|
||||
memset(buf2, 0xdd, bsize);
|
||||
|
||||
ASSERT_EQ(0, rados_write(ioctx, "foo", buf2, bsize, bsize));
|
||||
rados_ioctx_selfmanaged_snap_rollback(ioctx, "foo", my_snaps[1]);
|
||||
@ -678,7 +678,7 @@ TEST_F(LibRadosSnapshotsSelfManagedECPP, SnapPP) {
|
||||
::std::reverse(my_snaps.begin(), my_snaps.end());
|
||||
int bsize = alignment;
|
||||
char *buf = (char *)new char[bsize];
|
||||
memset(buf, 0xcc, sizeof(buf));
|
||||
memset(buf, 0xcc, bsize);
|
||||
bufferlist bl1;
|
||||
bl1.append(buf, bsize);
|
||||
ASSERT_EQ(0, ioctx.write("foo", bl1, bsize, 0));
|
||||
|
Loading…
Reference in New Issue
Block a user