Commit 5d32b4b0 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 54c1e3b6
...@@ -161,7 +161,7 @@ class ZCtx(object): ...@@ -161,7 +161,7 @@ class ZCtx(object):
valdict = zctx.root.get('treegen/values', None) valdict = zctx.root.get('treegen/values', None)
if valdict is None: if valdict is None:
valdict = zctx.root['treegen/values'] = PersistentMapping() valdict = zctx.root['treegen/values'] = PersistentMapping()
valv = b'abcdefgh' valv = b'abcdefghij'
for v in valv: for v in valv:
zblk = valdict.get(v, None) zblk = valdict.get(v, None)
if zblk is not None and zblk.loadblkdata() == v: if zblk is not None and zblk.loadblkdata() == v:
......
...@@ -475,7 +475,7 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a ...@@ -475,7 +475,7 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a
d12 := kvdiff(xkvFlatten(xkv1), xkvFlatten(xkv2)) d12 := kvdiff(xkvFlatten(xkv1), xkvFlatten(xkv2))
// verify transition at1->at2 for all initial states of tracked {keys} from kv1 + kv2 + ∞ // verify transition at1->at2 for all initial states of tracked {keys} from kv1 + kv2 + ∞
allKeys := SetKey{} allKeys := SetKey{}; allKeys.Add(kInf) // ∞ simulating ZBigFile.Size() query
maxk1 := -kInf; maxk2 := -kInf maxk1 := -kInf; maxk2 := -kInf
for _, b := range xkv1 { for k := range b.kv { for _, b := range xkv1 { for k := range b.kv {
allKeys.Add(k) allKeys.Add(k)
...@@ -500,22 +500,20 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a ...@@ -500,22 +500,20 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a
for k := range allKeys { for k := range allKeys {
ka := SetKey{} ka := SetKey{}
/* XXX wrong k1 := k
b := xkv1.Get(k) k2 := k
for k_ := range allKeys { if k == kInf {
if b.lo <= k_ && k_ < b.hi { k1 = maxk1
ka.Add(k_) k2 = maxk2
}
} }
*/
for k_ := range xkv1.Get(k).kv { for k_ := range xkv1.Get(k1).kv {
ka.Add(k_) ka.Add(k_)
for k__ := range xkv2.Get(k_).kv { for k__ := range xkv2.Get(k_).kv {
ka.Add(k__) ka.Add(k__)
} }
} }
for k_ := range xkv2.Get(k).kv { for k_ := range xkv2.Get(k2).kv {
ka.Add(k_) ka.Add(k_)
for k__ := range xkv1.Get(k_).kv { for k__ := range xkv1.Get(k_).kv {
ka.Add(k__) ka.Add(k__)
...@@ -525,12 +523,14 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a ...@@ -525,12 +523,14 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a
kadj[k] = ka kadj[k] = ka
} }
/*
// k=∞ simulating ZBigFile.Size() query // k=∞ simulating ZBigFile.Size() query
allKeys.Add(kInf) allKeys.Add(kInf)
allKeyv = append(allKeyv, kInf) allKeyv = append(allKeyv, kInf)
kadj[kInf] = SetKey{} kadj[kInf] = SetKey{}
for k_ := range xkv1.Get(maxk1).kv { kadj[kInf].Add(k_) } for k_ := range xkv1.Get(maxk1).kv { kadj[kInf].Add(k_) }
for k_ := range xkv2.Get(maxk2).kv { kadj[kInf].Add(k_) } for k_ := range xkv2.Get(maxk2).kv { kadj[kInf].Add(k_) }
*/
if kadjOK != nil && !reflect.DeepEqual(kadj, kadjOK) { if kadjOK != nil && !reflect.DeepEqual(kadj, kadjOK) {
panic(fmt.Sprintf("BUG: %s: computed kadj is wrong:\nkadjOK: %v\nkadj : %v\n", subj, kadjOK, kadj)) panic(fmt.Sprintf("BUG: %s: computed kadj is wrong:\nkadjOK: %v\nkadj : %v\n", subj, kadjOK, kadj))
......
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