Lei YU | ab1327c | 2019-11-04 16:53:39 +0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "../i2c_interface.hpp" |
| 4 | |
| 5 | #include <gmock/gmock.h> |
| 6 | |
| 7 | namespace i2c |
| 8 | { |
| 9 | |
| 10 | class MockedI2CInterface : public I2CInterface |
| 11 | { |
| 12 | public: |
| 13 | virtual ~MockedI2CInterface() = default; |
| 14 | |
Shawn McCarney | d45a9a6 | 2019-12-10 18:35:44 -0600 | [diff] [blame] | 15 | MOCK_METHOD(void, open, (), (override)); |
| 16 | MOCK_METHOD(bool, isOpen, (), (const, override)); |
| 17 | MOCK_METHOD(void, close, (), (override)); |
| 18 | |
Lei YU | ab1327c | 2019-11-04 16:53:39 +0800 | [diff] [blame] | 19 | MOCK_METHOD(void, read, (uint8_t & data), (override)); |
| 20 | MOCK_METHOD(void, read, (uint8_t addr, uint8_t& data), (override)); |
| 21 | MOCK_METHOD(void, read, (uint8_t addr, uint16_t& data), (override)); |
Lei YU | 1d10342 | 2019-11-29 14:00:02 +0800 | [diff] [blame] | 22 | MOCK_METHOD(void, read, |
| 23 | (uint8_t addr, uint8_t& size, uint8_t* data, Mode mode), |
Lei YU | ab1327c | 2019-11-04 16:53:39 +0800 | [diff] [blame] | 24 | (override)); |
| 25 | |
| 26 | MOCK_METHOD(void, write, (uint8_t data), (override)); |
| 27 | MOCK_METHOD(void, write, (uint8_t addr, uint8_t data), (override)); |
| 28 | MOCK_METHOD(void, write, (uint8_t addr, uint16_t data), (override)); |
Lei YU | 1d10342 | 2019-11-29 14:00:02 +0800 | [diff] [blame] | 29 | MOCK_METHOD(void, write, |
| 30 | (uint8_t addr, uint8_t size, const uint8_t* data, Mode mode), |
Lei YU | ab1327c | 2019-11-04 16:53:39 +0800 | [diff] [blame] | 31 | (override)); |
| 32 | }; |
| 33 | |
Lei YU | ab1327c | 2019-11-04 16:53:39 +0800 | [diff] [blame] | 34 | } // namespace i2c |