test: Replace the C++ MOCK_METHOD<n> macros with the new MOCK_METHOD
Change-Id: Iebd23cce5dbb2ac047c9df1db2320b0402cd2499
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/src/ipmiblob/test/blob_interface_mock.hpp b/src/ipmiblob/test/blob_interface_mock.hpp
index f5137d5..b92ba25 100644
--- a/src/ipmiblob/test/blob_interface_mock.hpp
+++ b/src/ipmiblob/test/blob_interface_mock.hpp
@@ -9,20 +9,25 @@
{
public:
virtual ~BlobInterfaceMock() = default;
- MOCK_METHOD2(commit, void(std::uint16_t, const std::vector<std::uint8_t>&));
- MOCK_METHOD3(writeMeta, void(std::uint16_t, std::uint32_t,
- const std::vector<std::uint8_t>&));
- MOCK_METHOD3(writeBytes, void(std::uint16_t, std::uint32_t,
- const std::vector<std::uint8_t>&));
- MOCK_METHOD0(getBlobList, std::vector<std::string>());
- MOCK_METHOD1(getStat, StatResponse(const std::string&));
- MOCK_METHOD1(getStat, StatResponse(std::uint16_t));
- MOCK_METHOD2(openBlob, std::uint16_t(const std::string&, std::uint16_t));
- MOCK_METHOD1(closeBlob, void(std::uint16_t));
- MOCK_METHOD1(deleteBlob, void(const std::string&));
- MOCK_METHOD3(readBytes,
- std::vector<std::uint8_t>(std::uint16_t, std::uint32_t,
- std::uint32_t));
+ MOCK_METHOD(void, commit, (std::uint16_t, const std::vector<std::uint8_t>&),
+ (override));
+ MOCK_METHOD(void, writeMeta,
+ (std::uint16_t, std::uint32_t,
+ const std::vector<std::uint8_t>&),
+ (override));
+ MOCK_METHOD(void, writeBytes,
+ (std::uint16_t, std::uint32_t,
+ const std::vector<std::uint8_t>&),
+ (override));
+ MOCK_METHOD(std::vector<std::string>, getBlobList, (), (override));
+ MOCK_METHOD(StatResponse, getStat, (const std::string&), (override));
+ MOCK_METHOD(StatResponse, getStat, (std::uint16_t), (override));
+ MOCK_METHOD(std::uint16_t, openBlob, (const std::string&, std::uint16_t),
+ (override));
+ MOCK_METHOD(void, closeBlob, (std::uint16_t), (override));
+ MOCK_METHOD(void, deleteBlob, (const std::string&), (override));
+ MOCK_METHOD(std::vector<std::uint8_t>, readBytes,
+ (std::uint16_t, std::uint32_t, std::uint32_t), (override));
};
} // namespace ipmiblob
diff --git a/src/ipmiblob/test/crc_mock.hpp b/src/ipmiblob/test/crc_mock.hpp
index 41c2135..67bf9fd 100644
--- a/src/ipmiblob/test/crc_mock.hpp
+++ b/src/ipmiblob/test/crc_mock.hpp
@@ -21,8 +21,8 @@
{
public:
virtual ~CrcMock() = default;
- MOCK_CONST_METHOD1(generateCrc,
- std::uint16_t(const std::vector<std::uint8_t>&));
+ MOCK_METHOD(std::uint16_t, generateCrc, (const std::vector<std::uint8_t>&),
+ (const, override));
};
} // namespace ipmiblob
diff --git a/src/ipmiblob/test/ipmi_interface_mock.hpp b/src/ipmiblob/test/ipmi_interface_mock.hpp
index 5f5514c..a78dc13 100644
--- a/src/ipmiblob/test/ipmi_interface_mock.hpp
+++ b/src/ipmiblob/test/ipmi_interface_mock.hpp
@@ -11,9 +11,9 @@
{
public:
virtual ~IpmiInterfaceMock() = default;
- MOCK_METHOD3(sendPacket,
- std::vector<std::uint8_t>(std::uint8_t, std::uint8_t,
- std::vector<std::uint8_t>&));
+ MOCK_METHOD(std::vector<std::uint8_t>, sendPacket,
+ (std::uint8_t, std::uint8_t, std::vector<std::uint8_t>&),
+ (override));
};
} // namespace ipmiblob
diff --git a/test/internal_sys_mock.hpp b/test/internal_sys_mock.hpp
index 55db6b7..d815d11 100644
--- a/test/internal_sys_mock.hpp
+++ b/test/internal_sys_mock.hpp
@@ -16,14 +16,15 @@
public:
virtual ~InternalSysMock() = default;
- MOCK_CONST_METHOD2(open, int(const char*, int));
- MOCK_CONST_METHOD3(read, int(int, void*, std::size_t));
- MOCK_CONST_METHOD1(close, int(int));
- MOCK_CONST_METHOD6(mmap, void*(void*, std::size_t, int, int, int, off_t));
- MOCK_CONST_METHOD2(munmap, int(void*, std::size_t));
- MOCK_CONST_METHOD0(getpagesize, int());
- MOCK_CONST_METHOD3(ioctl, int(int, unsigned long, void*));
- MOCK_CONST_METHOD3(poll, int(struct pollfd*, nfds_t, int));
+ MOCK_METHOD(int, open, (const char*, int), (const, override));
+ MOCK_METHOD(int, read, (int, void*, std::size_t), (const, override));
+ MOCK_METHOD(int, close, (int), (const, override));
+ MOCK_METHOD(void*, mmap, (void*, std::size_t, int, int, int, off_t),
+ (const, override));
+ MOCK_METHOD(int, munmap, (void*, std::size_t), (const, override));
+ MOCK_METHOD(int, getpagesize, (), (const, override));
+ MOCK_METHOD(int, ioctl, (int, unsigned long, void*), (const, override));
+ MOCK_METHOD(int, poll, (struct pollfd*, nfds_t, int), (const, override));
};
} // namespace internal