Skip to content

Commit

Permalink
tests:subsys:settings_test_fcb:add error check in cionfig_wipe_fcb()
Browse files Browse the repository at this point in the history
Validate that flash_area_open() succeeds.

Fixes zephyrproject-rtos#30195

Signed-off-by: Xinrong Han <hanxr19@mails.tsinghua.edu.cn>
  • Loading branch information
Hxinrong committed Feb 22, 2021
1 parent 5836e30 commit c181fad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/subsys/settings/fcb/src/settings_test_fcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ void config_wipe_fcb(struct flash_sector *fs, int cnt)
int i;

rc = flash_area_open(FLASH_AREA_ID(storage), &fap);
zassert_true(rc == 0, "Can't open storage flash area");

for (i = 0; i < cnt; i++) {
rc = flash_area_erase(fap, fs[i].fs_off, fs[i].fs_size);
Expand Down

0 comments on commit c181fad

Please sign in to comment.