mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-14 11:06:35 +02:00
35 lines
695 B
C++
35 lines
695 B
C++
// ArduinoJson - arduinojson.org
|
|
// Copyright Benoit Blanchon 2014-2019
|
|
// MIT License
|
|
|
|
#include <ArduinoJson.h>
|
|
#include <catch.hpp>
|
|
|
|
TEST_CASE("JsonObject::isNull()") {
|
|
DynamicJsonDocument doc(4096);
|
|
|
|
SECTION("returns true") {
|
|
JsonObject obj;
|
|
REQUIRE(obj.isNull() == true);
|
|
}
|
|
|
|
SECTION("returns false") {
|
|
JsonObject obj = doc.to<JsonObject>();
|
|
REQUIRE(obj.isNull() == false);
|
|
}
|
|
}
|
|
|
|
TEST_CASE("JsonObjectConst::isNull()") {
|
|
DynamicJsonDocument doc(4096);
|
|
|
|
SECTION("returns true") {
|
|
JsonObjectConst obj;
|
|
REQUIRE(obj.isNull() == true);
|
|
}
|
|
|
|
SECTION("returns false") {
|
|
JsonObjectConst obj = doc.to<JsonObject>();
|
|
REQUIRE(obj.isNull() == false);
|
|
}
|
|
}
|