Commit 77dfa988 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 0d1ba52e
...@@ -116,7 +116,7 @@ func TestLoad(t *testing.T) { ...@@ -116,7 +116,7 @@ func TestLoad(t *testing.T) {
tidv = append(tidv, dbe.Header.Tid) tidv = append(tidv, dbe.Header.Tid)
} }
// XXX i -> iMin, j -> iMax ? // XXX Fatal -> Error
for i, tidMin := range tidv { for i, tidMin := range tidv {
minv := []zodb.Tid{tidMin-1, tidMin, tidMin+1} minv := []zodb.Tid{tidMin-1, tidMin, tidMin+1}
for j, tidMax := range tidv { for j, tidMax := range tidv {
...@@ -134,28 +134,29 @@ func TestLoad(t *testing.T) { ...@@ -134,28 +134,29 @@ func TestLoad(t *testing.T) {
nsteps = 0 // j < i and j == i and ii/jj nsteps = 0 // j < i and j == i and ii/jj
} }
println(i,j, ii, jj, nsteps)
for k := 0; ; k++ { for k := 0; ; k++ {
subj := fmt.Sprintf("iterating %v..%v: step %v/%v", tmin, tmax, k+1, nsteps) subj := fmt.Sprintf("iterating %v..%v: step %v/%v", tmin, tmax, k+1, nsteps)
if k >= nsteps { if k >= nsteps {
t.Errorf("%v: steps overrun", subj) t.Fatalf("%v: steps overrun", subj)
} }
txni, dataIter, err := iter.NextTxn() txni, dataIter, err := iter.NextTxn()
if err != nil { if err != nil {
if err == io.EOF { if err == io.EOF {
if k != nsteps - 1 { if k != nsteps - 1 {
t.Errorf("%v: steps underrun", subj) t.Fatalf("%v: steps underrun", subj)
} }
break break
} }
t.Errorf("%v: %v", subj, err) t.Fatalf("%v: %v", subj, err)
} }
dbe := _1fs_dbEntryv[i + k] dbe := _1fs_dbEntryv[i + k]
// TODO also check .Pos, .LenPrev, .Len // TODO also check .Pos, .LenPrev, .Len
if !reflect.DeepEqual(*txni, dbe.Header.TxnInfo) { if !reflect.DeepEqual(*txni, dbe.Header.TxnInfo) {
// XXX fatal temp
t.Fatalf("%v: unexpected txn entry:\nhave: %q\nwant: %q", subj, *txni, dbe.Header.TxnInfo) t.Fatalf("%v: unexpected txn entry:\nhave: %q\nwant: %q", subj, *txni, dbe.Header.TxnInfo)
} }
......
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