Skip to content

Commit 8910ec6

Browse files
committed
kvstore general_tests_phase_1/2 tests: Skip TDBStore if FlashIAP sector size is non-uniform
By default TDBStore requires blocks to have the same size.
1 parent 577d450 commit 8910ec6

File tree

2 files changed

+10
-0
lines changed
  • storage/kvstore/tests/TESTS/kvstore

2 files changed

+10
-0
lines changed

storage/kvstore/tests/TESTS/kvstore/general_tests_phase_1/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ static void kvstore_init()
101101
TEST_ASSERT_EQUAL_ERROR_CODE(0, res);
102102

103103
if (kv_setup == TDBStoreSet) {
104+
#if COMPONENT_FLASHIAP && !COMPONENT_SPIF && !COMPONENT_QSPIF && !COMPONENT_DATAFLASH && !COMPONENT_SD
105+
// TDBStore requires two areas of equal size, do the check for FlashIAP
106+
TEST_SKIP_UNLESS(MBED_CONF_TARGET_INTERNAL_FLASH_UNIFORM_SECTORS ||
107+
(MBED_CONF_FLASHIAP_BLOCK_DEVICE_SIZE != 0) && (MBED_CONF_FLASHIAP_BLOCK_DEVICE_BASE_ADDRESS != 0xFFFFFFFF))
108+
#endif
104109
if (erase_val == -1) {
105110
flash_bd = new FlashSimBlockDevice(bd);
106111
kvstore = new TDBStore(flash_bd);

storage/kvstore/tests/TESTS/kvstore/general_tests_phase_2/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ static void kvstore_init()
9696
TEST_ASSERT_EQUAL_ERROR_CODE(0, res);
9797

9898
if (kv_setup == TDBStoreSet) {
99+
#if COMPONENT_FLASHIAP && !COMPONENT_SPIF && !COMPONENT_QSPIF && !COMPONENT_DATAFLASH && !COMPONENT_SD
100+
// TDBStore requires two areas of equal size
101+
TEST_SKIP_UNLESS(MBED_CONF_TARGET_INTERNAL_FLASH_UNIFORM_SECTORS ||
102+
(MBED_CONF_FLASHIAP_BLOCK_DEVICE_SIZE != 0) && (MBED_CONF_FLASHIAP_BLOCK_DEVICE_BASE_ADDRESS != 0xFFFFFFFF))
103+
#endif
99104
if (erase_val == -1) {
100105
flash_bd = new FlashSimBlockDevice(bd);
101106
kvstore = new TDBStore(flash_bd);

0 commit comments

Comments
 (0)