Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/62320 )
Change subject: tests/: Allow for file path validation ......................................................................
tests/: Allow for file path validation
Change-Id: I892fa1ecee26ebce9640893edbb228fa9aa7b0b6 Signed-off-by: Edward O'Callaghan quasisec@google.com --- M tests/init_shutdown.c 1 file changed, 30 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/20/62320/1
diff --git a/tests/init_shutdown.c b/tests/init_shutdown.c index 63f247e..30db5b3 100644 --- a/tests/init_shutdown.c +++ b/tests/init_shutdown.c @@ -56,6 +56,15 @@ void dummy_init_and_shutdown_test_success(void **state) { #if CONFIG_DUMMY == 1 + static struct default_io_mock_state data = { + .paths = { NULL }, + .noc = 0, + }; + const struct io_mock dummy_io = { + .open = default_open, + .state = &data, + }; + io_mock_register(&dummy_io); run_lifecycle(state, &programmer_dummy, "bus=parallel+lpc+fwh+spi"); #else skip(); @@ -65,6 +74,15 @@ void nicrealtek_init_and_shutdown_test_success(void **state) { #if CONFIG_NICREALTEK == 1 + static struct default_io_mock_state data = { + .paths = { NULL }, + .noc = 0, + }; + const struct io_mock nicrealtek_io = { + .open = default_open, + .state = &data, + }; + io_mock_register(&nicrealtek_io); run_lifecycle(state, &programmer_nicrealtek, ""); #else skip(); @@ -142,12 +160,18 @@ void raiden_debug_init_and_shutdown_test_success(void **state) { #if CONFIG_RAIDEN_DEBUG_SPI == 1 + static struct default_io_mock_state data = { + .paths = { NULL }, + .noc = 0, + }; const struct io_mock raiden_debug_io = { .libusb_get_device_list = raiden_debug_libusb_get_device_list, .libusb_free_device_list = raiden_debug_libusb_free_device_list, .libusb_get_device_descriptor = raiden_debug_libusb_get_device_descriptor, .libusb_get_config_descriptor = raiden_debug_libusb_get_config_descriptor, .libusb_free_config_descriptor = raiden_debug_libusb_free_config_descriptor, + .open = default_open, + .state = &data, };
/* @@ -193,9 +217,15 @@ void dediprog_init_and_shutdown_test_success(void **state) { #if CONFIG_DEDIPROG == 1 + static struct default_io_mock_state data = { + .paths = { NULL }, + .noc = 0, + }; const struct io_mock dediprog_io = { .libusb_init = dediprog_libusb_init, .libusb_control_transfer = dediprog_libusb_control_transfer, + .open = default_open, + .state = &data, };
io_mock_register(&dediprog_io);