QSPIFBlockDevice: Add unit test for the S25FS512S quirk
Add a test case to verify that the quirk on `CR1NV` and `CR3NV`
registers get applied by `QSPIFBlockDevice` when the flash device
is S25FS512S.

`QSPIFBlockDevice` depends on the SFDP functions and the `QSPI` class,
but we can't use gMock on them because:
* SFDP functions are global functions, whereas gMock only supports
mocking class member functions.
* A mocked class is injected into the test subject, but passing a
preexisting `QSPI` instance into `QSPIFBlockDevice` is not possible
(unless we resort to pointers). For details, see comments in
test_QSPIFBlockDevice.cpp.

So fakes of the `QSPI` class and any SFDP functions involved are
defined in test_QSPIFBlockDevice.cpp.
ls
1 parent 23a79ef commit f88bf828ab7453d3e7fdf4cfa0a1620739d00db2
@Lingkai Dong Lingkai Dong authored on 11 Aug 2021
Showing 5 changed files
View
storage/blockdevice/CMakeLists.txt
View
storage/blockdevice/COMPONENT_QSPIF/CMakeLists.txt
View
storage/blockdevice/COMPONENT_QSPIF/UNITTESTS/.mbedignore 0 → 100644
View
storage/blockdevice/COMPONENT_QSPIF/UNITTESTS/CMakeLists.txt 0 → 100644
View
storage/blockdevice/COMPONENT_QSPIF/UNITTESTS/test_QSPIFBlockDevice.cpp 0 → 100644