diff --git a/src/test/librados/io.cc b/src/test/librados/io.cc index 0dadf9585c5..5daca3c15ec 100644 --- a/src/test/librados/io.cc +++ b/src/test/librados/io.cc @@ -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)); diff --git a/src/test/librados/misc.cc b/src/test/librados/misc.cc index f0f8447748f..ea990b50a98 100644 --- a/src/test/librados/misc.cc +++ b/src/test/librados/misc.cc @@ -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; diff --git a/src/test/librados/snapshots.cc b/src/test/librados/snapshots.cc index e490a088379..832dcab1c80 100644 --- a/src/test/librados/snapshots.cc +++ b/src/test/librados/snapshots.cc @@ -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));