Skip to content

Commit 5d0f4e3

Browse files
khoa-nguyen-18kartben
authored andcommitted
tests: drivers: flash: common: Fixing the overlap case
For the flash with the block size equal to or smaller than 64 bytes, using a specific "32" bytes for adding for destination_offset and "32" bytes for subtracting the size that need to copy is not correct. As a solution, I will add one-fourth of a block size for the destination_offset and modify the size that need to copy to [block size + one-fourth of a block size]. Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
1 parent 44f9f9f commit 5d0f4e3

File tree

1 file changed

+2
-2
lines changed
  • tests/drivers/flash/common/src

1 file changed

+2
-2
lines changed

tests/drivers/flash/common/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ ZTEST(flash_driver, test_flash_copy)
462462

463463
/* copy with overlapping ranges should fail */
464464
test_flash_copy_inner(flash_dev, page_info.start_offset, flash_dev,
465-
page_info.start_offset + 32, page_info.size - 32, buf, sizeof(buf),
466-
-EINVAL);
465+
page_info.start_offset + (page_info.size / 4),
466+
page_info.size - (page_info.size / 4), buf, sizeof(buf), -EINVAL);
467467
}
468468

469469
ZTEST_SUITE(flash_driver, NULL, NULL, flash_driver_before, NULL, NULL);

0 commit comments

Comments
 (0)