Expand description
Tests the log storage interface in circular mode. For testing in linear mode, see linear_log_test.rs.
This testing framework creates a circular log storage interface in flash and runs a series of operations upon it. The tests check to make sure that the correct values are read and written after each operation, that errors are properly detected and handled, and that the log generally behaves as expected. The tests perform both valid and invalid operations to fully test the log’s behavior.
Shorting the P1.08
button on the nano33ble at any time during the test will erase the log and reset
the test state. Pressing the RESET
button will reboot the nano33ble without erasing the log,
allowing for testing logs across reboots.
In order to fully test the log, the tester should try a variety of erases and reboots to ensure that the log works correctly across these operations. The tester can also modify the testing operations and parameters defined below to test logs in different configurations. Different configurations should be tested in order to exercise the log under a greater number of scenarios (e.g. saturating/not saturating log pages with data, always/not always ending operations at page boundaries, etc.).
To run the test, uncomment the following line to the nano33ble boot sequence:
test::log_test::run(
mux_alarm,
&nrf52840_peripherals.nrf52.nvmc,
);
and use the USER
and RESET
buttons to manually erase the log and reboot the nano33ble,
respectively.
Structs§
- LogTest 🔒
Enums§
Constants§
- BUFFER_
LEN 🔒 - ENTRIES_
PER_ 🔒WRITE - MAGIC 🔒
- VALUE_
SHIFT 🔒 - WAIT_MS 🔒
Statics§
Functions§
Type Aliases§
- Log 🔒