1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 14:33:18 +02:00

tests: Use regular cmocka wraps for hwaccess functions

hwaccess functions used to be static inline functions and needed
a special treatment so that they could be mocked for unit tests.

This has changed, see include/hwaccess_x86_io.h now the functions
are not static inline anymore, and it is possible to use regular
cmocka wraps.

Fixes https://ticket.coreboot.org/issues/385

BUG=b:181803212
TEST=ninja test

Change-Id: Iafce071ea7ad5bcfdebbba968699d5743705f8e0
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/64881
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Joursoir <chat@joursoir.net>
Reviewed-by: Thomas Heijligen <src@posteo.de>
This commit is contained in:
Anastasia Klimchuk
2022-06-02 11:56:38 +10:00
parent 3c8166e50b
commit fac9fc28f5
5 changed files with 18 additions and 83 deletions

View File

@ -58,12 +58,12 @@ int __wrap_feof(FILE *fp);
int __wrap_ferror(FILE *fp);
void __wrap_clearerr(FILE *fp);
int __wrap_rget_io_perms(void);
void __wrap_test_outb(unsigned char value, unsigned short port);
unsigned char __wrap_test_inb(unsigned short port);
void __wrap_test_outw(unsigned short value, unsigned short port);
unsigned short __wrap_test_inw(unsigned short port);
void __wrap_test_outl(unsigned int value, unsigned short port);
unsigned int __wrap_test_inl(unsigned short port);
void __wrap_OUTB(unsigned char value, unsigned short port);
unsigned char __wrap_INB(unsigned short port);
void __wrap_OUTW(unsigned short value, unsigned short port);
unsigned short __wrap_INW(unsigned short port);
void __wrap_OUTL(unsigned int value, unsigned short port);
unsigned int __wrap_INL(unsigned short port);
int __wrap_spi_send_command(const struct flashctx *flash,
unsigned int writecnt, unsigned int readcnt,
const unsigned char *writearr, unsigned char *readarr);