mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 18:24:35 +03:00
in more tests, after closing accounts, check the last reference is indeed gone
This commit is contained in:
@ -41,7 +41,10 @@ func FuzzServer(f *testing.F) {
|
||||
if err != nil {
|
||||
f.Fatalf("open account: %v", err)
|
||||
}
|
||||
defer acc.Close()
|
||||
defer func() {
|
||||
acc.Close()
|
||||
acc.CheckClosed()
|
||||
}()
|
||||
err = acc.SetPassword(log, "testtest")
|
||||
if err != nil {
|
||||
f.Fatalf("set password: %v", err)
|
||||
|
@ -139,6 +139,7 @@ func (ts *testserver) close() {
|
||||
ts.switchStop()
|
||||
err := ts.acc.Close()
|
||||
tcheck(ts.t, err, "closing account")
|
||||
ts.acc.CheckClosed()
|
||||
ts.acc = nil
|
||||
}
|
||||
|
||||
@ -1367,7 +1368,10 @@ func TestCatchall(t *testing.T) {
|
||||
|
||||
acc, err := store.OpenAccount(pkglog, "catchall")
|
||||
tcheck(t, err, "open account")
|
||||
defer acc.Close()
|
||||
defer func() {
|
||||
acc.Close()
|
||||
acc.CheckClosed()
|
||||
}()
|
||||
n, err = bstore.QueryDB[store.Message](ctxbg, acc.DB).Count()
|
||||
tcheck(t, err, "checking delivered messages to catchall account")
|
||||
tcompare(t, n, 1)
|
||||
|
Reference in New Issue
Block a user