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
b20440bc
Commit
b20440bc
authored
Jun 15, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
8be54c3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
3 deletions
+38
-3
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+38
-3
No files found.
wcfs/δbtail_test.go
View file @
b20440bc
...
...
@@ -555,7 +555,8 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
xtree
,
err
:=
zconn
.
Get
(
ctx
,
treeRoot
);
X
(
err
)
ztree
:=
xtree
.
(
*
Tree
)
trackingMaxKey
:=
false
kadjTracked
:=
SetKey
{}
// all keys adjacent to tracked
// trackingMaxKey := false
for
k
:=
range
initialTrackedKeys
{
path
:=
[]
Node
{}
_
,
_
,
err
=
ztree
.
VGet
(
ctx
,
k
,
func
(
node
Node
)
{
...
...
@@ -566,9 +567,24 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
trackFlags
:=
TrackFlags
(
0
)
if
k
==
kInf
{
trackFlags
=
TrackMaxKey
trackingMaxKey
=
true
//
trackingMaxKey = true
}
δbtail
.
Track
(
path
,
trackFlags
)
kadjTracked
.
Update
(
kadj
[
k
])
}
// XXX assert tracked ∈ kadjTracked ?
// k ∈ d12
// k ∈ δT <=>
// k ∈ U kadj(·)
// ·∈tracking
inδTOK
:=
SetKey
{}
// all keys that should be present in δT
for
k
:=
range
d12
{
if
kadjTracked
.
Has
(
k
)
{
inδTOK
.
Add
(
k
)
}
}
// δbtail <- δZ
...
...
@@ -611,10 +627,28 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
for
k
:=
range
δT
{
_
,
ind12
:=
d12
[
k
]
if
ind12
{
badf
(
"δT: [%v] is
extra
"
,
k
)
badf
(
"δT: [%v] is
not in d12
"
,
k
)
}
}
// XXX comment, see below?
for
k
:=
range
d12
{
_
,
inδT
:=
δT
[
k
]
if
inδT
&&
!
inδTOK
.
Has
(
k
)
{
badf
(
"δT: [%v] is extra"
,
k
)
}
if
!
inδT
&&
inδTOK
.
Has
(
k
)
{
badf
(
"δT: [%v] is missing"
,
k
)
}
if
inδT
{
if
δT
[
k
]
!=
d12
[
k
]
{
badf
(
"δT[%v] != d12[%v]"
,
k
,
k
)
}
}
}
/*
// k ∈ tracked set -> must be present in δT
// k ∉ tracked set -> may be present in δT
// k==max && tracking maxKey -> k must be present in δT
...
...
@@ -631,6 +665,7 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
}
}
}
*/
if
badv
!=
nil
{
emsg
:=
fmt
.
Sprintf
(
"%s ; tracked=%v : δT is wrong:
\n\n
"
,
subj
,
tracked
)
...
...
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