summaryrefslogtreecommitdiff
path: root/tests/io_mock.c
diff options
context:
space:
mode:
authorAnastasia Klimchuk <aklm@chromium.org>2022-10-17 11:59:09 +1100
committerAnastasia Klimchuk <aklm@chromium.org>2022-11-08 21:09:42 +0000
commitaf2ba601f4840172eb422a0f3efb5a740fb9698d (patch)
treebafcf8a04415c6833e099d1b932bb52a2dbfe550 /tests/io_mock.c
parent0a896424abd490d1cfdd8a582ba17c25df75a0e0 (diff)
downloadflashrom-git-af2ba601f4840172eb422a0f3efb5a740fb9698d.tar.gz
tests: Add prefix to io_mock functions not to clash with macros
Flashrom I/O mock functions need to be renamed so that they do not have name clash with standard I/O, because the latter are allowed to be macros. Adding a prefix to flashrom mock functions avoids them being accidentally expanded. Standard I/O functions are expanded and flashrom mocks stay as they are. BUG=b:237606255 TEST=ninja test 1) gcc 12.2.0 on Debian 2) clang 15.0 on Chromium OS Ticket: https://ticket.coreboot.org/issues/411 Change-Id: I7998a8fb1b9e65621e12adbfab5460a245d5606b Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/68433 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
Diffstat (limited to 'tests/io_mock.c')
-rw-r--r--tests/io_mock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/io_mock.c b/tests/io_mock.c
index 9f86fcd6..c04e9c5a 100644
--- a/tests/io_mock.c
+++ b/tests/io_mock.c
@@ -22,7 +22,7 @@ static const struct io_mock *current_io = NULL;
void io_mock_register(const struct io_mock *io)
{
/* A test can either register its own mock open function or fallback_open_state. */
- assert_true(io == NULL || io->open == NULL || io->fallback_open_state == NULL);
+ assert_true(io == NULL || io->iom_open == NULL || io->fallback_open_state == NULL);
current_io = io;
}