Commit c77264f9 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 515220ef
......@@ -4,6 +4,7 @@ package fs1
import (
"bytes"
"reflect"
"testing"
"../../zodb"
......@@ -103,6 +104,7 @@ func TestLoad(t *testing.T) {
for i, tidMin := range tidv {
for j, tidMax := range tidv {
_ = j // XXX
iter := fs.Iterate(tidMin, tidMax)
if tidMin > tidMax {
......@@ -111,24 +113,23 @@ func TestLoad(t *testing.T) {
txni := zodb.TxnInfo{}
datai := zodb.StorageRecordInformation{}
var stop bool
// XXX vvv assumes i < j
// FIXME first tidMin and last tidMax
for k := i; ; k++ {
stop, err = iter.NextTxn(&txni)
dataIter, stop, err := iter.NextTxn(&txni)
if stop || err != nil {
break
}
dbe = _1fs_dbEntryv[k]
dbe := _1fs_dbEntryv[k]
if !reflect.DeepEqual(txni, dbe.Header.TxnInfo) {
t.Errorf("iterating tidMin..tidMac (TODO): step XXX: unexpected txn entry.\nhave: %v\nwant: %v", txni, dbe.Header.TxnInfo)
}
for {
stop, err = txni.Iter.NextData(&datai)
stop, err = dataIter.NextData(&datai)
if err != nil {
panic(err) // XXX
}
......
......@@ -104,6 +104,7 @@ def main():
print >>f, v
emit("// DO NOT EDIT - AUTOGENERATED (by py/gen-testdata)")
emit("package fs1\n")
emit("import \"../../zodb\"\n")
# index
emit("const _1fs_indexTopPos = %i" % stor._pos)
......@@ -128,12 +129,14 @@ def main():
# -> TxnHeader
emit("\t\tTxnHeader{")
emit("\t\t\tTid:\t%s," % hex64(txn.tid))
emit("\t\t\tRecLenm8:\t%i," % th.tlen)
emit("\t\t\tStatus:\t'%s'," % txn.status)
emit("\t\t\tUser:\t\t[]byte(%s)," % escapeqq(txn.user))
emit("\t\t\tDescription:\t[]byte(%s)," % escapeqq(txn.description))
emit("\t\t\tExtension:\t[]byte(%s)," % escapeqq(th.ext))
emit("\t\t\tTxnInfo:\tzodb.TxnInfo{")
emit("\t\t\t\tTid:\t%s," % hex64(txn.tid))
emit("\t\t\t\tStatus:\t'%s'," % txn.status)
emit("\t\t\t\tUser:\t\t[]byte(%s)," % escapeqq(txn.user))
emit("\t\t\t\tDescription:\t[]byte(%s)," % escapeqq(txn.description))
emit("\t\t\t\tExtension:\t[]byte(%s)," % escapeqq(th.ext))
emit("\t\t\t},")
emit("\t\t},")
# -> DataHeader + payload
......
This diff is collapsed.
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