Benjamin Fair | 20a1809 | 2020-06-08 11:12:21 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "pciaccess.hpp" |
| 4 | |
| 5 | #include <gmock/gmock.h> |
| 6 | |
| 7 | namespace host_tool |
| 8 | { |
| 9 | |
| 10 | class PciAccessMock : public PciAccess |
| 11 | { |
| 12 | public: |
Willy Tu | f450486 | 2021-04-24 23:22:19 -0700 | [diff] [blame] | 13 | 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 Fair | 20a1809 | 2020-06-08 11:12:21 -0700 | [diff] [blame] | 33 | }; |
| 34 | |
| 35 | } // namespace host_tool |