aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pipewire/core_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-11-25 15:15:20 +0900
committerOphestra <cat@gensokyo.uk>2025-11-25 15:16:12 +0900
commitcfeb7818eb3d7f3e83492bab092adce8f90f83c1 (patch)
tree19cd7154d81984fdae869bbc802b186d8cf7751d /internal/pipewire/core_test.go
parent05391da5562db46d379f81145b461a0a4ad10c8d (diff)
internal/pipewire: implement Core::Info and generation footer
These are not directly related but are first encountered on the same message in the capture. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pipewire/core_test.go')
-rw-r--r--internal/pipewire/core_test.go55
1 files changed, 55 insertions, 0 deletions
diff --git a/internal/pipewire/core_test.go b/internal/pipewire/core_test.go
index a04013c2..661dc391 100644
--- a/internal/pipewire/core_test.go
+++ b/internal/pipewire/core_test.go
@@ -6,6 +6,61 @@ import (
"hakurei.app/internal/pipewire"
)
+func TestFooterCoreGeneration(t *testing.T) {
+ encodingTestCases[pipewire.Footer[pipewire.FooterCoreGeneration], *pipewire.Footer[pipewire.FooterCoreGeneration]]{
+ {"sample", []byte(recvmsg00Message00Footer), pipewire.Footer[pipewire.FooterCoreGeneration]{
+ Opcode: pipewire.FOOTER_CORE_OPCODE_GENERATION,
+ Payload: pipewire.FooterCoreGeneration{RegistryGeneration: 34},
+ }, nil},
+ }.run(t)
+}
+
+func TestCoreInfo(t *testing.T) {
+ encodingTestCases[pipewire.CoreInfo, *pipewire.CoreInfo]{
+ {"sample", []byte(recvmsg00Message00POD), pipewire.CoreInfo{
+ ID: 0,
+ Cookie: -2069267610,
+ UserName: "alice",
+ HostName: "nixos",
+ Version: "1.4.7",
+ Name: "pipewire-0",
+ ChangeMask: pipewire.PW_CORE_CHANGE_MASK_PROPS,
+ Props: &pipewire.SPADict{NItems: 31, Items: []pipewire.SPADictItem{
+ {Key: "config.name", Value: "pipewire.conf"},
+ {Key: "application.name", Value: "pipewire"},
+ {Key: "application.process.binary", Value: "pipewire"},
+ {Key: "application.language", Value: "en_US.UTF-8"},
+ {Key: "application.process.id", Value: "1446"},
+ {Key: "application.process.user", Value: "alice"},
+ {Key: "application.process.host", Value: "nixos"},
+ {Key: "window.x11.display", Value: ":0"},
+ {Key: "cpu.vm.name", Value: "qemu"},
+ {Key: "link.max-buffers", Value: "16"},
+ {Key: "core.daemon", Value: "true"},
+ {Key: "core.name", Value: "pipewire-0"},
+ {Key: "default.clock.min-quantum", Value: "1024"},
+ {Key: "cpu.max-align", Value: "32"},
+ {Key: "default.clock.rate", Value: "48000"},
+ {Key: "default.clock.quantum", Value: "1024"},
+ {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: "log.level", Value: "2"},
+ {Key: "clock.power-of-two-quantum", Value: "true"},
+ {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: "object.id", Value: "0"},
+ {Key: "object.serial", Value: "0"}},
+ }}, nil},
+ }.run(t)
+}
+
func TestCoreHello(t *testing.T) {
encodingTestCases[pipewire.CoreHello, *pipewire.CoreHello]{
{"sample", []byte(sendmsg00Message00POD), pipewire.CoreHello{