Skip to content

Commit e4cd4a0

Browse files
author
Kyle Kearney
committed
Make devicekey remainder test more meaningful
As of 722628b, the "remainder" configuration also uses the default location near the end of flash. Which makes the two tests nearly identical with the exception that the "last two sectors" test correctly handles parts with a low (possibly 1:1) erase size to program size ratio. Therefore, change the "remainder" test to instead be a "default" test that uses the tdb_internal_address/size values, so that it a.) tests something meaningfully different and b.) tests using the custom TDB address/size values if they are provided.
1 parent eeb033f commit e4cd4a0

File tree

1 file changed

+5
-5
lines changed
  • features/storage/TESTS/kvstore/direct_access_devicekey_test

1 file changed

+5
-5
lines changed

features/storage/TESTS/kvstore/direct_access_devicekey_test/main.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static inline uint32_t align_down(uint64_t val, uint64_t size)
5050
return (((val) / size)) * size;
5151
}
5252

53-
int get_virtual_TDBStore_position(uint32_t conf_start_address, uint32_t conf_size, bool is_conf_tdb_internal,
53+
int get_virtual_TDBStore_position(uint32_t conf_start_address, uint32_t conf_size, bool is_conf_tdbd_internal,
5454
uint32_t *tdb_start_address, uint32_t *tdb_end_address)
5555
{
5656
uint32_t bd_final_size = conf_size;
@@ -117,14 +117,14 @@ int get_virtual_TDBStore_position(uint32_t conf_start_address, uint32_t conf_si
117117
}
118118

119119

120-
void test_direct_access_to_devicekey_tdb_flashiap_remainder()
120+
void test_direct_access_to_devicekey_tdb_flashiap_default()
121121
{
122-
utest_printf("Test Direct Access To DeviceKey Test Entire FlashIAP Remainder\n");
122+
utest_printf("Test Direct Access To DeviceKey Test Entire FlashIAP Default Address\n");
123123

124124
uint32_t flash_bd_start_address;
125125
uint32_t flash_bd_end_address;
126126

127-
int err = get_virtual_TDBStore_position(0, 0, true, &flash_bd_start_address, &flash_bd_end_address);
127+
int err = get_virtual_TDBStore_position(MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_BASE_ADDRESS, MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE, true, &flash_bd_start_address, &flash_bd_end_address);
128128
TEST_SKIP_UNLESS_MESSAGE(err != -2, "Test skipped. Not enough available space on Internal FlashIAP");
129129
TEST_ASSERT_EQUAL(0, err);
130130
uint32_t flash_bd_size = flash_bd_end_address - flash_bd_start_address;
@@ -329,7 +329,7 @@ utest::v1::status_t greentea_failure_handler(const Case *const source, const fai
329329
}
330330

331331
Case cases[] = {
332-
Case("Testing direct access to devicekey with tdb over flashiap remainder", test_direct_access_to_devicekey_tdb_flashiap_remainder, greentea_failure_handler),
332+
Case("Testing direct access to devicekey with tdb over flashiap default placement", test_direct_access_to_devicekey_tdb_flashiap_default, greentea_failure_handler),
333333
Case("Testing direct access to devicekey with tdb over last two sectors", test_direct_access_to_devicekey_tdb_last_two_sectors, greentea_failure_handler),
334334
Case("Testing direct access to injected devicekey ", test_direct_access_to_device_inject_root, greentea_failure_handler),
335335
};

0 commit comments

Comments
 (0)