From 0f421644bec4cf94737b5da1c8beeb2c99b9f158 Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Sat, 12 Oct 2024 00:53:08 +0900 Subject: [PATCH] dbus: improve unsealed behaviour coverage Signed-off-by: Ophestra Umiker --- dbus/dbus_test.go | 9 +++++++++ dbus/samples_test.go | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dbus/dbus_test.go b/dbus/dbus_test.go index b1d4669..8397aff 100644 --- a/dbus/dbus_test.go +++ b/dbus/dbus_test.go @@ -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) { wantErr := "proxy not started" if err := p.Wait(); err == nil || err.Error() != wantErr { diff --git a/dbus/samples_test.go b/dbus/samples_test.go index b887393..87fe46e 100644 --- a/dbus/samples_test.go +++ b/dbus/samples_test.go @@ -175,7 +175,6 @@ func testCaseGenerate() { // inject nulls fi := &testCasesV[len(samples)+i] fi.wantErr = true - fi.c = &*fi.c injectNulls(&fi.c.See) injectNulls(&fi.c.Talk)