mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-02 14:33:18 +02:00
tests: Move current_io to io_mock.c be visible across tests
tests.c is growing and needs to be split, specifically all libusb wraps need to be extracted into their own file. See later in the chain a lot more wraps are added for libusb functions. To be able to split it, current_io needs to be moved one level up, to be visible across tests. This allows having multiple files with wraps, and all the wraps can use current_io. BUG=b:181803212 TEST=builds and ninja test Change-Id: I5327b5de430afe13a8cc931c8b4b188dcb8c8cf6 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57915 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:

committed by
Nico Huber

parent
83b5191399
commit
97acc374e4
29
tests/io_mock.c
Normal file
29
tests/io_mock.c
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* This file is part of the flashrom project.
|
||||
*
|
||||
* Copyright (C) 2021, Google Inc. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "io_mock.h"
|
||||
|
||||
static const struct io_mock *current_io = NULL;
|
||||
|
||||
void io_mock_register(const struct io_mock *io)
|
||||
{
|
||||
current_io = io;
|
||||
}
|
||||
|
||||
const struct io_mock *get_io(void)
|
||||
{
|
||||
return current_io;
|
||||
}
|
Reference in New Issue
Block a user