blob: f93e1fd4817a909c32415b0de474656fbc29f5f1 [file] [log] [blame]
Benjamin Fair20a18092020-06-08 11:12:21 -07001#pragma once
2
3#include "pciaccess.hpp"
4
5#include <gmock/gmock.h>
6
7namespace host_tool
8{
9
10class PciAccessMock : public PciAccess
11{
12 public:
Willy Tuf4504862021-04-24 23:22:19 -070013 MOCK_METHOD(struct pci_device_iterator*, pci_id_match_iterator_create,
14 (const struct pci_id_match*), (const, override));
15 MOCK_METHOD(void, pci_iterator_destroy, (struct pci_device_iterator*),
16 (const, override));
17 MOCK_METHOD(void, pci_device_enable, (struct pci_device*),
18 (const, override));
19 MOCK_METHOD(struct pci_device*, pci_device_next,
20 (struct pci_device_iterator*), (const, override));
21 MOCK_METHOD(int, pci_device_probe, (struct pci_device*), (const, override));
22 MOCK_METHOD(int, pci_device_cfg_read_u8,
23 (struct pci_device * dev, std::uint8_t* data, pciaddr_t offset),
24 (const, override));
25 MOCK_METHOD(int, pci_device_cfg_write_u8,
26 (struct pci_device * dev, std::uint8_t data, pciaddr_t offset),
27 (const, override));
28 MOCK_METHOD(int, pci_device_map_range,
29 (struct pci_device*, pciaddr_t, pciaddr_t, unsigned, void**),
30 (const, override));
31 MOCK_METHOD(int, pci_device_unmap_range,
32 (struct pci_device*, void*, pciaddr_t), (const, override));
Benjamin Fair20a18092020-06-08 11:12:21 -070033};
34
35} // namespace host_tool