File tree 2 files changed +13
-2
lines changed
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]")
45
45
int const payload_length = sizeof (payload) / sizeof (uint8_t );
46
46
CBORDecoder::decode (property_container, payload, payload_length);
47
47
48
- REQUIRE (prop.isDifferentFromCloud () == true );
48
+ // REQUIRE(prop.isDifferentFromCloud() == true);
49
+ REQUIRE (prop.value () != prop.cloudValue ());
49
50
}
50
51
51
52
WHEN (" both, the local and the cloud values are NaN" )
@@ -75,7 +76,8 @@ SCENARIO("Arduino Cloud Properties ", "[ArduinoCloudThing::CloudFloat]")
75
76
int const payload_length = sizeof (payload) / sizeof (uint8_t );
76
77
CBORDecoder::decode (property_container, payload, payload_length);
77
78
78
- REQUIRE (prop.isDifferentFromCloud () == false );
79
+ // REQUIRE(prop.isDifferentFromCloud() == false);
80
+ REQUIRE (prop.value () == prop.cloudValue ());
79
81
}
80
82
81
83
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 {
46
46
operator float () const {
47
47
return _value;
48
48
}
49
+
50
+ float value () const {
51
+ return _value;
52
+ }
53
+
54
+ float cloudValue () const {
55
+ return _cloud_value;
56
+ }
57
+
49
58
virtual bool isDifferentFromCloud () {
50
59
return arduino::math::ieee754_different (_value, _cloud_value, Property::_min_delta_property);
51
60
}
You can’t perform that action at this time.
0 commit comments