From 3a27c3e58fca96d0f0c80a1d264cb3f5f156f5c3 Mon Sep 17 00:00:00 2001 From: Wang Chao Date: Tue, 13 Aug 2024 21:34:12 +0800 Subject: 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 --- src/test/pybind/test_rados.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/pybind/test_rados.py b/src/test/pybind/test_rados.py index cb2a4f96101..0288527c4f9 100644 --- a/src/test/pybind/test_rados.py +++ b/src/test/pybind/test_rados.py @@ -515,6 +515,11 @@ class TestIoctx(object): self.ioctx.operate_write_op(write_op, "write_ops") eq(self.ioctx.read('write_ops'), b'12\x00\x005') + write_op.write_full(b'12345') + write_op.zero(0, 2) + self.ioctx.operate_write_op(write_op, "write_ops") + eq(self.ioctx.read('write_ops'), b'\x00\x00345') + write_op.write_full(b'12345') write_op.truncate(2) self.ioctx.operate_write_op(write_op, "write_ops") -- cgit v1.2.3