Increased default nesting limit to 50 when compiled for a computer (issue #349)

This commit is contained in:
Benoit Blanchon
2016-09-21 22:11:38 +02:00
parent bb805e93cb
commit e6f55b1f6f
4 changed files with 33 additions and 8 deletions

View File

@ -5,12 +5,14 @@
// https://github.com/bblanchon/ArduinoJson
// If you like this project, please add a star!
#include <gtest/gtest.h>
#include <ArduinoJson.h>
#include <gtest/gtest.h>
class JsonParser_Array_Tests : public testing::Test {
protected:
void whenInputIs(const char *json) { strcpy(_jsonString, json); }
void whenInputIs(const char *json) {
strcpy(_jsonString, json);
}
void whenInputIs(const char *json, size_t len) {
memcpy(_jsonString, json, len);
@ -27,7 +29,9 @@ class JsonParser_Array_Tests : public testing::Test {
EXPECT_EQ(0, _array->size());
}
void sizeMustBe(int expected) { ASSERT_EQ(expected, _array->size()); }
void sizeMustBe(int expected) {
ASSERT_EQ(expected, _array->size());
}
template <typename T>
void firstElementMustBe(T expected) {
@ -346,3 +350,8 @@ TEST_F(JsonParser_Array_Tests, UnfinishedCComment) {
whenInputIs("[/*COMMENT]");
parseMustFail();
}
TEST_F(JsonParser_Array_Tests, DeeplyNested) {
whenInputIs("[[[[[[[[[[[[[[[[[[[\"Not too deep\"]]]]]]]]]]]]]]]]]]]");
parseMustSucceed();
}