mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-06-17 02:09:29 -04:00
Add ChannelPresetNameTest (commonTest, so it gates every PR) pinning every ModemPreset to its exact firmware-canonical channel name from DisplayFormatters::getModemPresetDisplayName(preset, useShortName=false). The name is interop-critical (it feeds the channel hash, channel number/frequency and MQTT topic), so the test: - locks the mapping against accidental edits (e.g. "LongMod" -> "LongModerate"), - asserts set-completeness vs ModemPreset.entries, so a new preset that was added to Channel.name's `when` but not pinned here fails loudly (also catches someone silencing the intentional compile tripwire with an `else`), - covers the deprecated VERY_LONG_SLOW, which still has a real name. This backstops Channel.name's exhaustive `when` without weakening it. The numeric on-air anchors (hash/channelNum/radioFreq) stay in ChannelTest. Remove the old androidDeviceTest allModemPresetsHaveValidNames, which only asserted name != "Invalid" — a value the no-else `when` can never produce, so it gave the illusion of a name guard while testing nothing, and ran only on-device rather than on every PR. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>