Skip to content

Commit 3a27c3e

Browse files
committed
test/pybind/test_rados.py: add test for reversed arguments offset,length in WriteOp.zero
Before the fix, zero(0, 2) would have no effect, and read would get '12345' instead of the expected '\x00\x00345'. Signed-off-by: Wang Chao <[email protected]>
1 parent 049d7d3 commit 3a27c3e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/test/pybind/test_rados.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,11 @@ def test_write_ops(self):
515515
self.ioctx.operate_write_op(write_op, "write_ops")
516516
eq(self.ioctx.read('write_ops'), b'12\x00\x005')
517517

518+
write_op.write_full(b'12345')
519+
write_op.zero(0, 2)
520+
self.ioctx.operate_write_op(write_op, "write_ops")
521+
eq(self.ioctx.read('write_ops'), b'\x00\x00345')
522+
518523
write_op.write_full(b'12345')
519524
write_op.truncate(2)
520525
self.ioctx.operate_write_op(write_op, "write_ops")

0 commit comments

Comments
 (0)