dbus: improve unsealed behaviour coverage

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
Ophestra Umiker 2024-10-12 00:53:08 +09:00
parent 662f2a9d2c
commit 0f421644be
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q
2 changed files with 9 additions and 1 deletions

View File

@ -137,6 +137,15 @@ func testProxyStartWaitCloseString(t *testing.T, sandbox bool) {
} }
}) })
t.Run("unsealed start of "+id, func(t *testing.T) {
want := "proxy not sealed"
if err := p.Start(nil, nil, sandbox); err == nil || err.Error() != want {
t.Errorf("Start() error = %v, wantErr %q",
err, errors.New(want))
return
}
})
t.Run("unsealed wait of "+id, func(t *testing.T) { t.Run("unsealed wait of "+id, func(t *testing.T) {
wantErr := "proxy not started" wantErr := "proxy not started"
if err := p.Wait(); err == nil || err.Error() != wantErr { if err := p.Wait(); err == nil || err.Error() != wantErr {

View File

@ -175,7 +175,6 @@ func testCaseGenerate() {
// inject nulls // inject nulls
fi := &testCasesV[len(samples)+i] fi := &testCasesV[len(samples)+i]
fi.wantErr = true fi.wantErr = true
fi.c = &*fi.c
injectNulls(&fi.c.See) injectNulls(&fi.c.See)
injectNulls(&fi.c.Talk) injectNulls(&fi.c.Talk)