File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
features/storage/TESTS/kvstore/direct_access_devicekey_test Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ void test_direct_access_to_devicekey_tdb_flashiap_remainder()
186186
187187void test_direct_access_to_devicekey_tdb_last_two_sectors ()
188188{
189- utest_printf (" Test Direct Access To DeviceKey Test Entire FlashIAP Remainder \n " );
189+ utest_printf (" Test Direct Access To DeviceKey Test Last Two Sectors \n " );
190190
191191 uint32_t flash_bd_start_address;
192192 uint32_t flash_bd_end_address;
@@ -198,6 +198,18 @@ void test_direct_access_to_devicekey_tdb_last_two_sectors()
198198 uint32_t flash_bd_size = flash_bd_end_address - flash_bd_start_address;
199199
200200 FlashIAPBlockDevice *flash_bd = new FlashIAPBlockDevice ((bd_addr_t )flash_bd_start_address, (bd_size_t )flash_bd_size);
201+ flash_bd->init ();
202+ uint32_t sector_addr = flash_bd->size ();
203+ for (int i = 0 ; i < 2 ; i++) {
204+ uint32_t sector_size = flash_bd->get_erase_size (sector_addr - 1 );
205+ uint32_t erase_prog_ratio = sector_size / flash_bd->get_program_size ();
206+ if (erase_prog_ratio < 4 ) {
207+ delete flash_bd;
208+ TEST_SKIP_UNLESS_MESSAGE (false , " Test skipped. Flash program size doesn't support this test." );
209+ }
210+ sector_addr -= sector_size;
211+ }
212+ flash_bd->deinit ();
201213
202214 TDBStore *tdb = new TDBStore (flash_bd);
203215 // Start by Init and Reset to TDBStore
You can’t perform that action at this time.
0 commit comments