tests/fs: Replace flash_area_erase with flash_area_flatten
Test of file systems use flash_area_erase to erase device to have a clear start for tests; switching to flash_area_flatten allows them to do the same with devices that do not explicit call to erase procedure before write. Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This commit is contained in:
parent
bf7d25117a
commit
1ae352a760
4 changed files with 4 additions and 4 deletions
|
@ -45,7 +45,7 @@ static int wipe_partition(void)
|
|||
}
|
||||
|
||||
TC_PRINT("Erasing %zu (0x%zx) bytes\n", pfa->fa_size, pfa->fa_size);
|
||||
rc = flash_area_erase(pfa, 0, pfa->fa_size);
|
||||
rc = flash_area_flatten(pfa, 0, pfa->fa_size);
|
||||
(void)flash_area_close(pfa);
|
||||
|
||||
if (rc < 0) {
|
||||
|
|
|
@ -58,7 +58,7 @@ void test_fcb_wipe(void)
|
|||
zassert_true(rc == 0, "flash area open call failure");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(test_fcb_sector); i++) {
|
||||
rc = flash_area_erase(fap, test_fcb_sector[i].fs_off,
|
||||
rc = flash_area_flatten(fap, test_fcb_sector[i].fs_off,
|
||||
test_fcb_sector[i].fs_size);
|
||||
zassert_true(rc == 0, "erase call failure");
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ int testfs_lfs_wipe_partition(const struct fs_mount_t *mp)
|
|||
}
|
||||
|
||||
TC_PRINT("Erasing %zu (0x%zx) bytes\n", pfa->fa_size, pfa->fa_size);
|
||||
rc = flash_area_erase(pfa, 0, pfa->fa_size);
|
||||
rc = flash_area_flatten(pfa, 0, pfa->fa_size);
|
||||
(void)flash_area_close(pfa);
|
||||
|
||||
if (rc < 0) {
|
||||
|
|
|
@ -31,6 +31,6 @@ void test_clear_flash(void)
|
|||
rc = flash_area_open(TEST_PARTITION_ID, &fap);
|
||||
zassert_equal(rc, 0, "Opening flash area for erase [%d]\n", rc);
|
||||
|
||||
rc = flash_area_erase(fap, 0, fap->fa_size);
|
||||
rc = flash_area_flatten(fap, 0, fap->fa_size);
|
||||
zassert_equal(rc, 0, "Erasing flash area [%d]\n", rc);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue