Commit 8538a5c1 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent abae5f95
...@@ -1329,15 +1329,29 @@ def test_wcfs_basic_read_aftertail(): ...@@ -1329,15 +1329,29 @@ def test_wcfs_basic_read_aftertail():
t = tDB(); zf = t.zfile t = tDB(); zf = t.zfile
defer(t.close) defer(t.close)
t.commit(zf, {2:'c1'} t.commit(zf, {2:'c1'})
f = t.open(zf) f = t.open(zf)
f.assertData(['','','c1']) f.assertData(['','','c1'])
assert 10 == io.readat(f.f.fileno(), 0*blksize, bytearray(10)) def _(off): # -> bytes read from f[off +4)
assert 10 == io.readat(f.f.fileno(), 1*blksize, bytearray(10)) buf = bytearray(4)
assert 10 == io.readat(f.f.fileno(), 2*blksize, bytearray(10)) n = io.readat(f.f.fileno(), off, buf)
assert 0 == io.readat(f.f.fileno(), 3*blksize, bytearray(10)) return bytes(buf[:n])
assert 0 == io.readat(f.f.fileno(), 100*blksize, bytearray(10))
assert _(0*blksize) == b'\x00\x00\x00\x00'
assert _(1*blksize) == b'\x00\x00\x00\x00'
assert _(2*blksize) == b'c1\x00\x00'
assert _(3*blksize-4) == b'\x00\x00\x00\x00'
assert _(3*blksize-3) == b'\x00\x00\x00'
assert _(3*blksize-2) == b'\x00\x00'
assert _(3*blksize-1) == b'\x00'
assert _(3*blksize-0) == b''
assert _(3*blksize+1) == b''
assert _(3*blksize+2) == b''
assert _(3*blksize+3) == b''
assert _(4*blksize) == b''
assert _(8*blksize) == b''
assert _(100*blksize) == b''
# verify that watch setup is robust to client errors/misbehaviour. # verify that watch setup is robust to client errors/misbehaviour.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment