Commit c77264f9 authored by Kirill Smelkov's avatar Kirill Smelkov

.

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