mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-29 18:27:37 +02:00
@ -6,6 +6,7 @@ HEAD
|
||||
|
||||
* Fix "no matching function" with `JsonObjectConst::operator[]` (issue #2019)
|
||||
* Remove unused files in the PlatformIO package
|
||||
* Fix `volatile bool` serialized as `1` or `0` instead of `true` or `false` (issue #2029)
|
||||
|
||||
v7.0.0 (2024-01-03)
|
||||
------
|
||||
|
@ -140,6 +140,13 @@ TEST_CASE("volatile") {
|
||||
JsonDocument doc;
|
||||
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") {
|
||||
volatile int f = 42;
|
||||
variant.set(f);
|
||||
|
@ -132,7 +132,8 @@ VariantRefBase<TDerived>::operator[](const TString& key) const {
|
||||
template <typename TDerived>
|
||||
template <typename T>
|
||||
inline bool VariantRefBase<TDerived>::set(const T& value) const {
|
||||
Converter<T>::toJson(value, getOrCreateVariant());
|
||||
Converter<typename detail::remove_cv<T>::type>::toJson(value,
|
||||
getOrCreateVariant());
|
||||
auto resources = getResourceManager();
|
||||
return resources && !resources->overflowed();
|
||||
}
|
||||
|
Reference in New Issue
Block a user