forked from bblanchon/ArduinoJson
Fixed error when assigning a volatile int
to a JsonVariant
(issue #415)
This commit is contained in:
@ -1,6 +1,11 @@
|
|||||||
ArduinoJson: change log
|
ArduinoJson: change log
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
|
HEAD
|
||||||
|
----
|
||||||
|
|
||||||
|
* Fixed error when assigning a `volatile int` to a `JsonVariant` (issue #415)
|
||||||
|
|
||||||
v5.8.0
|
v5.8.0
|
||||||
------
|
------
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ class IsBaseOf {
|
|||||||
typedef char No[2];
|
typedef char No[2];
|
||||||
|
|
||||||
static Yes &probe(const TBase *);
|
static Yes &probe(const TBase *);
|
||||||
static No &probe(const void *);
|
static No &probe(...);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum {
|
enum {
|
||||||
|
@ -38,6 +38,15 @@ TEST_(StoreInteger) {
|
|||||||
EXPECT_FALSE(_object["hello"].is<double>());
|
EXPECT_FALSE(_object["hello"].is<double>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_(StoreVolatileInteger) { // issue #415
|
||||||
|
volatile int i = 123;
|
||||||
|
_object["hello"] = i;
|
||||||
|
|
||||||
|
EXPECT_EQ(123, _object["hello"].as<int>());
|
||||||
|
EXPECT_TRUE(_object["hello"].is<int>());
|
||||||
|
EXPECT_FALSE(_object["hello"].is<double>());
|
||||||
|
}
|
||||||
|
|
||||||
TEST_(StoreDouble) {
|
TEST_(StoreDouble) {
|
||||||
_object["hello"] = 123.45;
|
_object["hello"] = 123.45;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user