blob: 3fc08c7447ddb9053d3d3af6ac4d36509dab6f0a [file] [log] [blame]
Lei YUab1327c2019-11-04 16:53:39 +08001#pragma once
2
3#include "../i2c_interface.hpp"
4
5#include <gmock/gmock.h>
6
7namespace i2c
8{
9
10class MockedI2CInterface : public I2CInterface
11{
12 public:
13 virtual ~MockedI2CInterface() = default;
14
Shawn McCarneyd45a9a62019-12-10 18:35:44 -060015 MOCK_METHOD(void, open, (), (override));
16 MOCK_METHOD(bool, isOpen, (), (const, override));
17 MOCK_METHOD(void, close, (), (override));
18
Lei YUab1327c2019-11-04 16:53:39 +080019 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 YU1d103422019-11-29 14:00:02 +080022 MOCK_METHOD(void, read,
23 (uint8_t addr, uint8_t& size, uint8_t* data, Mode mode),
Lei YUab1327c2019-11-04 16:53:39 +080024 (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 YU1d103422019-11-29 14:00:02 +080029 MOCK_METHOD(void, write,
30 (uint8_t addr, uint8_t size, const uint8_t* data, Mode mode),
Lei YUab1327c2019-11-04 16:53:39 +080031 (override));
Shawn McCarneya3ff7e72024-10-15 17:34:49 -050032
33 MOCK_METHOD(void, processCall,
34 (uint8_t addr, uint16_t writeData, uint16_t& readData),
35 (override));
36 MOCK_METHOD(void, processCall,
37 (uint8_t addr, uint8_t writeSize, const uint8_t* writeData,
38 uint8_t& readSize, uint8_t* readData),
39 (override));
Lei YUab1327c2019-11-04 16:53:39 +080040};
41
Lei YUab1327c2019-11-04 16:53:39 +080042} // namespace i2c