Commit f5a73fef authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 98693492
...@@ -140,7 +140,7 @@ func (obj *Persistent) pSerialize() *mem.Buf { ...@@ -140,7 +140,7 @@ func (obj *Persistent) pSerialize() *mem.Buf {
return istate.GetState() return istate.GetState()
case PyStateful: case PyStateful:
return pyGetState(istate, ClassOf(obj)) return pyGetState(istate, ClassOf(obj.instance))
default: default:
panic(obj.badf("serialize: !stateful instance")) panic(obj.badf("serialize: !stateful instance"))
......
...@@ -120,6 +120,7 @@ func _checkObj(t testing.TB, obj IPersistent, jar *Connection, oid Oid, serial T ...@@ -120,6 +120,7 @@ func _checkObj(t testing.TB, obj IPersistent, jar *Connection, oid Oid, serial T
func tCheckObj(t testing.TB) func(IPersistent, *Connection, Oid, Tid, ObjectState, int32, *loadState) { func tCheckObj(t testing.TB) func(IPersistent, *Connection, Oid, Tid, ObjectState, int32, *loadState) {
return func(obj IPersistent, jar *Connection, oid Oid, serial Tid, state ObjectState, refcnt int32, loading *loadState) { return func(obj IPersistent, jar *Connection, oid Oid, serial Tid, state ObjectState, refcnt int32, loading *loadState) {
t.Helper()
_checkObj(t, obj, jar, oid, serial, state, refcnt, loading) _checkObj(t, obj, jar, oid, serial, state, refcnt, loading)
} }
} }
...@@ -191,6 +192,7 @@ func TestPersistentDB(t *testing.T) { ...@@ -191,6 +192,7 @@ func TestPersistentDB(t *testing.T) {
work, err := ioutil.TempDir("", "t-persistent"); X(err) work, err := ioutil.TempDir("", "t-persistent"); X(err)
defer func() { defer func() {
//return
err := os.RemoveAll(work); X(err) err := os.RemoveAll(work); X(err)
}() }()
...@@ -201,12 +203,9 @@ func TestPersistentDB(t *testing.T) { ...@@ -201,12 +203,9 @@ func TestPersistentDB(t *testing.T) {
_obj1 := NewMyObject(nil); _obj1.oid = 101; _obj1.value = "hello" _obj1 := NewMyObject(nil); _obj1.oid = 101; _obj1.value = "hello"
_obj2 := NewMyObject(nil); _obj2.oid = 102; _obj2.value = "world" _obj2 := NewMyObject(nil); _obj2.oid = 102; _obj2.value = "world"
at1, err := ZPyCommit(zurl, 0, _obj1, _obj2); X(err) at1, err := ZPyCommit(zurl, 0, _obj1, _obj2); X(err)
fmt.Printf("AAA %s\n", at1)
ctx := context.Background() ctx := context.Background()
stor, err := OpenStorage(ctx, zurl, &OpenOptions{ReadOnly: true}); X(err) stor, err := OpenStorage(ctx, zurl, &OpenOptions{ReadOnly: true}); X(err)
aa, err := stor.LastTid(ctx); X(err)
fmt.Printf("BBB %s\n", aa)
db := NewDB(stor) db := NewDB(stor)
txn1, ctx1 := transaction.New(ctx) txn1, ctx1 := transaction.New(ctx)
......
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