Commit 11bed7a3 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ce3d517f
...@@ -228,15 +228,35 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) { ...@@ -228,15 +228,35 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
} }
// ForgetPast configured threshold // ForgetPast configured threshold
const ncut = 4 const ncut = 5
if len(vδf) > ncut { if len(vδf) >= ncut {
revcut := vδf[0].Rev revcut := vδf[0].Rev
t.Logf("# forget ≤ @%s", xat[revcut]) t.Logf("# forget ≤ @%s", xat[revcut])
δftail.ForgetPast(revcut) δftail.ForgetPast(revcut)
vδf = vδf[1:] vδf = vδf[1:]
} }
// XXX verify SliceByFileRev + LastBlkRev // SliceByFileRev
for j := 0; j < len(vδf); j++ {
for k := j; k < len(vδf); k++ {
var lo zodb.Tid
if j == 0 {
lo = vδf[0].Rev - 1
} else {
lo = vδf[j-1].Rev
}
hi := vδf[k].Rev
vδf_ok := vδf[j:k+1] // [j,k]
vδf_ := δftail.SliceByFileRev(zfile, lo, hi)
if !reflect.DeepEqual(vδf_, vδf_ok) {
t.Errorf("slice (@%s,@%s]:\nhave: %v\nwant: %v", xat[lo], xat[hi], vδf_, vδf_ok)
}
}
}
// XXX LastBlkRev
} }
} }
......
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