Files
ArduinoJson/extras/tests/JsonObject/isNull.cpp
T

35 lines
695 B
C++
Raw Normal View History

2018-07-12 09:08:20 +02:00
// ArduinoJson - arduinojson.org
2019-02-15 13:31:46 +01:00
// Copyright Benoit Blanchon 2014-2019
2018-07-12 09:08:20 +02:00
// MIT License
#include <ArduinoJson.h>
#include <catch.hpp>
TEST_CASE("JsonObject::isNull()") {
DynamicJsonDocument doc(4096);
SECTION("returns true") {
JsonObject obj;
REQUIRE(obj.isNull() == true);
2018-07-12 09:08:20 +02:00
}
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);
2018-07-12 09:08:20 +02:00
}
}