File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ SCENARIO("Arduino Cloud Properties ", "[ArduinoCloudThing::CloudFloat]")
4545 int const payload_length = sizeof (payload) / sizeof (uint8_t );
4646 CBORDecoder::decode (property_container, payload, payload_length);
4747
48- REQUIRE (prop.isDifferentFromCloud () == true );
48+ // REQUIRE(prop.isDifferentFromCloud() == true);
49+ REQUIRE (prop.value () != prop.cloudValue ());
4950 }
5051
5152 WHEN (" both, the local and the cloud values are NaN" )
@@ -75,7 +76,8 @@ SCENARIO("Arduino Cloud Properties ", "[ArduinoCloudThing::CloudFloat]")
7576 int const payload_length = sizeof (payload) / sizeof (uint8_t );
7677 CBORDecoder::decode (property_container, payload, payload_length);
7778
78- REQUIRE (prop.isDifferentFromCloud () == false );
79+ // REQUIRE(prop.isDifferentFromCloud() == false);
80+ REQUIRE (prop.value () == prop.cloudValue ());
7981 }
8082
8183 WHEN (" the local and the cloud values differ" )
Original file line number Diff line number Diff line change @@ -46,6 +46,15 @@ class CloudFloat : public Property {
4646 operator float () const {
4747 return _value;
4848 }
49+
50+ float value () const {
51+ return _value;
52+ }
53+
54+ float cloudValue () const {
55+ return _cloud_value;
56+ }
57+
4958 virtual bool isDifferentFromCloud () {
5059 return arduino::math::ieee754_different (_value, _cloud_value, Property::_min_delta_property);
5160 }
You can’t perform that action at this time.
0 commit comments