summaryrefslogtreecommitdiffstats
path: root/tests/tests.c
diff options
context:
space:
mode:
authorAnastasia Klimchuk <aklm@chromium.org>2021-10-15 16:24:51 +1100
committerEdward O'Callaghan <quasisec@chromium.org>2021-11-08 03:52:36 +0000
commit8aaee03333194b29683d23bcb3ac56ea74b11007 (patch)
tree6a14d7570c2dff74c41614c0b9512f12cc52580d /tests/tests.c
parent4ab9bd7ffbc8dada52a89ab0508d60a06547ac89 (diff)
downloadflashrom-8aaee03333194b29683d23bcb3ac56ea74b11007.tar.gz
flashrom-8aaee03333194b29683d23bcb3ac56ea74b11007.tar.bz2
flashrom-8aaee03333194b29683d23bcb3ac56ea74b11007.zip
tests: Add tests to write on chip
This patch adds two tests and initialises page_size in mock chip chip_W25Q128_V. page_size was not needed for previous tests (erase and read). page_size only needed to execute writing on chip with dummyflasher, so it is added here. BUG=b:181803212 TEST=ninja test Change-Id: I6f0336613ab16a7e59857006496e3590ddb14d00 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58357 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Diffstat (limited to 'tests/tests.c')
-rw-r--r--tests/tests.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/tests.c b/tests/tests.c
index d3df356a9..e3ad24162 100644
--- a/tests/tests.c
+++ b/tests/tests.c
@@ -136,6 +136,12 @@ FILE *__wrap_fopen64(const char *pathname, const char *mode)
return not_null();
}
+FILE *__wrap_fdopen(int fd, const char *mode)
+{
+ LOG_ME;
+ return not_null();
+}
+
int __wrap_stat(const char *path, void *buf)
{
LOG_ME;
@@ -343,6 +349,8 @@ int main(void)
cmocka_unit_test(erase_chip_with_dummyflasher_test_success),
cmocka_unit_test(read_chip_test_success),
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),
};
ret |= cmocka_run_group_tests_name("chip.c tests", chip_tests, NULL, NULL);