mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-04 14:16:36 +02:00
24 lines
616 B
C++
24 lines
616 B
C++
![]() |
// ArduinoJson - arduinojson.org
|
||
|
// Copyright Benoit Blanchon 2014-2023
|
||
|
// MIT License
|
||
|
|
||
|
#include <ArduinoJson.h>
|
||
|
|
||
|
#include <catch.hpp>
|
||
|
|
||
|
TEST_CASE("JsonObject::createNestedObject()") {
|
||
|
DynamicJsonBuffer _jsonBuffer;
|
||
|
JsonObject& _object = _jsonBuffer.createObject();
|
||
|
|
||
|
SECTION("success() should return true if key is non-null") {
|
||
|
JsonObject& obj = _object.createNestedObject("key");
|
||
|
REQUIRE(obj.success() == true);
|
||
|
}
|
||
|
|
||
|
SECTION("success() should return false if key is null") {
|
||
|
const char* null = 0;
|
||
|
JsonObject& obj = _object.createNestedObject(null);
|
||
|
REQUIRE(obj.success() == false);
|
||
|
}
|
||
|
}
|