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
133a8a8e
Commit
133a8a8e
authored
Jun 02, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
7cdf3e06
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
wcfs/testprog/treegen.py
wcfs/testprog/treegen.py
+9
-9
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+3
-0
No files found.
wcfs/testprog/treegen.py
View file @
133a8a8e
...
...
@@ -276,8 +276,8 @@ def AllStructs(zstor, kv1txt, kv2txt, n, seed=None):
# AllStructs generates topologies for subset of all possible tree changes in
# between kv1 and kv2. See top-level documentation for details.
@
func
def
AllStructs
(
kv1txt
,
kv2txt
,
n
,
seed
=
None
):
zstor
=
MappingStorage
()
# in RAM storage to
... XXX writy why we need it
def
AllStructs
(
kv1txt
,
kv2txt
,
maxdepth
,
maxsplit
,
n
,
seed
=
None
):
zstor
=
MappingStorage
()
# in RAM storage to
create native ZODB topologies
zctx
=
ZCtx
(
zstor
)
defer
(
zctx
.
close
)
...
...
@@ -300,8 +300,6 @@ def AllStructs(kv1txt, kv2txt, n, seed=None):
t2struct0
=
xbtree
.
StructureOf
(
ztree
)
# all tree topologies that can represent kv1 and kv2
maxdepth
=
2
# XXX -> 3?
maxsplit
=
1
# XXX -> 2?
t1AllStructs
=
list
(
xbtree
.
AllStructs
(
kv1
.
keys
(),
maxdepth
,
maxsplit
,
kv
=
kv1
))
t2AllStructs
=
list
(
xbtree
.
AllStructs
(
kv2
.
keys
(),
maxdepth
,
maxsplit
,
kv
=
kv2
))
...
...
@@ -309,7 +307,7 @@ def AllStructs(kv1txt, kv2txt, n, seed=None):
if
seed
is
None
:
seed
=
int
(
time
.
now
())
random
.
seed
(
seed
)
print
(
"#
n=%d seed=%d"
%
(
n
,
seed
))
print
(
"#
maxdepth=%d maxsplit=%d n=%d seed=%d"
%
(
maxdepth
,
maxsplit
,
n
,
seed
))
# all tree1 and tree2 topologies jumps in between we are going to emit:
# native + n random ones.
...
...
@@ -448,12 +446,14 @@ def TopoDecode(zctx, text):
@
func
def
cmd_allstructs
(
argv
):
if
len
(
argv
)
!=
3
:
print
(
"Usage: treegen allstructs <n> <kv1> <kv2>"
,
file
=
sys
.
stderr
)
print
(
"Usage: treegen allstructs <
maxdepth> <maxsplit> <
n> <kv1> <kv2>"
,
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
n
=
int
(
argv
[
0
])
kv1
,
kv2
=
argv
[
1
:]
AllStructs
(
kv1
,
kv2
,
n
)
maxdepth
=
int
(
argv
[
0
])
maxsplit
=
int
(
argv
[
1
])
n
=
int
(
argv
[
2
])
kv1
,
kv2
=
argv
[
3
:]
AllStructs
(
kv1
,
kv2
,
maxdepth
,
maxsplit
,
n
)
@
func
def
cmd_trees
(
argv
):
...
...
wcfs/δbtail_test.go
View file @
133a8a8e
...
...
@@ -445,6 +445,9 @@ func TestΔBTreeAllStructs(t *testing.T) {
// XXX given (kv1, kv2) test on automatically generated (tree1 -> tree2)
//testing.Short()
maxdepth
=
2
// XXX -> 3?
maxsplit
=
1
// XXX -> 2?
}
...
...
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