Commit d38c8f8e authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f37901bc
......@@ -1237,19 +1237,36 @@ def test_wcfs():
assert w2.at == at2
assert w2.pinned == {2: at2}
# w_assertPin asserts on state of .pinned for {w3,w3_,w2}
def w_assertPin(pinw3, pinw3_, pinw2):
assert w3.pinned == pinw3
assert w3_.pinned == pinw3_
assert w2.pinned == pinw2
f.assertCache([1,1,1,1])
t.change(zf, { 2: '4c', 5: '4f'}) # FIXME + 4a after δbtree works
t.change(zf, { 2: '4c', 5: '4f'}) # FIXME + 4a after δbtree works & update everything vvv
at4 = t.commit()
f.assertCache([1,1,0,1,0,0]) # FIXME a must be invalidated - see δbtree ^^^
f.assertCache([1,1,0,1,0,0])
f.assertBlk(0, '', {wl3: {}, wl3_: {}, wl2: {}})
w_assertPin( {}, {}, {2:at2})
f.assertBlk(1, '', {wl3: {}, wl3_: {}, wl2: {}})
w_assertPin( {}, {}, {2:at2})
f.assertBlk(2, '4c', {wl3: {2:at3}, wl3_: {2:at3}, wl2: {}})
w_assertPin( {2:at3}, {2:at3}, {2:at2})
f.assertBlk(3, '2d', {wl3: {}, wl3_: {}, wl2: {}})
w_assertPin( {2:at3}, {2:at3}, {2:at2})
f.assertBlk(0, '', {wl3: {}, wl3_: {}, wl2: {}}) # XXX + {0, at3} after δbtree
f.assertBlk(1, '', {wl3: {}, wl3_: {}, wl2: {}})
f.assertBlk(2, '4c', {wl3: {2: at3}, wl3_: {2: at3}, wl2: {}})
f.assertBlk(3, '2d', {wl3: {}, wl3_: {}, wl2: {}})
# blk4 is hole @head - the same as at earlier db view - not pinned
# XXX or do not allow hole past .size ?
f.assertBlk(4, '', {wl3: {}, wl3_: {}, wl2: {}})
f.assertBlk(5, '4f', {wl3: {5: at0}, wl3_: {5: at0}, wl2: {5: at0}}) # XXX at0 -> ø?
f.assertBlk(4, '', {wl3: {}, wl3_: {}, wl2: {}})
w_assertPin( {2:at3}, {2:at3}, {2:at2})
f.assertBlk(5, '4f', {wl3: {5:at0}, wl3_: {5:at0}, wl2: {5:at0}}) # XXX at0->ø?
w_assertPin( {2:at3, 5:at0}, {2:at3, 5:at0}, {2:at2, 5:at0})
# commit again:
# - block is already pinned (#2) -> not notified
......
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