forked from bblanchon/ArduinoJson
Renamed function RawJson()
to serialized()
This commit is contained in:
@ -3,10 +3,10 @@
|
||||
# MIT License
|
||||
|
||||
add_executable(JsonObjectTests
|
||||
basics.cpp
|
||||
containsKey.cpp
|
||||
get.cpp
|
||||
invalid.cpp
|
||||
isNull.cpp
|
||||
iterator.cpp
|
||||
remove.cpp
|
||||
set.cpp
|
||||
|
@ -1,15 +0,0 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2018
|
||||
// MIT License
|
||||
|
||||
#include <ArduinoJson.h>
|
||||
#include <catch.hpp>
|
||||
|
||||
TEST_CASE("JsonObject basics") {
|
||||
DynamicJsonDocument doc;
|
||||
JsonObject obj = doc.to<JsonObject>();
|
||||
|
||||
SECTION("isNull()") {
|
||||
REQUIRE(obj.isNull() == false);
|
||||
}
|
||||
}
|
25
test/JsonObject/isNull.cpp
Normal file
25
test/JsonObject/isNull.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2018
|
||||
// MIT License
|
||||
|
||||
#include <ArduinoJson.h>
|
||||
#include <catch.hpp>
|
||||
|
||||
TEST_CASE("JsonObject::isNull()") {
|
||||
SECTION("returns true for undefined JsonObject") {
|
||||
JsonObject array;
|
||||
REQUIRE(array.isNull() == true);
|
||||
}
|
||||
|
||||
SECTION("returns false when allocation succeeds") {
|
||||
StaticJsonDocument<JSON_OBJECT_SIZE(0)> doc;
|
||||
JsonObject array = doc.to<JsonObject>();
|
||||
REQUIRE(array.isNull() == false);
|
||||
}
|
||||
|
||||
SECTION("returns true when allocation fails") {
|
||||
StaticJsonDocument<1> doc;
|
||||
JsonObject array = doc.to<JsonObject>();
|
||||
REQUIRE(array.isNull() == true);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user