blob: 02b44f8b5c3ecd08d034bfe0c47da48fe1f313a6 [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));
32};
33
Lei YUab1327c2019-11-04 16:53:39 +080034} // namespace i2c