From 1f62b8346efdf3a62ab5781c835946bb9c990810 Mon Sep 17 00:00:00 2001 From: Anastasia Klimchuk Date: Tue, 7 Sep 2021 14:13:03 +1000 Subject: tests: Add tests to read from chip Two tests cover the code which performs do_read operation. First one works with fake chip and dummy programmer. Fake chip has all operations defined, and a buffer to emulate chip memory. Second one uses the chip which is closer to the real one, because read/write/unlock/erase operations are real. The tests takes the advantage of dummyflasher's capability of emulating a W25Q128.V chip. BUG=b:181803212 TEST=builds and ninja test Change-Id: Ia57781ebc670c7bd6197e56fe8a20651a425c756 Signed-off-by: Anastasia Klimchuk Reviewed-on: https://review.coreboot.org/c/flashrom/+/57326 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- tests/io_mock.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/io_mock.h') diff --git a/tests/io_mock.h b/tests/io_mock.h index adb5f3b3..a285e534 100644 --- a/tests/io_mock.h +++ b/tests/io_mock.h @@ -53,6 +53,9 @@ struct pci_dev { /* Linux I2C interface constants, avoiding linux/i2c-dev.h */ #define I2C_SLAVE 0x0703 +/* Always return success for tests. */ +#define S_ISREG(x) 0 + struct io_mock { void *state; -- cgit v1.2.3