aboutsummaryrefslogtreecommitdiffstats
path: root/tests/io_mock.h
diff options
context:
space:
mode:
authorAnastasia Klimchuk <aklm@chromium.org>2021-05-10 10:19:25 +1000
committerNico Huber <nico.h@gmx.de>2021-06-05 08:50:37 +0000
commit21e22ba8a7750f1cfe5cd3323e3137695ffef0a4 (patch)
tree61fbd63991b26eb67ea324817d23fd6c7a7e6c46 /tests/io_mock.h
parent38c133438c98d70bcd46a6289bc4120e22606cf2 (diff)
downloadflashrom-21e22ba8a7750f1cfe5cd3323e3137695ffef0a4.tar.gz
flashrom-21e22ba8a7750f1cfe5cd3323e3137695ffef0a4.tar.bz2
flashrom-21e22ba8a7750f1cfe5cd3323e3137695ffef0a4.zip
tests: Add unit test to run init/shutdown for mec1308.c, ene_lpc.c
This patch includes mocks for io operations in hwaccess_x86_io.h because those are needed to test lifecycle of mec1308.c and ene_lpc.c BUG=b:181803212 TEST=builds and ninja test Change-Id: I3af612defe1af3850dfc1626a208d873e3a3eddc Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/51487 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'tests/io_mock.h')
-rw-r--r--tests/io_mock.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/io_mock.h b/tests/io_mock.h
index 056e6bff..69045a21 100644
--- a/tests/io_mock.h
+++ b/tests/io_mock.h
@@ -32,16 +32,16 @@
#define _IO_MOCK_H_
struct io_mock {
- void *priv;
+ void *state;
- void (*outb)(void *priv, unsigned char value, unsigned short port);
- unsigned char (*inb)(void *priv, unsigned short port);
+ void (*outb)(void *state, unsigned char value, unsigned short port);
+ unsigned char (*inb)(void *state, unsigned short port);
- void (*outw)(void *priv, unsigned short value, unsigned short port);
- unsigned short (*inw)(void *priv, unsigned short port);
+ void (*outw)(void *state, unsigned short value, unsigned short port);
+ unsigned short (*inw)(void *state, unsigned short port);
- void (*outl)(void *priv, unsigned int value, unsigned short port);
- unsigned int (*inl)(void *priv, unsigned short port);
+ void (*outl)(void *state, unsigned int value, unsigned short port);
+ unsigned int (*inl)(void *state, unsigned short port);
};
void io_mock_register(const struct io_mock *io);