mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-16 20:12:16 +02:00
Serialize booleans in objects
This commit is contained in:
@ -122,6 +122,10 @@ size_t JsonObject::printTo(Print& p) const
|
|||||||
case JSON_INTEGER:
|
case JSON_INTEGER:
|
||||||
n += p.print(childValue->content.asInteger);
|
n += p.print(childValue->content.asInteger);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case JSON_BOOLEAN:
|
||||||
|
n += p.print(childValue->content.asBoolean ? "true" : "false");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (childValue->type >= JSON_DOUBLE_0_DECIMALS)
|
if (childValue->type >= JSON_DOUBLE_0_DECIMALS)
|
||||||
|
@ -107,7 +107,7 @@ TEST_F(JsonObjectSerializationTests, OneDoubleDefaultDigits)
|
|||||||
object["key"] = 3.14159265358979323846;
|
object["key"] = 3.14159265358979323846;
|
||||||
outputMustBe("{\"key\":3.14}");
|
outputMustBe("{\"key\":3.14}");
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
TEST_F(JsonObjectSerializationTests, OneNull)
|
TEST_F(JsonObjectSerializationTests, OneNull)
|
||||||
{
|
{
|
||||||
object["key"] = (char*) 0;
|
object["key"] = (char*) 0;
|
||||||
@ -125,7 +125,7 @@ TEST_F(JsonObjectSerializationTests, OneFalse)
|
|||||||
object["key"] = false;
|
object["key"] = false;
|
||||||
outputMustBe("{\"key\":false}");
|
outputMustBe("{\"key\":false}");
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
TEST_F(JsonObjectSerializationTests, OneEmptyNestedArray)
|
TEST_F(JsonObjectSerializationTests, OneEmptyNestedArray)
|
||||||
{
|
{
|
||||||
auto nestedArray = JsonArray<1>();
|
auto nestedArray = JsonArray<1>();
|
||||||
|
Reference in New Issue
Block a user