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
df73b82a
Commit
df73b82a
authored
Jun 03, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
1b962f03
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
9 deletions
+54
-9
wcfs/internal/xbtree_test.py
wcfs/internal/xbtree_test.py
+54
-9
No files found.
wcfs/internal/xbtree_test.py
View file @
df73b82a
...
...
@@ -729,19 +729,64 @@ def test_restructure():
# make sure changed objects are marked as such and so included into commit
z = Z(0,2)
z = Z(0,2
,3
)
transaction.commit()
R(z, 'T1/B0:a-B2:c')
def Rz(newtopo):
R(z, newtopo)
transaction.commit()
assert Sv(z) == 'T1/B0:a-B2:c'
assert Sv(z) == newtopo
zconn.cacheMinimize() # force z state to be reloaded from storage
assert Sv(z) == 'T1/B0:a-B2:c' # will fail if T or B is not marked as changed
assert Sv(z) == newtopo # will fail if T or B is not marked as changed
xbtree._zbcheck(z)
Rz('T/B0:a,2:c,3:d')
Rz('T1/B0:a-B2:c,3:d')
Rz('T2/B0:a-B2:c,3:d')
Rz('T3/B0:a,2:c-B3:d')
Rz('T2/T-T3/B0:a-B2:c-B3:d')
R(z, 'T/B0:a,2:c') # one more similar check
"""
# 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
# (commit asserts that nothing is changed)
# XXX leads restructure to generate corrupt btrees
z = Z()
transaction.commit()
assert Sv(z) == 'T/B0:a,2:c'
z[0] = xdecode('g')
z[1] = xdecode('e')
z[2] = xdecode('d')
z[3] = xdecode('h')
R(z, 'T/T1/T-T/B0:g-B1:e,2:d,3:h')
transaction.commit()
assert Sv(z) == 'T/T1/T-T/B0:g-B1:e,2:d,3:h'
zconn.cacheMinimize()
assert Sv(z) == 'T/T1/T-T/B0:g-B1:e,2:d,3:h'
xbtree._zbcheck(z)
z[0] = xdecode('h')
z[1] = xdecode('b')
del z[2]
del z[3]
R(z, 'T1/B0:h-B1:b')
transaction.commit()
assert Sv(z) == 'T1/B0:h-B1:b'
zconn.cacheMinimize()
assert Sv(z) == 'T/B0:a,2:c'
assert Sv(z) == 'T1/B0:h-B1:b' # XXX fails here
xbtree._zbcheck(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()
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._zbcheck(z)
"""
# ---- tests on automatically generated topologies ----
...
...
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