mirror of
https://review.coreboot.org/flashrom.git
synced 2025-10-13 22:10:23 +02:00

Change-Id: I3a8a8e59cbed871e0ecf953e547de56c0656e112 Signed-off-by: Anastasia Klimchuk <aklm@flashrom.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/89361 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Antonio Vázquez Blanco <antoniovazquezblanco@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
23 lines
539 B
C
23 lines
539 B
C
/*
|
|
* This file is part of the flashrom project.
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
* SPDX-FileCopyrightText: 2021, Google Inc. All rights reserved.
|
|
*/
|
|
|
|
#include "io_mock.h"
|
|
|
|
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->iom_open == NULL || io->fallback_open_state == NULL);
|
|
current_io = io;
|
|
}
|
|
|
|
const struct io_mock *get_io(void)
|
|
{
|
|
return current_io;
|
|
}
|