testing library
Test doubles for driver_rtlsdr — import this (never dart:ffi directly)
to test radio logic or UI built on top of this package without an
Android device, an emulator, or a dongle.
final driver = FakeRtlSdrDriver();
final radio = RadioController(driver);
radio.startStreaming();
driver.rfLevelDbfs = -10; // simulate a strong signal
radio.refreshStats();
expect(radio.rfLevelDbfs, -10);
Classes
- FakeDownloadsChannel
-
In-memory DownloadsChannel with no platform-channel dependency — for
unit-testing
RecordingController.startRecordingToDownloads/startIqRecordingToDownloads/shareRecordingwithout an Android device. - FakeRtlSdrDriver
-
In-memory RtlSdrDriver with no FFI/Android dependency — for unit tests
of
core_rtlsdrcontrollers, and for consumers (e.g. a futurewidget_rtlsdr) that want to test UI against a radio session without a dongle or an emulator. - InMemoryPresetsRepository
- Non-persistent PresetsRepository — presets live only for the process lifetime. Useful for tests, and for apps that don't want persistence.