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: |
| 13 | MOCK_CONST_METHOD1(pci_id_match_iterator_create, |
| 14 | struct pci_device_iterator*(const struct pci_id_match*)); |
| 15 | MOCK_CONST_METHOD1(pci_iterator_destroy, void(struct pci_device_iterator*)); |
Vivekanand Veeracholan | 55b1a71 | 2021-02-18 12:06:37 -0800 | [diff] [blame^] | 16 | MOCK_CONST_METHOD1(pci_device_enable, void(struct pci_device*)); |
Benjamin Fair | 20a1809 | 2020-06-08 11:12:21 -0700 | [diff] [blame] | 17 | MOCK_CONST_METHOD1(pci_device_next, |
| 18 | struct pci_device*(struct pci_device_iterator*)); |
| 19 | MOCK_CONST_METHOD1(pci_device_probe, int(struct pci_device*)); |
Benjamin Fair | c1a30c0 | 2020-06-09 11:46:34 -0700 | [diff] [blame] | 20 | MOCK_CONST_METHOD3(pci_device_cfg_read_u8, |
| 21 | int(struct pci_device* dev, std::uint8_t* data, |
| 22 | pciaddr_t offset)); |
| 23 | MOCK_CONST_METHOD3(pci_device_cfg_write_u8, |
| 24 | int(struct pci_device* dev, std::uint8_t data, |
| 25 | pciaddr_t offset)); |
Benjamin Fair | 20a1809 | 2020-06-08 11:12:21 -0700 | [diff] [blame] | 26 | MOCK_CONST_METHOD5(pci_device_map_range, int(struct pci_device*, pciaddr_t, |
| 27 | pciaddr_t, unsigned, void**)); |
| 28 | MOCK_CONST_METHOD3(pci_device_unmap_range, |
| 29 | int(struct pci_device*, void*, pciaddr_t)); |
| 30 | }; |
| 31 | |
| 32 | } // namespace host_tool |