PEL:test: Fix deprecated warnings with new gmock
The new version of gmock was complaining that the use of Invoke() for a
callable was deprecated, so remove it.
```
../subprojects/googletest/googlemock/include/gmock/gmock-actions.h:2059:41: note: declared here
2059 | typename std::decay<FunctionImpl>::type Invoke(FunctionImpl&& function_impl) {
| ^~~~~~
../test/openpower-pels/host_notifier_test.cpp:489:31: error: ‘typename std::decay<_Tp>::type testing::Invoke(FunctionImpl&&) [with FunctionImpl = HostNotifierTest_TestCannotStartCmd_Test::TestBody()::<lambda(uint32_t, uint32_t)>&; typename std::decay<_Tp>::type = HostNotifierTest_TestCannotStartCmd_Test::TestBody()::<lambda(uint32_t, uint32_t)>]’ is deprecated: Actions can now be implicitly constructed from callables. No need to create wrapper objects using Invoke(). [-Werror=deprecated-declarations]
489 | .WillRepeatedly(Invoke(sendSuccess));
```
Change-Id: Id698baa8eefbe7e2b632bf8e5e750df69e088312
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/test/openpower-pels/host_notifier_test.cpp b/test/openpower-pels/host_notifier_test.cpp
index 8e7380e..33234dc 100644
--- a/test/openpower-pels/host_notifier_test.cpp
+++ b/test/openpower-pels/host_notifier_test.cpp
@@ -57,8 +57,7 @@
};
// Unless otherwise specified, sendNewLogCmd should always pass.
- ON_CALL(*mockHostIface, sendNewLogCmd(_, _))
- .WillByDefault(Invoke(send));
+ ON_CALL(*mockHostIface, sendNewLogCmd(_, _)).WillByDefault(send);
}
~HostNotifierTest()
@@ -376,9 +375,9 @@
};
EXPECT_CALL(*mockHostIface, sendNewLogCmd(_, _))
- .WillOnce(Invoke(sendFailure))
- .WillOnce(Invoke(sendSuccess))
- .WillOnce(Invoke(sendSuccess));
+ .WillOnce(sendFailure)
+ .WillOnce(sendSuccess)
+ .WillOnce(sendSuccess);
dataIface.changeHostState(true);
@@ -423,7 +422,7 @@
};
EXPECT_CALL(*mockHostIface, sendNewLogCmd(_, _))
- .WillRepeatedly(Invoke(sendFailure));
+ .WillRepeatedly(sendFailure);
dataIface.changeHostState(true);
@@ -470,23 +469,23 @@
// Fails 16 times (1 fail + 15 retries) and
// then start working.
EXPECT_CALL(*mockHostIface, sendNewLogCmd(_, _))
- .WillOnce(Invoke(sendFailure))
- .WillOnce(Invoke(sendFailure))
- .WillOnce(Invoke(sendFailure))
- .WillOnce(Invoke(sendFailure))
- .WillOnce(Invoke(sendFailure))
- .WillOnce(Invoke(sendFailure))
- .WillOnce(Invoke(sendFailure))
- .WillOnce(Invoke(sendFailure))
- .WillOnce(Invoke(sendFailure))
- .WillOnce(Invoke(sendFailure))
- .WillOnce(Invoke(sendFailure))
- .WillOnce(Invoke(sendFailure))
- .WillOnce(Invoke(sendFailure))
- .WillOnce(Invoke(sendFailure))
- .WillOnce(Invoke(sendFailure))
- .WillOnce(Invoke(sendFailure))
- .WillRepeatedly(Invoke(sendSuccess));
+ .WillOnce(sendFailure)
+ .WillOnce(sendFailure)
+ .WillOnce(sendFailure)
+ .WillOnce(sendFailure)
+ .WillOnce(sendFailure)
+ .WillOnce(sendFailure)
+ .WillOnce(sendFailure)
+ .WillOnce(sendFailure)
+ .WillOnce(sendFailure)
+ .WillOnce(sendFailure)
+ .WillOnce(sendFailure)
+ .WillOnce(sendFailure)
+ .WillOnce(sendFailure)
+ .WillOnce(sendFailure)
+ .WillOnce(sendFailure)
+ .WillOnce(sendFailure)
+ .WillRepeatedly(sendSuccess);
dataIface.changeHostState(true);