Commit e9f65d1d authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f642592d
......@@ -106,6 +106,7 @@ type DB struct {
tδkeep time.Duration
// openers waiting for δtail.Head to become covering their at.
// XXX -> headWait?
δwait map[δwaiter]struct{} // set{(at, ready)}
// XXX δtail/δwait -> Storage. XXX or -> Cache? (so it is not duplicated many times for many DB case)
......@@ -185,7 +186,7 @@ func (db *DB) watcher(watchq <-chan Event) { // XXX err ?
return // closed
}
fmt.Printf("db: watcher <- %v\n", event)
//fmt.Printf("db: watcher <- %v\n", event)
var δ *EventCommit
switch event := event.(type) {
......@@ -194,7 +195,7 @@ func (db *DB) watcher(watchq <-chan Event) { // XXX err ?
case *EventError:
fmt.Printf("db: watcher: error: %s\n", event.Err)
continue // XXX shutdown instead?
continue // XXX shutdown instead
case *EventCommit:
δ = event
......@@ -224,7 +225,7 @@ func (db *DB) watcher(watchq <-chan Event) { // XXX err ?
// wakeup waiters outside of db.mu
for _, ready := range readyv {
fmt.Printf("db: watcher: wakeup %v\n", ready)
//fmt.Printf("db: watcher: wakeup %v\n", ready)
close(ready)
}
}
......
......@@ -80,7 +80,7 @@ func init() {
// _checkObj verifies current state of persistent object.
//
// 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, loading *loadState) {
func _checkObj(t testing.TB, obj IPersistent, jar *Connection, oid Oid, serial Tid, state ObjectState, refcnt int32) {
t.Helper()
xbase := reflect.ValueOf(obj).Elem().FieldByName("Persistent")
pbase := xbase.Addr().Interface().(*Persistent)
......@@ -126,10 +126,10 @@ 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) {
return func(obj IPersistent, jar *Connection, oid Oid, serial Tid, state ObjectState, refcnt int32, loading *loadState) {
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) {
t.Helper()
_checkObj(t, obj, jar, oid, serial, state, refcnt, loading)
_checkObj(t, obj, jar, oid, serial, state, refcnt)
}
}
......@@ -145,7 +145,7 @@ func TestPersistentBasic(t *testing.T) {
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.state, (*mem.Buf)(nil))
......@@ -157,7 +157,7 @@ func TestPersistentBasic(t *testing.T) {
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")
// t.zodb.MyOldObject -> *MyObject
......@@ -167,7 +167,7 @@ func TestPersistentBasic(t *testing.T) {
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")
// ClassOf(unregistered-obj)
......@@ -251,7 +251,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)
}
_checkObj(t.T, obj, t.conn, oid, serial, state, refcnt, /*loading*/nil)
_checkObj(t.T, obj, t.conn, oid, serial, state, refcnt)
if state == GHOST {
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