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("JsonArray::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") {
|
|
|
|
JsonArray arr;
|
|
|
|
REQUIRE(arr.isNull() == true);
|
2018-07-12 09:08:20 +02:00
|
|
|
}
|
|
|
|
|
2018-10-12 17:59:50 +02:00
|
|
|
SECTION("returns false") {
|
|
|
|
JsonArray arr = doc.to<JsonArray>();
|
|
|
|
REQUIRE(arr.isNull() == false);
|
|
|
|
}
|
2018-07-12 09:08:20 +02:00
|
|
|
}
|
2018-10-12 12:00:27 +02:00
|
|
|
|
|
|
|
TEST_CASE("JsonArrayConst::isNull()") {
|
2019-01-14 10:32:19 +01:00
|
|
|
DynamicJsonDocument doc(4096);
|
2018-10-12 12:00:27 +02:00
|
|
|
|
2018-10-12 17:59:50 +02:00
|
|
|
SECTION("returns true") {
|
|
|
|
JsonArrayConst arr;
|
|
|
|
REQUIRE(arr.isNull() == true);
|
2018-10-12 12:00:27 +02:00
|
|
|
}
|
|
|
|
|
2018-10-12 17:59:50 +02:00
|
|
|
SECTION("returns false") {
|
|
|
|
JsonArrayConst arr = doc.to<JsonArray>();
|
|
|
|
REQUIRE(arr.isNull() == false);
|
|
|
|
}
|
2018-10-12 12:00:27 +02:00
|
|
|
}
|