aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pipewire/header_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-11-25 08:09:10 +0900
committerOphestra <cat@gensokyo.uk>2025-11-25 08:09:10 +0900
commite77652bf89bf1f1e55174cd61a745cf13ca31e48 (patch)
treeb538f1f1422a7384f5a89a6fbecb9e3bcd8c6ce3 /internal/pipewire/header_test.go
parent88d3e464136db5192e311e4be077aa3db218e5f2 (diff)
internal/pipewire: move test data to files
These get very big later on, and would be painful to represent as the compound literal. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pipewire/header_test.go')
-rw-r--r--internal/pipewire/header_test.go36
1 files changed, 10 insertions, 26 deletions
diff --git a/internal/pipewire/header_test.go b/internal/pipewire/header_test.go
index efcea71f..95f6ce13 100644
--- a/internal/pipewire/header_test.go
+++ b/internal/pipewire/header_test.go
@@ -11,33 +11,17 @@ func TestHeader(t *testing.T) {
t.Parallel()
encodingTestCases[pipewire.Header, *pipewire.Header]{
- {"PW_CORE_METHOD_HELLO", []byte{
- // Id
- 0, 0, 0, 0,
- // size
- 0x18, 0, 0,
- // opcode
- 1,
- // seq
- 0, 0, 0, 0,
- // n_fds
- 0, 0, 0, 0,
- }, pipewire.Header{ID: pipewire.PW_ID_CORE, Opcode: pipewire.PW_CORE_METHOD_HELLO,
- Size: 0x18, Sequence: 0, FileCount: 0}, nil},
+ {"PW_CORE_METHOD_HELLO", []byte(sendmsg00Message00Header), pipewire.Header{
+ ID: pipewire.PW_ID_CORE,
+ Opcode: pipewire.PW_CORE_METHOD_HELLO,
+ Size: 0x18, Sequence: 0, FileCount: 0,
+ }, nil},
- {"PW_CLIENT_METHOD_UPDATE_PROPERTIES", []byte{
- // Id
- 1, 0, 0, 0,
- // size
- 0, 6, 0,
- // opcode
- 2,
- // seq
- 1, 0, 0, 0,
- // n_fds
- 0, 0, 0, 0,
- }, pipewire.Header{ID: pipewire.PW_ID_CLIENT, Opcode: pipewire.PW_CLIENT_METHOD_UPDATE_PROPERTIES,
- Size: 0x600, Sequence: 1, FileCount: 0}, nil},
+ {"PW_CLIENT_METHOD_UPDATE_PROPERTIES", []byte(sendmsg00Message01Header), pipewire.Header{
+ ID: pipewire.PW_ID_CLIENT,
+ Opcode: pipewire.PW_CLIENT_METHOD_UPDATE_PROPERTIES,
+ Size: 0x600, Sequence: 1, FileCount: 0,
+ }, nil},
{"PW_SECURITY_CONTEXT_METHOD_CREATE", []byte{
// Id