Files
MeshCore/test/test_morse_rx_squelch.py
mikecarper af08c02a00
Run Unit Tests / nrf52-companion-smoke (push) Canceled after 0s
Run Unit Tests / nrf52-sensor-smoke (push) Canceled after 0s
Run Unit Tests / esp32-sensor-smoke (push) Canceled after 0s
Run Unit Tests / management-reports (push) Canceled after 0s
Run Unit Tests / stm32-companion-smoke (push) Canceled after 0s
Run Unit Tests / bootloader-version (push) Canceled after 0s
Run Unit Tests / test (push) Canceled after 0s
Run Unit Tests / hosted-doc-links (push) Canceled after 0s
Build and deploy Docs site to GitHub Pages / github-pages (push) Canceled after 0s
Correct Morse human spacing and harden speed qualification
2026-10-13 05:25:07 -07:00

29 lines
1.2 KiB
Python

"""Execute the optional bench RSSI floor against the real sampled decoder."""
from pathlib import Path
import unittest
from test_morse_tx import compile_run
ROOT = Path(__file__).resolve().parents[1]
class MorseRxSquelchTests(unittest.TestCase):
def test_hil_noise_prekey_real_dot_quiet_hysteresis_and_unchanged_auto(self):
code = (ROOT / "test/fixtures/morse_rx_squelch.cpp").read_text(encoding="ascii")
output = compile_run(self, code, flags=("-DMESH_MORSE_HIL=1",))
self.assertIn("actual squelch checks passed", output)
def test_shipping_weak_behavior_and_layout_have_no_squelch_dependency(self):
code = (ROOT / "test/fixtures/morse_rx_squelch.cpp").read_text(encoding="ascii")
output = compile_run(self, code, flags=("-DMESH_MORSE_HIL=0",))
self.assertIn("actual squelch checks passed", output)
def test_shipping_has_no_squelch_api_or_storage(self):
code = "#include <helpers/MorseRx.h>\nint main() { return mesh::setMorseHilSquelch(-100); }\n"
with self.assertRaisesRegex(AssertionError, "setMorseHilSquelch.*not a member"):
compile_run(self, code, flags=("-DMESH_MORSE_HIL=0",))
if __name__ == "__main__":
unittest.main()