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
c8ffa4b6
Commit
c8ffa4b6
authored
Jun 16, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3a16a9d3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+18
-7
No files found.
wcfs/δbtail_test.go
View file @
c8ffa4b6
...
@@ -493,7 +493,7 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a
...
@@ -493,7 +493,7 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a
// maxkey among kv1+kv2
// maxkey among kv1+kv2
// it must be present in δB if maxkey tracking is requested.
// it must be present in δB if maxkey tracking is requested.
maxKey
:=
maxk1
;
if
maxk2
>
maxk1
{
maxKey
=
maxk2
}
//
maxKey := maxk1; if maxk2 > maxk1 { maxKey = maxk2 }
// {} k -> adjacent keys. if k is tracked -> changes to adjacents must be in δT.
// {} k -> adjacent keys. if k is tracked -> changes to adjacents must be in δT.
kadj
:=
map
[
Key
]
SetKey
{}
kadj
:=
map
[
Key
]
SetKey
{}
...
@@ -531,13 +531,15 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a
...
@@ -531,13 +531,15 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a
keys
.
Add
(
allKeyv
[
idx
])
keys
.
Add
(
allKeyv
[
idx
])
}
}
xverifyΔBTail1
(
t
,
subj
,
db
,
treeRoot
,
at1
,
at2
,
d12
,
maxKey
,
δZ
,
keys
,
kadj
)
//xverifyΔBTail1(t, subj, db, treeRoot, at1,at2, d12, maxKey, δZ, keys, kadj)
xverifyΔBTail1
(
t
,
subj
,
db
,
treeRoot
,
at1
,
at2
,
d12
,
δZ
,
keys
,
kadj
)
}
}
}
}
// xverifyΔBTail1 verifies how ΔBTail handles ZODB update at1->at2 from initial
// xverifyΔBTail1 verifies how ΔBTail handles ZODB update at1->at2 from initial
// tracked state defined by initialTrackedKeys.
// tracked state defined by initialTrackedKeys.
func
xverifyΔBTail1
(
t
*
testing
.
T
,
subj
string
,
db
*
zodb
.
DB
,
treeRoot
zodb
.
Oid
,
at1
,
at2
zodb
.
Tid
,
d12
map
[
Key
]
string
,
maxKey
Key
,
δZ
*
zodb
.
EventCommit
,
initialTrackedKeys
SetKey
,
kadj
map
[
Key
]
SetKey
)
{
//func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, at1,at2 zodb.Tid, d12 map[Key]string, maxKey Key, δZ *zodb.EventCommit, initialTrackedKeys SetKey, kadj map[Key]SetKey) {
func
xverifyΔBTail1
(
t
*
testing
.
T
,
subj
string
,
db
*
zodb
.
DB
,
treeRoot
zodb
.
Oid
,
at1
,
at2
zodb
.
Tid
,
d12
map
[
Key
]
string
,
δZ
*
zodb
.
EventCommit
,
initialTrackedKeys
SetKey
,
kadj
map
[
Key
]
SetKey
)
{
X
:=
exc
.
Raiseif
X
:=
exc
.
Raiseif
assert
:=
require
.
New
(
t
)
assert
:=
require
.
New
(
t
)
...
@@ -574,7 +576,17 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
...
@@ -574,7 +576,17 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
kadjTracked
.
Update
(
kadj
[
k
])
kadjTracked
.
Update
(
kadj
[
k
])
}
}
// XXX assert tracked ∈ kadjTracked ?
// assert Tracked ∈ kadj[Tracked] except ∞
trackedNotInKadj
:=
SetKey
{}
for
k
:=
range
initialTrackedKeys
{
if
!
kadjTracked
.
Has
(
k
)
{
trackedNotInKadj
.
Add
(
k
)
}
}
trackedNotInKadj
.
Del
(
kInf
)
if
len
(
trackedNotInKadj
)
>
0
{
panic
(
fmt
.
Sprintf
(
"BUG: Tracked ∉ kadj[Tracked]"
))
// XXX more details?
}
// k ∈ d12
// k ∈ d12
// k ∈ δT <=>
// k ∈ δT <=>
...
@@ -617,9 +629,8 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
...
@@ -617,9 +629,8 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
// δT must be subset of d12.
// δT must be subset of d12.
// changed keys, that are
// changed keys, that are
// - in tracked set -> must be present in δT
// - in tracked set -> must be present in δT (covered by kadj)
// - outside tracked set -> may be present in δT
// - outside tracked set -> may be present in δT (kadj gives exact answer)
// - maxkey -> must be present in δT if trackingMaxKey
// XXX use kadj - check exactly whether k is present in δT or not present
// XXX use kadj - check exactly whether k is present in δT or not present
...
...
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