mirror of
https://review.coreboot.org/flashrom.git
synced 2025-08-17 12:20:15 +02:00
tests: Add init-shutdown test for nicrealtek
This patch adds a test and mocks for two pci functions that nicreltek is using. Main reason for this is to have at least one test for par master (currently there are none), in preparation for a change like CB:56103 but for par masters. BUG=b:181803212 TEST=ninja test Change-Id: Iaed14fe1d83c8eb45ec185ebd3f1c97cb81941f4 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/56470 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
This commit is contained in:

committed by
Edward O'Callaghan

parent
56c82fe623
commit
e0ece4a4bb
@@ -53,6 +53,22 @@ void *__wrap_physmap(const char *descr, uintptr_t phys_addr, size_t len)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct pci_dev mock_pci_dev = {
|
||||
.device_id = MOCK_HANDLE,
|
||||
};
|
||||
|
||||
struct pci_dev *__wrap_pcidev_init(void *devs, int bar)
|
||||
{
|
||||
LOG_ME;
|
||||
return &mock_pci_dev;
|
||||
}
|
||||
|
||||
uintptr_t __wrap_pcidev_readbar(void *dev, int bar)
|
||||
{
|
||||
LOG_ME;
|
||||
return MOCK_HANDLE;
|
||||
}
|
||||
|
||||
void __wrap_sio_write(uint16_t port, uint8_t reg, uint8_t data)
|
||||
{
|
||||
LOG_ME;
|
||||
@@ -230,6 +246,7 @@ int main(void)
|
||||
const struct CMUnitTest init_shutdown_tests[] = {
|
||||
cmocka_unit_test(dummy_init_and_shutdown_test_success),
|
||||
cmocka_unit_test(mec1308_init_and_shutdown_test_success),
|
||||
cmocka_unit_test(nicrealtek_init_and_shutdown_test_success),
|
||||
cmocka_unit_test(dediprog_init_and_shutdown_test_success),
|
||||
cmocka_unit_test(ene_lpc_init_and_shutdown_test_success),
|
||||
cmocka_unit_test(linux_spi_init_and_shutdown_test_success),
|
||||
|
Reference in New Issue
Block a user