Commit 54873d26 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent e9f65d1d
...@@ -77,10 +77,10 @@ func init() { ...@@ -77,10 +77,10 @@ func init() {
RegisterClassAlias("t.zodb.MyOldObject", "t.zodb.MyObject") RegisterClassAlias("t.zodb.MyOldObject", "t.zodb.MyObject")
} }
// _checkObj verifies current state of persistent object. // checkObj verifies current state of persistent object.
// //
// one can bind _checkObj to t via tCheckObj. // one can bind checkObj to t via tCheckObj.
func _checkObj(t testing.TB, obj IPersistent, jar *Connection, oid Oid, serial Tid, state ObjectState, refcnt int32) { func checkObj(t testing.TB, obj IPersistent, jar *Connection, oid Oid, serial Tid, state ObjectState, refcnt int32) {
t.Helper() t.Helper()
xbase := reflect.ValueOf(obj).Elem().FieldByName("Persistent") xbase := reflect.ValueOf(obj).Elem().FieldByName("Persistent")
pbase := xbase.Addr().Interface().(*Persistent) pbase := xbase.Addr().Interface().(*Persistent)
...@@ -115,7 +115,6 @@ func _checkObj(t testing.TB, obj IPersistent, jar *Connection, oid Oid, serial T ...@@ -115,7 +115,6 @@ func _checkObj(t testing.TB, obj IPersistent, jar *Connection, oid Oid, serial T
if pbase.instance != obj { if pbase.instance != obj {
badf("base.instance != obj") badf("base.instance != obj")
} }
// XXX loading too?
if len(badv) != 0 { if len(badv) != 0 {
msg := fmt.Sprintf("%#v:\n", obj) msg := fmt.Sprintf("%#v:\n", obj)
...@@ -129,7 +128,7 @@ func _checkObj(t testing.TB, obj IPersistent, jar *Connection, oid Oid, serial T ...@@ -129,7 +128,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) { func tCheckObj(t testing.TB) func(IPersistent, *Connection, Oid, Tid, ObjectState, int32) {
return func(obj IPersistent, jar *Connection, oid Oid, serial Tid, state ObjectState, refcnt int32) { return func(obj IPersistent, jar *Connection, oid Oid, serial Tid, state ObjectState, refcnt int32) {
t.Helper() t.Helper()
_checkObj(t, obj, jar, oid, serial, state, refcnt) checkObj(t, obj, jar, oid, serial, state, refcnt)
} }
} }
...@@ -251,7 +250,7 @@ func (t *tPersistentDB) checkObj(obj *MyObject, oid Oid, serial Tid, state Objec ...@@ -251,7 +250,7 @@ func (t *tPersistentDB) checkObj(obj *MyObject, oid Oid, serial Tid, state Objec
t.Fatalf("conn.get %s -> not same object:\nhave: %#v\nwant: %#v", oid, connObj, oid) t.Fatalf("conn.get %s -> not same object:\nhave: %#v\nwant: %#v", oid, connObj, oid)
} }
_checkObj(t.T, obj, t.conn, oid, serial, state, refcnt) checkObj(t.T, obj, t.conn, oid, serial, state, refcnt)
if state == GHOST { if state == GHOST {
if len(valueOk) != 0 { if len(valueOk) != 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