Files
Meshtastic-Android/core
James Rich 4aba9cd3e9 test: pin ModemPreset->channel-name contract; drop vacuous name check
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>
2026-06-13 11:53:34 -05:00
..