Commit c8ffa4b6 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 3a16a9d3
...@@ -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
......
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