test: example addresses come from the documentation range

Sonos, UPnP and public-address tests used addresses from a real home
network. They now use 198.51.100.x (RFC 5737), keeping the last number.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-26 08:59:25 -05:00
co-authored by Claude Opus 5.5
parent dd27e014c0
commit 1942cb39cf
5 changed files with 13 additions and 13 deletions
@@ -265,7 +265,7 @@ class UpnpDiscoveryController @Inject constructor(
}
private companion object {
// " (192.168.0.77)" trailing host suffix some generic UPnP
// " (198.51.100.77)" trailing host suffix some generic UPnP
// devices append. Anchored to end-of-string so it never eats
// a legitimate parenthetical inside a name.
val IP_SUFFIX_REGEX = Regex("""\s*\(\d+\.\d+\.\d+\.\d+\)$""")
@@ -21,9 +21,9 @@ class SingleTrackQueueTest {
name = "Room",
manufacturer = manufacturer,
modelName = "",
avTransportControlUrl = "http://192.168.0.2:1400/AVTransport/Control".toHttpUrl(),
avTransportControlUrl = "http://198.51.100.2:1400/AVTransport/Control".toHttpUrl(),
renderingControlUrl = null,
zoneGroupTopologyControlUrl = if (zgt) "http://192.168.0.2:1400/ZGT/Control".toHttpUrl() else null,
zoneGroupTopologyControlUrl = if (zgt) "http://198.51.100.2:1400/ZGT/Control".toHttpUrl() else null,
)
@Test
@@ -17,7 +17,7 @@ import kotlin.test.assertNull
*/
class DeviceDescriptionTest {
private val base = "http://192.168.1.50:1400/xml/device_description.xml".toHttpUrl()
private val base = "http://198.51.100.50:1400/xml/device_description.xml".toHttpUrl()
@Test
fun `parses Sonos-shaped description`() {
@@ -51,11 +51,11 @@ class DeviceDescriptionTest {
assertEquals("Sonos One", desc.modelName)
assertEquals("uuid:RINCON_ABC", desc.udn)
assertEquals(
"http://192.168.1.50:1400/MediaRenderer/AVTransport/Control",
"http://198.51.100.50:1400/MediaRenderer/AVTransport/Control",
desc.avTransportControlUrl.toString(),
)
assertEquals(
"http://192.168.1.50:1400/MediaRenderer/RenderingControl/Control",
"http://198.51.100.50:1400/MediaRenderer/RenderingControl/Control",
desc.renderingControlUrl?.toString(),
)
assertNull(desc.zoneGroupTopologyControlUrl)
@@ -108,7 +108,7 @@ class DeviceDescriptionTest {
val desc = DeviceDescription.parse(xml, base)
assertNotNull(desc)
assertEquals(
"http://192.168.1.50:1400/ZoneGroupTopology/Control",
"http://198.51.100.50:1400/ZoneGroupTopology/Control",
desc.zoneGroupTopologyControlUrl?.toString(),
)
}
@@ -13,7 +13,7 @@ class SonosTopologyTest {
<ZoneGroups>
<ZoneGroup Coordinator="RINCON_A" ID="RINCON_A:1">
<ZoneGroupMember UUID="RINCON_A" ZoneName="Kitchen"
Location="http://192.168.1.10:1400/xml/device_description.xml"/>
Location="http://198.51.100.10:1400/xml/device_description.xml"/>
</ZoneGroup>
</ZoneGroups>
</ZoneGroupState>
@@ -33,10 +33,10 @@ class SonosTopologyTest {
<ZoneGroups>
<ZoneGroup Coordinator="RINCON_L" ID="RINCON_L:2">
<ZoneGroupMember UUID="RINCON_L" ZoneName="Living Room"
Location="http://192.168.1.11:1400/xml/device_description.xml"
Location="http://198.51.100.11:1400/xml/device_description.xml"
ChannelMapSet="RINCON_L:LF,LF;RINCON_R:RF,RF"/>
<ZoneGroupMember UUID="RINCON_R" ZoneName="Living Room"
Location="http://192.168.1.12:1400/xml/device_description.xml"
Location="http://198.51.100.12:1400/xml/device_description.xml"
ChannelMapSet="RINCON_L:LF,LF;RINCON_R:RF,RF"/>
</ZoneGroup>
</ZoneGroups>
@@ -82,7 +82,7 @@ class SonosTopologyTest {
<ZoneGroups>
<ZoneGroup Coordinator="RINCON_A" ID="RINCON_A:1">
<ZoneGroupMember UUID="RINCON_A" ZoneName="Kitchen"
Location="http://192.168.1.10:1400/xml/device_description.xml"/>
Location="http://198.51.100.10:1400/xml/device_description.xml"/>
</ZoneGroup>
</ZoneGroups>
</ZoneGroupState>
@@ -98,7 +98,7 @@ class SonosTopologyTest {
&lt;ZoneGroups&gt;
&lt;ZoneGroup Coordinator="RINCON_A" ID="RINCON_A:1"&gt;
&lt;ZoneGroupMember UUID="RINCON_A" ZoneName="Kitchen"
Location="http://192.168.1.10:1400/xml/device_description.xml"/&gt;
Location="http://198.51.100.10:1400/xml/device_description.xml"/&gt;
&lt;/ZoneGroup&gt;
&lt;/ZoneGroups&gt;
&lt;/ZoneGroupState&gt;