Skip to content

Commit a454bb9

Browse files
de-nordicaescolar
authored andcommitted
tests/storage/stream_flash: Fix the test_stream_flash_erase_page
Fix for test that was failing due to incorrectly testing of stream_flash_erase_page. The stream_flash_erase_page would never be able to erase a page it has been requested to erase. Signed-off-by: Dominik Ermel <[email protected]>
1 parent 0a6e90b commit a454bb9

File tree

1 file changed

+3
-3
lines changed
  • tests/subsys/storage/stream/stream_flash/src

1 file changed

+3
-3
lines changed

tests/subsys/storage/stream/stream_flash/src/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,14 +419,14 @@ ZTEST(lib_stream_flash, test_stream_flash_erase_page)
419419

420420
init_target();
421421

422-
/* Write out one buf */
423-
rc = stream_flash_buffered_write(&ctx, write_buf, BUF_LEN, false);
422+
/* Write something to make page dirty */
423+
rc = flash_write(ctx.fdev, FLASH_BASE, write_buf, BUF_LEN);
424424
zassert_equal(rc, 0, "expected success");
425425

426426
rc = stream_flash_erase_page(&ctx, FLASH_BASE);
427427
zassert_equal(rc, 0, "expected success");
428428

429-
VERIFY_ERASED(FLASH_BASE, page_size);
429+
VERIFY_ERASED(0, page_size);
430430

431431
/*
432432
* Test failure in erase does not change context.

0 commit comments

Comments
 (0)