mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-19 21:42:30 +02:00
Added StaticJsonDocument and DynamicJsonDocument.
Removed StaticJsonArray and DynamicJsonArray. Removed StaticJsonObject and DynamicJsonObject. Removed StaticJsonVariant and DynamicJsonVariant.
This commit is contained in:
@ -18,8 +18,7 @@ std::stringstream allocatorLog;
|
||||
|
||||
struct SpyingAllocator : DefaultAllocator {
|
||||
void* allocate(size_t n) {
|
||||
allocatorLog << static_cast<const char*>("A")
|
||||
<< (n - DynamicJsonBuffer::EmptyBlockSize);
|
||||
allocatorLog << "A" << (n - DynamicJsonBuffer::EmptyBlockSize);
|
||||
return DefaultAllocator::allocate(n);
|
||||
}
|
||||
void deallocate(void* p) {
|
||||
|
@ -23,19 +23,9 @@ TEST_CASE("DynamicJsonBuffer no memory") {
|
||||
}
|
||||
|
||||
// TODO: uncomment
|
||||
// SECTION("parseArray()") {
|
||||
// char json[] = "[{}]";
|
||||
// DynamicJsonArray arr;
|
||||
|
||||
// JsonError err = deserializeJson(arr, json);
|
||||
|
||||
// REQUIRE(err != JsonError::Ok);
|
||||
// }
|
||||
|
||||
// TODO: uncomment
|
||||
// SECTION("parseObject()") {
|
||||
// SECTION("deserializeJson()") {
|
||||
// char json[] = "{[]}";
|
||||
// DynamicJsonObject obj;
|
||||
// DynamicJsonDocument obj;
|
||||
|
||||
// JsonError err = deserializeJson(obj, json);
|
||||
|
||||
|
@ -2,9 +2,11 @@
|
||||
// Copyright Benoit Blanchon 2014-2018
|
||||
// MIT License
|
||||
|
||||
#include <ArduinoJson.h>
|
||||
#include <ArduinoJson/Memory/DynamicJsonBuffer.hpp>
|
||||
#include <catch.hpp>
|
||||
|
||||
using namespace ArduinoJson::Internals;
|
||||
|
||||
TEST_CASE("DynamicJsonBuffer::size()") {
|
||||
DynamicJsonBuffer buffer;
|
||||
|
||||
|
@ -2,9 +2,11 @@
|
||||
// Copyright Benoit Blanchon 2014-2018
|
||||
// MIT License
|
||||
|
||||
#include <ArduinoJson.h>
|
||||
#include <ArduinoJson/Memory/DynamicJsonBuffer.hpp>
|
||||
#include <catch.hpp>
|
||||
|
||||
using namespace ArduinoJson::Internals;
|
||||
|
||||
TEST_CASE("DynamicJsonBuffer::startString()") {
|
||||
SECTION("WorksWhenBufferIsBigEnough") {
|
||||
DynamicJsonBuffer jsonBuffer(6);
|
||||
|
Reference in New Issue
Block a user