2018-07-12 09:08:20 +02:00
|
|
|
// ArduinoJson - arduinojson.org
|
|
|
|
// Copyright Benoit Blanchon 2014-2018
|
|
|
|
// MIT License
|
|
|
|
|
|
|
|
#include <ArduinoJson.h>
|
|
|
|
#include <catch.hpp>
|
|
|
|
|
|
|
|
TEST_CASE("JsonObject::isNull()") {
|
2019-01-14 10:32:19 +01:00
|
|
|
DynamicJsonDocument doc(4096);
|
2018-10-12 17:59:50 +02:00
|
|
|
|
|
|
|
SECTION("returns true") {
|
|
|
|
JsonObject obj;
|
|
|
|
REQUIRE(obj.isNull() == true);
|
|
|
|
}
|
|
|
|
|
|
|
|
SECTION("returns false") {
|
|
|
|
JsonObject obj = doc.to<JsonObject>();
|
|
|
|
REQUIRE(obj.isNull() == false);
|
2018-07-12 09:08:20 +02:00
|
|
|
}
|
2018-10-12 17:59:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_CASE("JsonObjectConst::isNull()") {
|
2019-01-14 10:32:19 +01:00
|
|
|
DynamicJsonDocument doc(4096);
|
2018-07-12 09:08:20 +02:00
|
|
|
|
2018-10-12 17:59:50 +02:00
|
|
|
SECTION("returns true") {
|
|
|
|
JsonObjectConst obj;
|
|
|
|
REQUIRE(obj.isNull() == true);
|
2018-07-12 09:08:20 +02:00
|
|
|
}
|
|
|
|
|
2018-10-12 17:59:50 +02:00
|
|
|
SECTION("returns false") {
|
|
|
|
JsonObjectConst obj = doc.to<JsonObject>();
|
|
|
|
REQUIRE(obj.isNull() == false);
|
|
|
|
}
|
2018-07-12 09:08:20 +02:00
|
|
|
}
|