Commit 8b93cb5e authored by Kirill Smelkov's avatar Kirill Smelkov

go/zodb: persistent: tests: Stop checking for .loading

We were not actually checking for it and it is hard to check correctly
since .loading is transient.
parent e0d59f5d
...@@ -70,7 +70,7 @@ func TestPersistent(t *testing.T) { ...@@ -70,7 +70,7 @@ func TestPersistent(t *testing.T) {
assert := require.New(t) assert := require.New(t)
// checkObj verifies current state of persistent object. // checkObj verifies current state of persistent object.
checkObj := func(obj IPersistent, jar *Connection, oid Oid, serial Tid, state ObjectState, refcnt int32, loading *loadState) { checkObj := func(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)
...@@ -106,7 +106,6 @@ func TestPersistent(t *testing.T) { ...@@ -106,7 +106,6 @@ func TestPersistent(t *testing.T) {
if pbase.instance != obj { if pbase.instance != obj {
badf("base.instance != obj") badf("base.instance != obj")
} }
// XXX loading too?
} }
// unknown type -> Broken // unknown type -> Broken
...@@ -116,7 +115,7 @@ func TestPersistent(t *testing.T) { ...@@ -116,7 +115,7 @@ func TestPersistent(t *testing.T) {
t.Fatalf("unknown -> %T; want Broken", xobj) t.Fatalf("unknown -> %T; want Broken", xobj)
} }
checkObj(b, nil, 10, InvalidTid, GHOST, 0, nil) checkObj(b, nil, 10, InvalidTid, GHOST, 0)
assert.Equal(b.class, "t.unknown") assert.Equal(b.class, "t.unknown")
assert.Equal(b.state, (*mem.Buf)(nil)) assert.Equal(b.state, (*mem.Buf)(nil))
...@@ -128,7 +127,7 @@ func TestPersistent(t *testing.T) { ...@@ -128,7 +127,7 @@ func TestPersistent(t *testing.T) {
t.Fatalf("t.zodb.MyObject -> %T; want MyObject", xobj) t.Fatalf("t.zodb.MyObject -> %T; want MyObject", xobj)
} }
checkObj(obj, nil, 11, InvalidTid, GHOST, 0, nil) checkObj(obj, nil, 11, InvalidTid, GHOST, 0)
assert.Equal(ClassOf(obj), "t.zodb.MyObject") assert.Equal(ClassOf(obj), "t.zodb.MyObject")
// t.zodb.MyOldObject -> *MyObject // t.zodb.MyOldObject -> *MyObject
...@@ -138,7 +137,7 @@ func TestPersistent(t *testing.T) { ...@@ -138,7 +137,7 @@ func TestPersistent(t *testing.T) {
t.Fatalf("t.zodb.MyOldObject -> %T; want MyObject", xobj) t.Fatalf("t.zodb.MyOldObject -> %T; want MyObject", xobj)
} }
checkObj(obj, nil, 12, InvalidTid, GHOST, 0, nil) checkObj(obj, nil, 12, InvalidTid, GHOST, 0)
assert.Equal(ClassOf(obj), "t.zodb.MyObject") assert.Equal(ClassOf(obj), "t.zodb.MyObject")
// ClassOf(unregistered-obj) // ClassOf(unregistered-obj)
......
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