Commit 166cdb7
test(car): cover the buildNodeUi snr resolver path
Address review feedback on #6523.
The car signal-quality tests called determineSignalQuality() directly, so
nothing proved buildNodeUi() routes through Node.snrOrNull rather than reading
node.snr. Add two buildNodeUi() cases: an unset node resolves to UNKNOWN (this
fails if the call reverts to node.snr, which would feed Float.MAX_VALUE into the
bands and rate a node with no reading as EXCELLENT), and a 0 dB node still rates
EXCELLENT.
Also document the nullable snr/rssi fields in the AppFunction schema and correct
RSSI's unit from dB to dBm to match the NodeDetails contract, and record in
SnrExtensionsTest why the proto-absent case is not asserted there: rx_snr is
still a non-null float upstream, so snrOrNull() cannot return null for any
packet the test could construct. Null handling is covered where a null is
representable, in MetricFormatterTest and LoraSignalIndicatorUiTest.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent ae69463 commit 166cdb7
3 files changed
Lines changed: 29 additions & 2 deletions
File tree
- androidApp/src/google/kotlin/org/meshtastic/app/ai/appfunctions
- core/model/src/commonTest/kotlin/org/meshtastic/core/model/util
- feature/car/src/test/kotlin/org/meshtastic/feature/car/util
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
73 | 93 | | |
74 | 94 | | |
75 | 95 | | |
| |||
0 commit comments