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
cb6b12ed
Commit
cb6b12ed
authored
Jun 22, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
333b6877
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
36 deletions
+21
-36
wcfs/internal/xbtree/pptreesubset.go
wcfs/internal/xbtree/pptreesubset.go
+1
-1
wcfs/internal/xbtree/δbtail_test.go
wcfs/internal/xbtree/δbtail_test.go
+20
-35
No files found.
wcfs/internal/xbtree/pptreesubset.go
View file @
cb6b12ed
...
...
@@ -516,7 +516,7 @@ func (S PPTreeSubSet) ApplyΔ(δ *ΔPPTreeSubSet) {
// XXX kill
// XXX returns PPTreeSubSet that corresponds to nodes that correspond to δtkeycov.
// XXX correct?
func
(
δ
*
ΔPPTreeSubSet
)
XXXδtkeycovSet
()
(
S
PPTreeSubSet
)
{
...
...
wcfs/internal/xbtree/δbtail_test.go
View file @
cb6b12ed
...
...
@@ -679,7 +679,7 @@ func xverifyΔBTail_Update(t *testing.T, subj string, db *zodb.DB, treeRoot zodb
// tracked state defined by initialTrackedKeys.
func
xverifyΔBTail_Update1
(
t
*
testing
.
T
,
subj
string
,
db
*
zodb
.
DB
,
treeRoot
zodb
.
Oid
,
at1
,
at2
zodb
.
Tid
,
xkv1
,
xkv2
RBucketSet
,
δZ
*
zodb
.
EventCommit
,
d12
map
[
Key
]
Δstring
,
initialTrackedKeys
SetKey
,
kadj
KAdjMatrix
)
{
X
:=
exc
.
Raiseif
//
t.Logf("\n>>> Track=%s\n", initialTrackedKeys)
t
.
Logf
(
"
\n
>>> Track=%s
\n
"
,
initialTrackedKeys
)
var
TrackedδZ
SetKey
=
nil
var
kadjTrackedδZ
SetKey
=
nil
...
...
@@ -791,27 +791,35 @@ func xverifyΔBTail_Update1(t *testing.T, subj string, db *zodb.DB, treeRoot zod
ø
:=
PPTreeSubSet
{}
// verify δbtail.trackSet against @at1
// trackSet1 = xkv1[tracked1]
// trackSet2 = xkv2[tracked2] ( = xkv2[kadj[tracked1]]
trackSet1
,
tkeyCov1
:=
xkv1
.
trackSetWithCov
(
initialTrackedKeys
)
/*
if !δbtail.trackSet.Equal(ø) {
badf("δbtail.trackSet1 wrong:\n\thave: %v\n\twant: %v", δbtail.trackSet, ø)
}
if !δbtail.trackNew.Equal(trackSet1) {
badf("δbtail.trackNew1 wrong:\n\thave: %v\n\twant: %v", δbtail.trackNew, trackSet1)
}
*/
δbtail
.
assertTrack
(
t
,
"1"
,
ø
,
trackSet1
)
trackSet2
,
tkeyCov2
:=
xkv2
.
trackSetWithCov
(
initialTrackedKeys
.
Union
(
kadjTrackedδZ
))
// verify δbtail.trackSet against @at1
δbtail
.
assertTrack
(
t
,
"1"
,
ø
,
trackSet1
)
// δB <- δZ
//
// also call _Update1 directly to verify δtkeycov return from treediff
// the result of Update and _Update1 should be the same since δbtail is initially empty.
δbtail_
:=
δbtail
.
Clone
()
δB
,
err
:=
δbtail
.
Update
(
δZ
);
X
(
err
)
δB1
,
err
:=
δbtail_
.
_Update1
(
δZ
);
X
(
err
)
// assert δtkeycov == δ(tkeyCov1, tkeyCov2)
δtkeycovOK
:=
tkeyCov2
.
Difference
(
tkeyCov1
)
//fmt.Printf("tkeyCov1: %s\n", tkeyCov1)
//fmt.Printf("tkeyCov2: %s\n", tkeyCov2)
//fmt.Printf("δtkeycov: %s\n", δtkeycovOK)
δtkeycov
:=
&
RangedKeySet
{}
if
__
,
ok
:=
δB1
.
ByRoot
[
treeRoot
];
ok
{
δtkeycov
=
__
.
δtkeycov1
}
if
!
δtkeycov
.
Equal
(
δtkeycovOK
)
{
badf
(
"δtkeycov wrong:
\n
have: %s
\n
want: %s"
,
δtkeycov
,
δtkeycovOK
)
}
δB
,
err
:=
δbtail
.
Update
(
δZ
);
X
(
err
)
// XXX assert δB.roots == δTKeyCov roots
// XXX assert δBtail[root].vδT = δBtail_[root].vδT
...
...
@@ -821,32 +829,9 @@ func xverifyΔBTail_Update1(t *testing.T, subj string, db *zodb.DB, treeRoot zod
}
// verify δbtail.trackSet against @at2
// trackSet2 = xkv2[tracked2] ( = xkv2[kadj[tracked1]]
trackSet2
,
tkeyCov2
:=
xkv2
.
trackSetWithCov
(
initialTrackedKeys
.
Union
(
kadjTrackedδZ
))
/*
if !δbtail.trackSet.Equal(trackSet2) {
badf("δbtail.trackSet2 wrong:\n\thave: %v\n\twant: %v", δbtail.trackSet, trackSet2)
}
if !δbtail.trackNew.Equal(ø) {
badf("δbtail.trackNew2 wrong:\n\thave: %v\n\twant: %v", δbtail.trackNew, ø)
}
*/
δbtail
.
assertTrack
(
t
,
"2"
,
trackSet2
,
ø
)
// assert δtkeycov == δ(tkeyCov1, tkeyCov2)
δtkeycovOK
:=
tkeyCov2
.
Difference
(
tkeyCov1
)
fmt
.
Printf
(
"tkeyCov1: %s
\n
"
,
tkeyCov1
)
fmt
.
Printf
(
"tkeyCov2: %s
\n
"
,
tkeyCov2
)
fmt
.
Printf
(
"δtkeycov: %s
\n
"
,
δtkeycovOK
)
δtkeycov
:=
&
RangedKeySet
{}
if
__
,
ok
:=
δB1
.
ByRoot
[
treeRoot
];
ok
{
δtkeycov
=
__
.
δtkeycov1
}
if
!
δtkeycov
.
Equal
(
δtkeycovOK
)
{
badf
(
"δtkeycov wrong:
\n
have: %s
\n
want: %s"
,
δtkeycov
,
δtkeycovOK
)
}
// assert δB.ByRoot == {treeRoot -> ...} if δTok != ø
// == ø if δTok == ø
rootsOK
:=
SetOid
{}
...
...
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