Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
9181c5d9
Commit
9181c5d9
authored
Jun 04, 2020
by
Kirill Smelkov
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X Restructure; verify that it marks as changed only modifed nodes
parent
e71383aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
43 deletions
+32
-43
wcfs/internal/xbtree_test.py
wcfs/internal/xbtree_test.py
+32
-43
No files found.
wcfs/internal/xbtree_test.py
View file @
9181c5d9
...
@@ -737,12 +737,12 @@ def test_restructure():
...
@@ -737,12 +737,12 @@ def test_restructure():
R(z, 'T4/T2-T/T-T-T6,10/B1-B3-T-T-T/T-B7-B11/B5')
R(z, 'T4/T2-T/T-T-T6,10/B1-B3-T-T-T/T-B7-B11/B5')
R(z, 'T/B1,3,5,7,11')
R(z, 'T/B1,3,5,7,11')
#
make sure
changed objects are marked as such and so included into commit
#
verify
changed objects are marked as such and so included into commit
# (just R also partly verifies this on every call)
# (just R also partly verifies this on every call)
z = Z(0,2,3)
z = Z(0,2,3)
transaction.commit()
transaction.commit()
def Rz(newtopo):
def Rz(newtopo):
R(z, newtopo)
R(z, newtopo
, dontcommit=True
)
transaction.commit()
transaction.commit()
assert Sv(z) == newtopo
assert Sv(z) == newtopo
zconn.cacheMinimize() # force z state to be reloaded from storage
zconn.cacheMinimize() # force z state to be reloaded from storage
...
@@ -755,48 +755,37 @@ def test_restructure():
...
@@ -755,48 +755,37 @@ def test_restructure():
Rz('T3/B0:a,2:c-B3:d')
Rz('T3/B0:a,2:c-B3:d')
Rz('T2/T-T3/B0:a-B2:c-B3:d')
Rz('T2/T-T3/B0:a-B2:c-B3:d')
# make sure that only modified nodes are marked as changed.
z = Z(0,1,2,3)
"""
R(z, 'T1/T-T2/B0-B1-B2,3')
# XXX T/T1/T-T/B0:g-B1:e,2:d,3:h -> T1/T-T3/B0:g-T-T/B1:e,2:d-B3:h
tl, tr = assertT(z, [1], 'T','T')
# (commit asserts that nothing is changed)
b0, = assertT(tl, [], 'B')
b1, b23 = assertT(tr, [2], 'B','B')
# XXX leads restructure to generate corrupt btrees
assertB(b0, 0)
z = Z()
assertB(b1, 1)
transaction.commit()
assertB(b23, 2,3)
z[0] = xdecode('g')
assert z._p_changed == False
z[1] = xdecode('e')
assert tl._p_changed == False
z[2] = xdecode('d')
assert tr._p_changed == False
z[3] = xdecode('h')
assert b0._p_changed == False
R(z, 'T/T1/T-T/B0:g-B1:e,2:d,3:h')
assert b1._p_changed == False
transaction.commit()
assert b23._p_changed == False
assert Sv(z) == 'T/T1/T-T/B0:g-B1:e,2:d,3:h'
zconn.cacheMinimize()
R(z, 'T1/T-T3/B0-B1,2-B3', dontcommit=True) # reflow right arm
assert Sv(z) == 'T/T1/T-T/B0:g-B1:e,2:d,3:h'
assertT(z, [1], tl, tr)
xbtree.zcheck(z)
assertT(tl, [], b0)
assertT(tr, [3], b1, b23) # changed
z[0] = xdecode('h')
assertB(b0, 0)
z[1] = xdecode('b')
assertB(b1, 1,2) # changed
del z[2]
assertB(b23, 3) # changed
del z[3]
assert z._p_changed == False
R(z, 'T1/B0:h-B1:b')
assert tl._p_changed == False
transaction.commit()
assert tr._p_changed == True
assert Sv(z) == 'T1/B0:h-B1:b'
assert b0._p_changed == False
zconn.cacheMinimize()
assert b1._p_changed == True
assert Sv(z) == 'T1/B0:h-B1:b' # XXX fails here
assert b23._p_changed == True
xbtree.zcheck(z)
z[0] = xdecode('g')
z[1] = xdecode('e')
z[2] = xdecode('d')
z[3] = xdecode('h')
R(z, 'T1/T-T3/B0:g-T-T/B1:e,2:d-B3:h')
transaction.commit()
transaction.commit()
assert Sv(z) == 'T1/T-T3/B0:g-T-T/B1:e,2:d-B3:h'
zconn.cacheMinimize()
assert Sv(z) == 'T1/T-T3/B0:g-T-T/B1:e,2:d-B3:h'
xbtree.zcheck(z)
"""
# ---- tests on automatically generated topologies ----
# ---- tests on automatically generated topologies ----
...
...
Kirill Smelkov
@kirr
mentioned in commit
c58c20d6
·
Oct 27, 2021
mentioned in commit
c58c20d6
mentioned in commit c58c20d69d8dfb7ef646e23dd20a74b5bae9ded2
Toggle commit list
Kirill Smelkov
@kirr
mentioned in commit
0e829874
·
Oct 28, 2021
mentioned in commit
0e829874
mentioned in commit 0e829874806c48bcb96ade96ba44aad3cc8f0e60
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment