Redesigned JsonVariant to leverage converting constructors instead of assignment operators

This commit is contained in:
Benoit Blanchon committed 2015-05-23 15:32:50 +02:00
1 parent 08d05df00e
commit 756c279cdc
44 files changed
+934 -649

No files matched your search

+4 -8
View File
@@ -7,18 +7,14 @@
#include <gtest/gtest.h>
#include <ArduinoJson.h>
TEST(JsonObject_Invalid_Tests, AtFails) {
ASSERT_FALSE(JsonObject::invalid().at(0).success());
}
TEST(JsonObject_Invalid_Tests, SubscriptFails) {
ASSERT_FALSE(JsonObject::invalid()[0].success());
}
TEST(JsonObject_Invalid_Tests, AddFails) {
JsonObject& array = JsonObject::invalid();
array.add("hello", "world");
ASSERT_EQ(0, array.size());
JsonObject& object = JsonObject::invalid();
object.set("hello", "world");
ASSERT_EQ(0, object.size());
}
TEST(JsonObject_Invalid_Tests, CreateNestedArrayFails) {
@@ -33,4 +29,4 @@ TEST(JsonObject_Invalid_Tests, PrintToWritesBraces) {
char buffer[32];
JsonObject::invalid().printTo(buffer, sizeof(buffer));
ASSERT_STREQ("{}", buffer);
}
}