mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
Moved ancillary files to extras/ (fixes #1011)
This commit is contained in:
34
extras/tests/JsonObject/isNull.cpp
Normal file
34
extras/tests/JsonObject/isNull.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user