Commit b20440bc authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 8be54c3c
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment