forked from bblanchon/ArduinoJson
@ -5,6 +5,7 @@ HEAD
|
|||||||
----
|
----
|
||||||
|
|
||||||
* Fix warning `function returns incomplete class type` on IAR (issue #2001)
|
* Fix warning `function returns incomplete class type` on IAR (issue #2001)
|
||||||
|
* Fix `volatile bool` serialized as `1` or `0` instead of `true` or `false` (issue #2029)
|
||||||
|
|
||||||
v6.21.4 (2023-12-07)
|
v6.21.4 (2023-12-07)
|
||||||
-------
|
-------
|
||||||
|
@ -140,6 +140,13 @@ TEST_CASE("volatile") {
|
|||||||
DynamicJsonDocument doc(4096);
|
DynamicJsonDocument doc(4096);
|
||||||
JsonVariant variant = doc.to<JsonVariant>();
|
JsonVariant variant = doc.to<JsonVariant>();
|
||||||
|
|
||||||
|
SECTION("volatile bool") { // issue #2029
|
||||||
|
volatile bool f = true;
|
||||||
|
variant.set(f);
|
||||||
|
CHECK(variant.is<bool>() == true);
|
||||||
|
CHECK(variant.as<bool>() == true);
|
||||||
|
}
|
||||||
|
|
||||||
SECTION("volatile int") {
|
SECTION("volatile int") {
|
||||||
volatile int f = 42;
|
volatile int f = 42;
|
||||||
variant.set(f);
|
variant.set(f);
|
||||||
|
@ -137,7 +137,8 @@ VariantRefBase<TDerived>::is() const {
|
|||||||
template <typename TDerived>
|
template <typename TDerived>
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline bool VariantRefBase<TDerived>::set(const T& value) const {
|
inline bool VariantRefBase<TDerived>::set(const T& value) const {
|
||||||
Converter<T>::toJson(value, getOrCreateVariant());
|
Converter<typename detail::remove_cv<T>::type>::toJson(value,
|
||||||
|
getOrCreateVariant());
|
||||||
MemoryPool* pool = getPool();
|
MemoryPool* pool = getPool();
|
||||||
return pool && !pool->overflowed();
|
return pool && !pool->overflowed();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user