diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-03 02:26:14 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-03 02:26:14 +0900 |
| commit | d16da6da8c4880d90dc35fa9006806f7c0395d7f (patch) | |
| tree | d4ca8fed4e14bcffe63268daa6d8efd1923ff03b /system/dbus_test.go | |
| parent | e58181a930064385c881b7ee1cac4914dd435121 (diff) | |
system: enforce absolute paths
This is less error-prone, and is quite easy to integrate considering internal/app has already migrated to container.Absolute.
Closes #11.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'system/dbus_test.go')
| -rw-r--r-- | system/dbus_test.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/system/dbus_test.go b/system/dbus_test.go index 1ae217bd..f20f984a 100644 --- a/system/dbus_test.go +++ b/system/dbus_test.go @@ -82,7 +82,7 @@ func TestDBusProxyOp(t *testing.T) { Op: "dbus", Err: ErrDBusConfig, Msg: "attempted to create message bus proxy args without session bus config", } - if f, err := sys.ProxyDBus(nil, new(dbus.Config), "", ""); !reflect.DeepEqual(err, wantErr) { + if f, err := sys.ProxyDBus(nil, new(dbus.Config), nil, nil); !reflect.DeepEqual(err, wantErr) { t.Errorf("ProxyDBus: error = %v, want %v", err, wantErr) } else if f != nil { t.Errorf("ProxyDBus: f = %p", f) @@ -98,10 +98,10 @@ func TestDBusProxyOp(t *testing.T) { }() sys.MustProxyDBus( - "/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/bus", &dbus.Config{ + m("/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/bus"), &dbus.Config{ // use impossible value here as an implicit assert that it goes through the stub Talk: []string{"session\x00"}, Filter: true, - }, "/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/system_bus_socket", &dbus.Config{ + }, m("/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/system_bus_socket"), &dbus.Config{ // use impossible value here as an implicit assert that it goes through the stub Talk: []string{"system\x00"}, Filter: true, }) @@ -128,8 +128,8 @@ func TestDBusProxyOp(t *testing.T) { // use impossible value here as an implicit assert that it goes through the stub Talk: []string{"system\x00"}, Filter: true, }, - "/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/bus", - "/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/system_bus_socket"); !reflect.DeepEqual(err, wantErr) { + m("/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/bus"), + m("/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/system_bus_socket")); !reflect.DeepEqual(err, wantErr) { t.Errorf("ProxyDBus: error = %v", err) } else if f != nil { t.Errorf("ProxyDBus: f = %p", f) @@ -146,10 +146,10 @@ func TestDBusProxyOp(t *testing.T) { {"full", 0xcafebabe, func(_ *testing.T, sys *I) { sys.MustProxyDBus( - "/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/bus", &dbus.Config{ + m("/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/bus"), &dbus.Config{ // use impossible value here as an implicit assert that it goes through the stub Talk: []string{"session\x00"}, Filter: true, - }, "/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/system_bus_socket", &dbus.Config{ + }, m("/tmp/hakurei.0/99dd71ee2146369514e0d10783368f8f/system_bus_socket"), &dbus.Config{ // use impossible value here as an implicit assert that it goes through the stub Talk: []string{"system\x00"}, Filter: true, }) |
