Skip to content

Commit 95c3fb3

Browse files
de-nordicrghaddab
authored andcommitted
[nrf fromtree] tests/dfu: Replace flash_area_erase with flash_area_flatten
Use flash_area_flatten instead of flash_area_erase; this allows to run tests on devices that do not require explicit erase before write or do not provide the callback. Signed-off-by: Dominik Ermel <[email protected]> (cherry picked from commit 7b36d34)
1 parent 29d3e5f commit 95c3fb3

File tree

1 file changed

+2
-2
lines changed
  • tests/subsys/dfu/img_util/src

1 file changed

+2
-2
lines changed

tests/subsys/dfu/img_util/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ ZTEST(img_util, test_collecting)
7373
sizeof(erase_buf));
7474
zassert_true(ret == 0, "Flash write failure (%d)", ret);
7575
#else
76-
ret = flash_area_erase(ctx.flash_area, 0, ctx.flash_area->fa_size);
76+
ret = flash_area_flatten(ctx.flash_area, 0, ctx.flash_area->fa_size);
7777
zassert_true(ret == 0, "Flash erase failure (%d)", ret);
7878
#endif
7979

@@ -137,7 +137,7 @@ ZTEST(img_util, test_check_flash)
137137

138138
ret = flash_img_init_id(&ctx, SLOT1_PARTITION_ID);
139139
zassert_true(ret == 0, "Flash img init 1");
140-
ret = flash_area_erase(ctx.flash_area, 0, ctx.flash_area->fa_size);
140+
ret = flash_area_flatten(ctx.flash_area, 0, ctx.flash_area->fa_size);
141141
zassert_true(ret == 0, "Flash erase failure (%d)\n", ret);
142142
ret = flash_img_buffered_write(&ctx, tst_vec, sizeof(tst_vec), true);
143143
zassert_true(ret == 0, "Flash img buffered write\n");

0 commit comments

Comments
 (0)