Tests: guard the service peer-port default matches the main app
Local checkpoint - NOT for public release. Adds a check that a peer with no explicit port resolves to RemPacket.DefaultPeerDialPort (not the local audio port), guarding the third audit divergence. Gate 26/26. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
78a9aa6572
commit
ce45489b30
@@ -751,11 +751,14 @@ internal static class SelfTest
|
||||
var probe = new Profile { WasapiSendMode = "devices" };
|
||||
probe.SelectedWasapiSendOutputs.Add("dev-a");
|
||||
probe.SelectedConnectedPeers.Add("127.0.0.1:47846");
|
||||
probe.SelectedConnectedPeers.Add("10.0.0.9"); // no explicit port → the standard peer port
|
||||
probe.SelectedConnectedPeers.Add("bad::garbage::host");
|
||||
Check(ServiceSendHost.BuildSendSpecs(probe).Any(s => s.DeviceId == "dev-a" && s.Kind == CaptureKind.Loopback),
|
||||
"a WASAPI send output must become a loopback spec");
|
||||
var eps = ServiceSendHost.BuildEndpoints(probe);
|
||||
Check(eps.Any(e => e.Address.ToString() == "127.0.0.1" && e.Port == 47846), "a host:port peer must resolve to an endpoint");
|
||||
Check(eps.Any(e => e.Address.ToString() == "10.0.0.9" && e.Port == RemPacket.DefaultPeerDialPort),
|
||||
"a peer with no port must use the standard peer port (not the local audio port) — same as the main app");
|
||||
|
||||
using var receiver = new AudioReceiver();
|
||||
try { receiver.Start(port); }
|
||||
|
||||
Reference in New Issue
Block a user