Commit 3cc378f0 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 5c28183c
...@@ -457,7 +457,8 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a ...@@ -457,7 +457,8 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a
// kadj = {} k -> adjacent keys. if k is tracked -> changes to adjacents must be in δT. // kadj = {} k -> adjacent keys. if k is tracked -> changes to adjacents must be in δT.
kadj := map[Key]SetKey{} kadj := map[Key]SetKey{}
for k := range allKeys { for k := range allKeys {
ka := SetKey{} adj1 := SetKey{}
adj2 := SetKey{}
k1 := k k1 := k
k2 := k k2 := k
...@@ -466,20 +467,62 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a ...@@ -466,20 +467,62 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a
k2 = maxk2 k2 = maxk2
} }
q1 := []Key{k1}
q2 := []Key{k2}
fmt.Println()
for len(q1) > 0 || len(q2) > 0 {
fmt.Printf("q1: %v\n", q1)
fmt.Printf("q2: %v\n", q2)
if l1 := len(q1); l1 > 0 {
k1 = q1[l1-1]; q1 = q1[:l1-1]
if !adj1.Has(k1) {
for k_ := range xkv1.Get(k1).kv {
adj1.Add(k_)
for k__ := range xkv2.Get(k_).kv {
if !adj2.Has(k__) {
q2 = append(q2, k__)
}
}
}
}
}
if l2 := len(q2); l2 > 0 {
k2 = q2[l2-1]; q2 = q2[:l2-1]
if !adj2.Has(k2) {
for k_ := range xkv2.Get(k2).kv {
adj2.Add(k_)
for k__ := range xkv1.Get(k_).kv {
if !adj1.Has(k__) {
q1 = append(q1, k__)
}
}
}
}
}
}
adj := SetKey{}; adj.Update(adj1); adj.Update(adj2)
kadj[k] = adj
/*
for k_ := range xkv1.Get(k1).kv { for k_ := range xkv1.Get(k1).kv {
ka.Add(k_) adj.Add(k_)
for k__ := range xkv2.Get(k_).kv { for k__ := range xkv2.Get(k_).kv {
ka.Add(k__) adj.Add(k__)
} }
} }
for k_ := range xkv2.Get(k2).kv { for k_ := range xkv2.Get(k2).kv {
ka.Add(k_) adj.Add(k_)
for k__ := range xkv1.Get(k_).kv { for k__ := range xkv1.Get(k_).kv {
ka.Add(k__) adj.Add(k__)
} }
} }
kadj[k] = ka kadj[k] = adj
*/
} }
if kadjOK != nil && !reflect.DeepEqual(kadj, kadjOK) { if kadjOK != nil && !reflect.DeepEqual(kadj, kadjOK) {
......
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