testing library

Test doubles for core_rtlsdr — import this (never dart:ffi, never driver_rtlsdr 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/shareRecording without an Android device.
FakeRtlSdrDriver
In-memory RtlSdrDriver with no FFI/Android dependency — for unit tests of core_rtlsdr controllers, and for consumers (e.g. a future widget_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.