Expand description
A fake server library for the protocol fidl.fuchsia.time.alarms/WakeAlarms
, for reuse in the
unit tests of clients of WakeAlarm
.
It serves a simplified but somewhat functional flavor of the WakeAlarms
FIDL API, which
covers the needs of unit tests we identified so far. This is not a fully-fledged
implementation, so be sure to verify that what it does is enough for your purposes.
If you need a fully capable server component for tests, see
//src/sys/time/testing/wake-alarms
instead.
Include the library as follows. In BUILD.gn
:
ⓘ
deps = [
"//src/sys/time/testing/fake-wake-alarms:lib",
]
In rust code:
ⓘ
use fake_wake_alarms::*; // Or use items by name.
Structs§
- Responder
Cleanup - Makes sure that a dropped responder is properly responded to.
Enums§
- Response
- Configure the response of serve_fake_wake_alarms.
Constants§
- MAGIC_
EXPIRE_ DEADLINE - Scheduling a hrtimer with this deadline will expire it immediately.
Functions§
- serve_
fake_ wake_ alarms - Serves a fake
fuchsia.time.alarms/Wake
API. The behavior is simplistic when compared to the “real” implementation in that it never actually expires alarms on its own, and has fixed behavior for each scheduled alarm, which is selected at the beginning of the test.