aboutsummaryrefslogtreecommitdiffstats
path: root/tests/io_mock.h
diff options
context:
space:
mode:
authorAnastasia Klimchuk <aklm@chromium.org>2021-09-24 16:05:35 +1000
committerNico Huber <nico.h@gmx.de>2021-10-18 12:22:59 +0000
commit92989f2496e3b138e784d10ef4b2536a757c0953 (patch)
tree0792444165320934d74e938f6f61324bb89ca3d4 /tests/io_mock.h
parenta7a59cf0bb37b7416756e6b1977b8667bbecb01b (diff)
downloadflashrom-92989f2496e3b138e784d10ef4b2536a757c0953.tar.gz
flashrom-92989f2496e3b138e784d10ef4b2536a757c0953.tar.bz2
flashrom-92989f2496e3b138e784d10ef4b2536a757c0953.zip
tests: Add wrap for libusb_init and use it in dediprog test
Missing wrap for libusb_init has been discovered while working on the test for raiden_debug_spi. Both dediprog (existing test) and raiden_debug_spi (new test, see later in this chain) are using libusb_init, so it definitely needs to be wrapped and added to io_mock. Why tests worked before, without the wrap: my understanding is that real libusb_init was called for dediprog test? Given that tests definitely should not call any real libusb functions, wrap is needed. BUG=b:181803212 TEST=builds and ninja test Change-Id: I51c9cb96db1afb3298f4d098df96509d3cb3c046 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57917 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'tests/io_mock.h')
-rw-r--r--tests/io_mock.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/io_mock.h b/tests/io_mock.h
index 7c235d82..0bee6cab 100644
--- a/tests/io_mock.h
+++ b/tests/io_mock.h
@@ -70,6 +70,7 @@ struct io_mock {
unsigned int (*inl)(void *state, unsigned short port);
/* USB I/O */
+ int (*libusb_init)(void *state, libusb_context **ctx);
int (*libusb_control_transfer)(void *state,
libusb_device_handle *devh,
uint8_t bmRequestType,