Commit 1408fe57 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6246197d
...@@ -528,14 +528,20 @@ func Open(path string) (*FileStorage, error) { ...@@ -528,14 +528,20 @@ func Open(path string) (*FileStorage, error) {
return nil, err // XXX +context return nil, err // XXX +context
} }
err = txnhMax.Load(f, topPos, LoadAll) err = txnhMax.Load(f, topPos, LoadAll)
// XXX expect EOF but .PrevLen must be good // expect EOF but .LenPrev must be good
if err != nil { if err != io.EOF {
if err == nil {
err = fmt.Errorf("no EOF after topPos") // XXX err context
}
return nil, err // XXX +context return nil, err // XXX +context
} }
if txnhMax.LenPrev <= 0 {
panic("could not read LenPrev @topPos") // XXX err
}
err = txnhMax.LoadPrev(f, LoadAll) err = txnhMax.LoadPrev(f, LoadAll)
if err != nil { if err != nil {
// XXX panic(err) // XXX
} }
......
...@@ -105,6 +105,8 @@ func TestLoad(t *testing.T) { ...@@ -105,6 +105,8 @@ func TestLoad(t *testing.T) {
checkLoad(t, fs, xid, expect) checkLoad(t, fs, xid, expect)
} }
return
// check iterating XXX move to separate test ? // check iterating XXX move to separate test ?
// tids we will use for tid{Min,Max} // tids we will use for tid{Min,Max}
tidv := []zodb.Tid{zodb.Tid(0)} tidv := []zodb.Tid{zodb.Tid(0)}
......
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