mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-29 10:17:39 +02:00
Removed default capacity of DynamicJsonDocument
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
#include <catch.hpp>
|
||||
|
||||
TEST_CASE("deserialize MsgPack array") {
|
||||
DynamicJsonDocument doc;
|
||||
DynamicJsonDocument doc(4096);
|
||||
|
||||
SECTION("fixarray") {
|
||||
SECTION("empty") {
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <catch.hpp>
|
||||
|
||||
TEST_CASE("deserialize MsgPack object") {
|
||||
DynamicJsonDocument doc;
|
||||
DynamicJsonDocument doc(4096);
|
||||
|
||||
SECTION("fixmap") {
|
||||
SECTION("empty") {
|
||||
|
@ -7,22 +7,22 @@
|
||||
|
||||
template <typename T, typename U>
|
||||
static void check(const char* input, U expected) {
|
||||
DynamicJsonDocument variant;
|
||||
DynamicJsonDocument doc(4096);
|
||||
|
||||
DeserializationError error = deserializeMsgPack(variant, input);
|
||||
DeserializationError error = deserializeMsgPack(doc, input);
|
||||
|
||||
REQUIRE(error == DeserializationError::Ok);
|
||||
REQUIRE(variant.is<T>());
|
||||
REQUIRE(variant.as<T>() == expected);
|
||||
REQUIRE(doc.is<T>());
|
||||
REQUIRE(doc.as<T>() == expected);
|
||||
}
|
||||
|
||||
static void checkIsNull(const char* input) {
|
||||
DynamicJsonDocument variant;
|
||||
DynamicJsonDocument doc(4096);
|
||||
|
||||
DeserializationError error = deserializeMsgPack(variant, input);
|
||||
DeserializationError error = deserializeMsgPack(doc, input);
|
||||
|
||||
REQUIRE(error == DeserializationError::Ok);
|
||||
REQUIRE(variant.as<JsonVariant>().isNull());
|
||||
REQUIRE(doc.as<JsonVariant>().isNull());
|
||||
}
|
||||
|
||||
TEST_CASE("deserialize MsgPack value") {
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <catch.hpp>
|
||||
|
||||
DeserializationError deserialize(const char* input, size_t len) {
|
||||
DynamicJsonDocument doc;
|
||||
DynamicJsonDocument doc(4096);
|
||||
|
||||
return deserializeMsgPack(doc, input, len);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <catch.hpp>
|
||||
|
||||
TEST_CASE("deserializeMsgPack(const std::string&)") {
|
||||
DynamicJsonDocument doc;
|
||||
DynamicJsonDocument doc(4096);
|
||||
|
||||
SECTION("should accept const string") {
|
||||
const std::string input("\x92\x01\x02");
|
||||
@ -46,7 +46,7 @@ TEST_CASE("deserializeMsgPack(const std::string&)") {
|
||||
}
|
||||
|
||||
TEST_CASE("deserializeMsgPack(std::istream&)") {
|
||||
DynamicJsonDocument doc;
|
||||
DynamicJsonDocument doc(4096);
|
||||
|
||||
SECTION("should accept a zero in input") {
|
||||
std::istringstream input(std::string("\x92\x00\x02", 3));
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
static void check(const char* input, DeserializationError expected,
|
||||
uint8_t limit) {
|
||||
DynamicJsonDocument doc;
|
||||
DynamicJsonDocument doc(4096);
|
||||
doc.nestingLimit = limit;
|
||||
|
||||
DeserializationError error = deserializeMsgPack(doc, input);
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <catch.hpp>
|
||||
|
||||
static void checkNotSupported(const char* input) {
|
||||
DynamicJsonDocument doc;
|
||||
DynamicJsonDocument doc(4096);
|
||||
|
||||
DeserializationError error = deserializeMsgPack(doc, input);
|
||||
|
||||
|
Reference in New Issue
Block a user