test: replace MOCK_CONST_METHOD with MOCK_METHOD
Replaced deprecated MOCK_CONST_METHOD macros with modern MOCK_METHOD
to resolve below build failures.
'''
src/gpioplus/test/handle.hpp:15:5: error: There is an unknown macro here somewhere.
Configuration is required. If GMOCK_PP_CAT is a macro then please configure it. [unknownMacro]
MOCK_CONST_METHOD1(getValues, void(std::vector<uint8_t>&));
src/gpioplus/test/sys.hpp:14:5: error: There is an unknown macro here somewhere.
Configuration is required. If GMOCK_PP_CAT is a macro then please configure it. [unknownMacro]
MOCK_CONST_METHOD2(open, int(const char*, int));
'''
Change-Id: Ib8c0af210ec8477eebd849f658aeca43ea67c9fb
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
diff --git a/src/gpioplus/test/handle.hpp b/src/gpioplus/test/handle.hpp
index 6e3253d..dfe76df 100644
--- a/src/gpioplus/test/handle.hpp
+++ b/src/gpioplus/test/handle.hpp
@@ -11,9 +11,9 @@
class HandleMock : public HandleInterface
{
public:
- MOCK_CONST_METHOD0(getValues, std::vector<uint8_t>());
- MOCK_CONST_METHOD1(getValues, void(std::vector<uint8_t>&));
- MOCK_CONST_METHOD1(setValues, void(const std::vector<uint8_t>&));
+ MOCK_METHOD(std::vector<uint8_t>, getValues, (), (const));
+ MOCK_METHOD(void, getValues, (std::vector<uint8_t>&), (const));
+ MOCK_METHOD(void, setValues, (const std::vector<uint8_t>&), (const));
};
} // namespace test
diff --git a/src/gpioplus/test/sys.hpp b/src/gpioplus/test/sys.hpp
index 752599a..223e575 100644
--- a/src/gpioplus/test/sys.hpp
+++ b/src/gpioplus/test/sys.hpp
@@ -11,22 +11,23 @@
class SysMock : public internal::Sys
{
public:
- MOCK_CONST_METHOD2(open, int(const char*, int));
- MOCK_CONST_METHOD1(dup, int(int));
- MOCK_CONST_METHOD1(close, int(int));
- MOCK_CONST_METHOD3(read, int(int, void*, size_t));
- MOCK_CONST_METHOD2(fcntl_setfl, int(int, int));
- MOCK_CONST_METHOD1(fcntl_getfl, int(int));
+ MOCK_METHOD(int, open, (const char*, int), (const));
+ MOCK_METHOD(int, dup, (int), (const));
+ MOCK_METHOD(int, close, (int), (const));
+ MOCK_METHOD(int, read, (int, void*, size_t), (const));
+ MOCK_METHOD(int, fcntl_setfl, (int, int), (const));
+ MOCK_METHOD(int, fcntl_getfl, (int), (const));
- MOCK_CONST_METHOD2(gpiohandle_get_line_values,
- int(int, struct gpiohandle_data*));
- MOCK_CONST_METHOD2(gpiohandle_set_line_values,
- int(int, struct gpiohandle_data*));
- MOCK_CONST_METHOD2(gpio_get_chipinfo, int(int, struct gpiochip_info*));
- MOCK_CONST_METHOD2(gpio_get_lineinfo, int(int, struct gpioline_info*));
- MOCK_CONST_METHOD2(gpio_get_linehandle,
- int(int, struct gpiohandle_request*));
- MOCK_CONST_METHOD2(gpio_get_lineevent, int(int, struct gpioevent_request*));
+ MOCK_METHOD(int, gpiohandle_get_line_values, (int, struct gpiohandle_data*),
+ (const));
+ MOCK_METHOD(int, gpiohandle_set_line_values, (int, struct gpiohandle_data*),
+ (const));
+ MOCK_METHOD(int, gpio_get_chipinfo, (int, struct gpiochip_info*), (const));
+ MOCK_METHOD(int, gpio_get_lineinfo, (int, struct gpioline_info*), (const));
+ MOCK_METHOD(int, gpio_get_linehandle, (int, struct gpiohandle_request*),
+ (const));
+ MOCK_METHOD(int, gpio_get_lineevent, (int, struct gpioevent_request*),
+ (const));
};
} // namespace test