mirror of
https://github.com/1technophile/OpenMQTTGateway.git
synced 2026-03-18 21:27:23 +01:00
Revert "Merge branch 'master' of https://github.com/1technophile/OpenMQTTGateway"
This reverts commita70c33a68e, reversing changes made tof515f9c03a.
This commit is contained in:
@@ -1,45 +0,0 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2018
|
||||
// MIT License
|
||||
|
||||
#include <ArduinoJson.h>
|
||||
#include <catch.hpp>
|
||||
|
||||
TEST_CASE("StaticJsonBuffer::createArray()") {
|
||||
SECTION("GrowsWithArray") {
|
||||
StaticJsonBuffer<JSON_ARRAY_SIZE(2)> json;
|
||||
|
||||
JsonArray &array = json.createArray();
|
||||
REQUIRE(JSON_ARRAY_SIZE(0) == json.size());
|
||||
|
||||
array.add("hello");
|
||||
REQUIRE(JSON_ARRAY_SIZE(1) == json.size());
|
||||
|
||||
array.add("world");
|
||||
REQUIRE(JSON_ARRAY_SIZE(2) == json.size());
|
||||
}
|
||||
|
||||
SECTION("SucceedWhenBigEnough") {
|
||||
StaticJsonBuffer<JSON_ARRAY_SIZE(0)> json;
|
||||
|
||||
JsonArray &array = json.createArray();
|
||||
REQUIRE(array.success());
|
||||
}
|
||||
|
||||
SECTION("FailsWhenTooSmall") {
|
||||
StaticJsonBuffer<JSON_ARRAY_SIZE(0) - 1> json;
|
||||
|
||||
JsonArray &array = json.createArray();
|
||||
REQUIRE_FALSE(array.success());
|
||||
}
|
||||
|
||||
SECTION("ArrayDoesntGrowWhenFull") {
|
||||
StaticJsonBuffer<JSON_ARRAY_SIZE(1)> json;
|
||||
|
||||
JsonArray &array = json.createArray();
|
||||
array.add("hello");
|
||||
array.add("world");
|
||||
|
||||
REQUIRE(1 == array.size());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user