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 15 MOCK_METHOD(void, open, (), (override)); 16 MOCK_METHOD(bool, isOpen, (), (const, override)); 17 MOCK_METHOD(void, close, (), (override)); 18 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)); 22 MOCK_METHOD(void, read, 23 (uint8_t addr, uint8_t& size, uint8_t* data, Mode mode), 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)); 29 MOCK_METHOD(void, write, 30 (uint8_t addr, uint8_t size, const uint8_t* data, Mode mode), 31 (override)); 32 }; 33 34 } // namespace i2c 35