OVMS3-idf/components/nvs_flash/test
Ivan Grokhotkov e314f42b0c nvs: fix Page::findItem and Storage::findItem regression
When read caching was added, Page::findItem started modifying itemIndex reference argument even if item wasn't found.
Incidentally, Storage::findItem reused itemIndex when starting search at next page.
So,
- if the first page had a cached index (findItem was called for that page), and it pointed to a non-zero index,
- first page has a few empty items at the end (but is marked full),
- next search looked up the item on the second page,
- index of the item on the second page was less than the cached index on the first page,
then the search would fail because cached starting index was reused.

This change fixes both sides of the problem:
- Page::findItem shouldn't modify itemIndex argument if item is not found
- Storage::findItem should not reuse itemIndex between pages

Two tests have been added.
2016-11-03 20:18:30 +08:00
..
catch.hpp Initial public version 2016-08-17 23:08:22 +08:00
crc.cpp nvs_flash: use CRC-32 routine compatible with ROM version 2016-10-31 19:11:40 +08:00
crc.h Initial public version 2016-08-17 23:08:22 +08:00
main.cpp Initial public version 2016-08-17 23:08:22 +08:00
Makefile components/nvs: maintain item hash list at page level 2016-09-21 18:02:52 +08:00
sdkconfig.h components/nvs: fix build, use log library instead of printf 2016-09-23 09:00:28 +08:00
spi_flash_emulation.cpp spi_flash: change pointer type to void* 2016-10-27 17:58:42 +08:00
spi_flash_emulation.h nvs_flash: don't allow more operation to be done on page in PageState::INVALID 2016-10-31 19:48:28 +08:00
test_compressed_enum_table.cpp Initial public version 2016-08-17 23:08:22 +08:00
test_intrusive_list.cpp components/nvs: strlcpy is not available on Linux, replace with strncpy and terminate strings explicitly 2016-08-23 15:14:13 +08:00
test_nvs.cpp nvs: fix Page::findItem and Storage::findItem regression 2016-11-03 20:18:30 +08:00
test_spi_flash_emulation.cpp spi_flash: change pointer type to void* 2016-10-27 17:58:42 +08:00