Commit f280a3b7 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 89dd3865
...@@ -67,7 +67,9 @@ def main(): ...@@ -67,7 +67,9 @@ def main():
emit("const blksize = %s" % blksize) emit("const blksize = %s" % blksize)
emit("const z0_oid = %s" % u64(z0._p_oid)) emit("const z0_oid = %s" % u64(z0._p_oid))
emit("const z0_rev = %s" % u64(z0._p_serial))
emit("const z1_oid = %s" % u64(z1._p_oid)) emit("const z1_oid = %s" % u64(z1._p_oid))
emit("const z1_rev = %s" % u64(z1._p_serial))
emit("const zf_oid = %s" % u64(zf._p_oid)) emit("const zf_oid = %s" % u64(zf._p_oid))
......
...@@ -28,7 +28,6 @@ package main ...@@ -28,7 +28,6 @@ package main
import ( import (
"context" "context"
"encoding/binary" "encoding/binary"
"fmt"
"testing" "testing"
"lab.nexedi.com/kirr/go123/exc" "lab.nexedi.com/kirr/go123/exc"
...@@ -47,7 +46,8 @@ func TestZBlk(t *testing.T) { ...@@ -47,7 +46,8 @@ func TestZBlk(t *testing.T) {
stor, err := zodb.Open(ctx, "testdata/zblk.fs", &zodb.OpenOptions{ReadOnly: true}); X(err) stor, err := zodb.Open(ctx, "testdata/zblk.fs", &zodb.OpenOptions{ReadOnly: true}); X(err)
db := zodb.NewDB(stor) db := zodb.NewDB(stor)
defer func() { defer func() {
err := db.Close(); X(err) err := db.Close(); X(err)
err = stor.Close(); X(err)
}() }()
txn, ctx := transaction.New(ctx) txn, ctx := transaction.New(ctx)
...@@ -55,8 +55,6 @@ func TestZBlk(t *testing.T) { ...@@ -55,8 +55,6 @@ func TestZBlk(t *testing.T) {
conn, err := db.Open(ctx, &zodb.ConnOptions{}); X(err) conn, err := db.Open(ctx, &zodb.ConnOptions{}); X(err)
// XXX close db/stor
xz0, err := conn.Get(ctx, z0_oid); X(err) xz0, err := conn.Get(ctx, z0_oid); X(err)
xz1, err := conn.Get(ctx, z1_oid); X(err) xz1, err := conn.Get(ctx, z1_oid); X(err)
xzf, err := conn.Get(ctx, zf_oid); X(err) xzf, err := conn.Get(ctx, zf_oid); X(err)
...@@ -89,14 +87,13 @@ func TestZBlk(t *testing.T) { ...@@ -89,14 +87,13 @@ func TestZBlk(t *testing.T) {
binary.BigEndian.PutUint32(data[i*4:], i) binary.BigEndian.PutUint32(data[i*4:], i)
} }
z0Data, _, err := z0.loadBlkData(ctx); X(err) // FIXME check rev z0Data, z0Rev, err := z0.loadBlkData(ctx); X(err)
assert.Equal(z0Data, data, "ZBlk0 data wrong") assert.Equal(z0Data, data, "ZBlk0 data wrong")
assert.Equal(z0Rev, z0_rev, "ZBlk0 rev wrong")
z1Data, _, err := z1.loadBlkData(ctx); X(err) // FIXME check rev z1Data, z1Rev, err := z1.loadBlkData(ctx); X(err)
if false { assert.Equal(z1Data, data, "ZBlk1 data wrong")
fmt.Printf("%#v\n", z1Data) assert.Equal(z1Rev, z1_rev, "ZBlk1 rev wrong")
}
assert.Equal(z1Data[:20], data[:20], "ZBlk1 data wrong")
......
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