From: Jonas Pfefferle Date: Thu, 29 Sep 2022 20:02:56 +0000 (+0200) Subject: librbd: remove unnecessary write in cmp&write test X-Git-Tag: v18.1.0~1092^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=90f462b494a00ea8509a98a6f45207c0520720d4;p=ceph.git librbd: remove unnecessary write in cmp&write test Remove write in compare and write test that tests successful completion when bufferlist is greater then len. The write was redundant and overwritten directly after. Signed-off-by: Jonas Pfefferle --- diff --git a/src/test/librbd/test_librbd.cc b/src/test/librbd/test_librbd.cc index 3dd71977042d..a7aad4153828 100644 --- a/src/test/librbd/test_librbd.cc +++ b/src/test/librbd/test_librbd.cc @@ -4233,14 +4233,11 @@ TEST_F(TestLibRBD, TestAioCompareAndWriteSuccessBufferlistGreaterLenPP) mismatch_bl.append(&mismatch_buffer[5], 5); mismatch_bl.append(&mismatch_buffer[10], 4); - ssize_t written = image.write(off, cmp_bl.length(), cmp_bl); - ASSERT_EQ(cmp_bl.length(), written); - /* * Test len < cmp_bl & write_bl => should succeed but only compare * len bytes resp. only write len bytes */ - written = image.write(off, mismatch_bl.length(), mismatch_bl); + ssize_t written = image.write(off, mismatch_bl.length(), mismatch_bl); ASSERT_EQ(mismatch_bl.length(), written); size_t len_m1 = cmp_bl.length() - 1;