Fix CI job
Decreased meson version to 0.54.3 to enable CI jobs.
Fixed Invoke arguments in unit tests.
Change-Id: I75cdce3ebb2bffd7732db30b2f718a3728c277c8
Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
diff --git a/meson.build b/meson.build
index 9dcbcb2..22e0cc3 100644
--- a/meson.build
+++ b/meson.build
@@ -1,7 +1,7 @@
project(
'Telemetry',
'cpp',
- meson_version: '>=0.55.0',
+ meson_version: '>=0.54.3',
default_options: [
'buildtype=debugoptimized',
'cpp_std=c++17',
diff --git a/tests/src/mocks/sensor_listener_mock.hpp b/tests/src/mocks/sensor_listener_mock.hpp
index b8f1ef5..3a61519 100644
--- a/tests/src/mocks/sensor_listener_mock.hpp
+++ b/tests/src/mocks/sensor_listener_mock.hpp
@@ -11,13 +11,11 @@
{
using namespace testing;
- ON_CALL(*this, sensorUpdated(_, _)).WillByDefault(Invoke([this] {
- sensorUpdated();
- }));
+ ON_CALL(*this, sensorUpdated(_, _))
+ .WillByDefault(InvokeWithoutArgs([this] { sensorUpdated(); }));
- ON_CALL(*this, sensorUpdated(_, _, _)).WillByDefault(Invoke([this] {
- sensorUpdated();
- }));
+ ON_CALL(*this, sensorUpdated(_, _, _))
+ .WillByDefault(InvokeWithoutArgs([this] { sensorUpdated(); }));
}
MOCK_METHOD(void, sensorUpdated, (interfaces::Sensor&, uint64_t),
diff --git a/tests/src/test_sensor.cpp b/tests/src/test_sensor.cpp
index c650831..cbd6233 100644
--- a/tests/src/test_sensor.cpp
+++ b/tests/src/test_sensor.cpp
@@ -62,7 +62,7 @@
TEST_F(TestSensor, notifiesWithValueAfterRegister)
{
EXPECT_CALL(*listenerMock, sensorUpdated(Ref(*sut), Ge(timestamp), 42.7))
- .WillOnce(Invoke(DbusEnvironment::setPromise("async_read")));
+ .WillOnce(InvokeWithoutArgs(DbusEnvironment::setPromise("async_read")));
registerForUpdates(listenerMock);
@@ -72,9 +72,10 @@
TEST_F(TestSensor, notifiesOnceWithValueAfterRegister)
{
EXPECT_CALL(*listenerMock, sensorUpdated(Ref(*sut), Ge(timestamp), 42.7))
- .WillOnce(Invoke(DbusEnvironment::setPromise("async_read")));
+ .WillOnce(InvokeWithoutArgs(DbusEnvironment::setPromise("async_read")));
EXPECT_CALL(*listenerMock2, sensorUpdated(Ref(*sut), Ge(timestamp), 42.7))
- .WillOnce(Invoke(DbusEnvironment::setPromise("async_read2")));
+ .WillOnce(
+ InvokeWithoutArgs(DbusEnvironment::setPromise("async_read2")));
DbusEnvironment::synchronizedPost([this] {
sut->registerForUpdates(listenerMock);
@@ -91,7 +92,8 @@
void SetUp() override
{
EXPECT_CALL(*listenerMock, sensorUpdated(Ref(*sut), Ge(timestamp), 0.))
- .WillOnce(Invoke(DbusEnvironment::setPromise("async_read")));
+ .WillOnce(
+ InvokeWithoutArgs(DbusEnvironment::setPromise("async_read")));
registerForUpdates(listenerMock);
@@ -105,7 +107,7 @@
TEST_F(TestSensorNotification, notifiesListenerWithValueWhenChangeOccurs)
{
EXPECT_CALL(*listenerMock, sensorUpdated(Ref(*sut), Ge(timestamp), 42.7))
- .WillOnce(Invoke(DbusEnvironment::setPromise("notify")));
+ .WillOnce(InvokeWithoutArgs(DbusEnvironment::setPromise("notify")));
sensorObject.setValue(42.7);
@@ -120,7 +122,7 @@
.InSequence(seq);
EXPECT_CALL(*listenerMock, sensorUpdated(Ref(*sut), Ge(timestamp)))
.InSequence(seq)
- .WillOnce(Invoke(DbusEnvironment::setPromise("notify")));
+ .WillOnce(InvokeWithoutArgs(DbusEnvironment::setPromise("notify")));
sensorObject.setValue(42.7);
sensorObject.setValue(42.7);
@@ -135,7 +137,7 @@
.InSequence(seq);
EXPECT_CALL(*listenerMock2, sensorUpdated(Ref(*sut), Ge(timestamp), 42.7))
.InSequence(seq)
- .WillOnce(Invoke(DbusEnvironment::setPromise("notify")));
+ .WillOnce(InvokeWithoutArgs(DbusEnvironment::setPromise("notify")));
registerForUpdates(listenerMock2);
listenerMock = nullptr;