summaryrefslogtreecommitdiffstats
path: root/tests/tests.c
diff options
context:
space:
mode:
authorEdward O'Callaghan <quasisec@google.com>2023-01-05 14:50:30 +1100
committerEdward O'Callaghan <quasisec@chromium.org>2023-01-17 00:22:20 +0000
commit3d76865fd50ab9b28f367ed27b19d8746548cdb1 (patch)
tree84f812bb3f6c53bfb815b8161c5f619e22dd3c0e /tests/tests.c
parentb86803830399fe05b0ef81d56d1da027433e5af7 (diff)
downloadflashrom-3d76865fd50ab9b28f367ed27b19d8746548cdb1.tar.gz
flashrom-3d76865fd50ab9b28f367ed27b19d8746548cdb1.tar.bz2
flashrom-3d76865fd50ab9b28f367ed27b19d8746548cdb1.zip
tests/chip: Add non-aligned write within a region unit-test
A written region that is sized below that of the erasure granularity can result in a incorrectly read region that does not include prior content within the region before the write op. This was dealt with in ChromeOS downstream by expanding out the read to match the erase granularity however does not seem to impact upstream. Add a unit-test to avoid regression as this is important behaviour to cover. Change-Id: Id3ce5cd1936f0f348d34a6c77cee15e27a5c353f Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/71659 Reviewed-by: Sam McNally <sammc@google.com> Reviewed-by: Evan Benn <evanbenn@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'tests/tests.c')
-rw-r--r--tests/tests.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/tests.c b/tests/tests.c
index a1dcacae0..0912f3533 100644
--- a/tests/tests.c
+++ b/tests/tests.c
@@ -480,6 +480,7 @@ int main(int argc, char *argv[])
cmocka_unit_test(read_chip_with_dummyflasher_test_success),
cmocka_unit_test(write_chip_test_success),
cmocka_unit_test(write_chip_with_dummyflasher_test_success),
+ cmocka_unit_test(write_nonaligned_region_with_dummyflasher_test_success),
cmocka_unit_test(verify_chip_test_success),
cmocka_unit_test(verify_chip_with_dummyflasher_test_success),
};