Patrick Venture | e3e0f97 | 2018-12-19 08:58:21 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <gpioplus/handle.hpp> |
Patrick Williams | e8771fd | 2023-05-10 07:51:06 -0500 | [diff] [blame^] | 4 | |
Patrick Venture | e3e0f97 | 2018-12-19 08:58:21 -0800 | [diff] [blame] | 5 | #include <memory> |
| 6 | #include <string> |
| 7 | |
| 8 | #include <gmock/gmock.h> |
| 9 | |
| 10 | class GpioHandleInterface |
| 11 | { |
| 12 | public: |
| 13 | virtual ~GpioHandleInterface() = default; |
| 14 | virtual std::unique_ptr<gpioplus::HandleInterface> |
| 15 | build(const std::string& gpiochip, const std::string& line) const = 0; |
| 16 | }; |
| 17 | |
| 18 | class GpioHandleMock : public GpioHandleInterface |
| 19 | { |
| 20 | public: |
| 21 | virtual ~GpioHandleMock() = default; |
| 22 | MOCK_CONST_METHOD2(build, std::unique_ptr<gpioplus::HandleInterface>( |
| 23 | const std::string&, const std::string&)); |
| 24 | }; |
| 25 | |
| 26 | // Set this before each test that hits a call to getEnv(). |
| 27 | extern GpioHandleInterface* gpioIntf; |