1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 14:33:18 +02:00

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>
This commit is contained in:
Anastasia Klimchuk
2021-10-15 16:24:51 +11:00
committed by Edward O'Callaghan
parent 4ab9bd7ffb
commit 8aaee03333
4 changed files with 72 additions and 0 deletions

View File

@ -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);