diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-11-26 16:17:38 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-11-26 16:17:38 +0900 |
| commit | 10ff276da187868be1fa136ffd41ee2904c2cea8 (patch) | |
| tree | 563d2ce2abdb0d772d10be1b00d11be8e3dff235 /internal/pipewire | |
| parent | fd4d379b6777168c3251c85d153dbdf6b82f2b35 (diff) | |
internal/pipewire: additional Client::Info test case
This message follows the other Client::Info event before it. No idea why.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pipewire')
| -rw-r--r-- | internal/pipewire/client_test.go | 44 | ||||
| -rw-r--r-- | internal/pipewire/header_test.go | 6 | ||||
| -rw-r--r-- | internal/pipewire/pipewire_test.go | 5 | ||||
| -rw-r--r-- | internal/pipewire/testdata/15-recvmsg00-message03-header | bin | 0 -> 16 bytes | |||
| -rw-r--r-- | internal/pipewire/testdata/16-recvmsg00-message03-POD | bin | 0 -> 1952 bytes |
5 files changed, 55 insertions, 0 deletions
diff --git a/internal/pipewire/client_test.go b/internal/pipewire/client_test.go index c9d790ce..69a9547d 100644 --- a/internal/pipewire/client_test.go +++ b/internal/pipewire/client_test.go @@ -24,6 +24,50 @@ func TestClientInfo(t *testing.T) { {Key: "object.id", Value: "34"}, {Key: "object.serial", Value: "34"}, }}}, nil}, + + {"sample*", []byte(recvmsg00Message03POD), pipewire.ClientInfo{ + ID: 34, + ChangeMask: pipewire.PW_CLIENT_CHANGE_MASK_PROPS, + Props: &pipewire.SPADict{NItems: 38, Items: []pipewire.SPADictItem{ + {Key: "pipewire.protocol", Value: "protocol-native"}, + {Key: "core.name", Value: "pipewire-alice-1443"}, + {Key: "pipewire.sec.socket", Value: "pipewire-0-manager"}, + {Key: "pipewire.sec.pid", Value: "1443"}, + {Key: "pipewire.sec.uid", Value: "1000"}, + {Key: "pipewire.sec.gid", Value: "100"}, + {Key: "module.id", Value: "2"}, + {Key: "object.id", Value: "34"}, + {Key: "object.serial", Value: "34"}, + {Key: "remote.intention", Value: "manager"}, + {Key: "application.name", Value: "pw-container"}, + {Key: "application.process.binary", Value: "pw-container"}, + {Key: "application.language", Value: "en_US.UTF-8"}, + {Key: "application.process.id", Value: "1443"}, + {Key: "application.process.user", Value: "alice"}, + {Key: "application.process.host", Value: "nixos"}, + {Key: "application.process.session-id", Value: "1"}, + {Key: "window.x11.display", Value: ":0"}, + {Key: "cpu.vm.name", Value: "qemu"}, + {Key: "log.level", Value: "0"}, + {Key: "cpu.max-align", Value: "32"}, + {Key: "default.clock.rate", Value: "48000"}, + {Key: "default.clock.quantum", Value: "1024"}, + {Key: "default.clock.min-quantum", Value: "32"}, + {Key: "default.clock.max-quantum", Value: "2048"}, + {Key: "default.clock.quantum-limit", Value: "8192"}, + {Key: "default.clock.quantum-floor", Value: "4"}, + {Key: "default.video.width", Value: "640"}, + {Key: "default.video.height", Value: "480"}, + {Key: "default.video.rate.num", Value: "25"}, + {Key: "default.video.rate.denom", Value: "1"}, + {Key: "clock.power-of-two-quantum", Value: "true"}, + {Key: "link.max-buffers", Value: "64"}, + {Key: "mem.warn-mlock", Value: "false"}, + {Key: "mem.allow-mlock", Value: "true"}, + {Key: "settings.check-quantum", Value: "false"}, + {Key: "settings.check-rate", Value: "false"}, + {Key: "core.version", Value: "1.4.7"}, + }}}, nil}, }.run(t) } diff --git a/internal/pipewire/header_test.go b/internal/pipewire/header_test.go index 06189889..20f7ded3 100644 --- a/internal/pipewire/header_test.go +++ b/internal/pipewire/header_test.go @@ -53,6 +53,12 @@ func TestHeader(t *testing.T) { Size: 0x1f0, Sequence: 2, FileCount: 0, }, nil}, + {"PW_CLIENT_EVENT_INFO*", []byte(recvmsg00Message03Header), pipewire.Header{ + ID: pipewire.PW_ID_CLIENT, + Opcode: pipewire.PW_CLIENT_EVENT_INFO, + Size: 0x7a0, Sequence: 3, FileCount: 0, + }, nil}, + {"PW_SECURITY_CONTEXT_METHOD_CREATE", []byte{ // Id 3, 0, 0, 0, diff --git a/internal/pipewire/pipewire_test.go b/internal/pipewire/pipewire_test.go index 9511e2fe..bfdc571c 100644 --- a/internal/pipewire/pipewire_test.go +++ b/internal/pipewire/pipewire_test.go @@ -41,4 +41,9 @@ var ( recvmsg00Message02Header string //go:embed testdata/14-recvmsg00-message02-POD recvmsg00Message02POD string + + //go:embed testdata/15-recvmsg00-message03-header + recvmsg00Message03Header string + //go:embed testdata/16-recvmsg00-message03-POD + recvmsg00Message03POD string ) diff --git a/internal/pipewire/testdata/15-recvmsg00-message03-header b/internal/pipewire/testdata/15-recvmsg00-message03-header Binary files differnew file mode 100644 index 00000000..0964c8a0 --- /dev/null +++ b/internal/pipewire/testdata/15-recvmsg00-message03-header diff --git a/internal/pipewire/testdata/16-recvmsg00-message03-POD b/internal/pipewire/testdata/16-recvmsg00-message03-POD Binary files differnew file mode 100644 index 00000000..be7157ce --- /dev/null +++ b/internal/pipewire/testdata/16-recvmsg00-message03-POD |
