added support for onChange report
Report is now notified when metric changes and updates reading values.
Tested:
- Added new unit tests
- OnChange report updates Readings when metric values changes
Change-Id: I3be9ef7aa0486cb15bac627aa1de5cc632613b3b
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
diff --git a/tests/src/test_sensor.cpp b/tests/src/test_sensor.cpp
index c073ee7..8738bde 100644
--- a/tests/src/test_sensor.cpp
+++ b/tests/src/test_sensor.cpp
@@ -147,12 +147,9 @@
ASSERT_TRUE(DbusEnvironment::waitForFuture("notify"));
}
-TEST_F(TestSensorNotification, notifiesListenerWithValueWhenNoChangeOccurs)
+TEST_F(TestSensorNotification, doesntNotifyListenerWhenNoChangeOccurs)
{
- InSequence seq;
-
- EXPECT_CALL(*listenerMock, sensorUpdated(Ref(*sut), Ge(timestamp), 42.7));
- EXPECT_CALL(*listenerMock, sensorUpdated(Ref(*sut), Ge(timestamp)))
+ EXPECT_CALL(*listenerMock, sensorUpdated(Ref(*sut), Ge(timestamp), 42.7))
.WillOnce(InvokeWithoutArgs(DbusEnvironment::setPromise("notify")));
sensorObject->setValue(42.7);