xref: /openbmc/gpioplus/src/gpioplus/test/sys.hpp (revision 7ba248ad)
1 #pragma once
2 #include <gpioplus/internal/sys.hpp>
3 
4 #include <gmock/gmock.h>
5 
6 namespace gpioplus
7 {
8 namespace test
9 {
10 
11 class SysMock : public internal::Sys
12 {
13   public:
14     MOCK_CONST_METHOD2(open, int(const char*, int));
15     MOCK_CONST_METHOD1(dup, int(int));
16     MOCK_CONST_METHOD1(close, int(int));
17     MOCK_CONST_METHOD3(read, int(int, void*, size_t));
18     MOCK_CONST_METHOD2(fcntl_setfl, int(int, int));
19     MOCK_CONST_METHOD1(fcntl_getfl, int(int));
20 
21     MOCK_CONST_METHOD2(gpiohandle_get_line_values,
22                        int(int, struct gpiohandle_data*));
23     MOCK_CONST_METHOD2(gpiohandle_set_line_values,
24                        int(int, struct gpiohandle_data*));
25     MOCK_CONST_METHOD2(gpio_get_chipinfo, int(int, struct gpiochip_info*));
26     MOCK_CONST_METHOD2(gpio_get_lineinfo, int(int, struct gpioline_info*));
27     MOCK_CONST_METHOD2(gpio_get_linehandle,
28                        int(int, struct gpiohandle_request*));
29     MOCK_CONST_METHOD2(gpio_get_lineevent, int(int, struct gpioevent_request*));
30 };
31 
32 } // namespace test
33 } // namespace gpioplus
34