ArduinoJSON 7.4.1

This commit is contained in:
iranl
2025-04-15 21:24:24 +02:00
parent ec5a05d6c9
commit 7c7dd8a7a9
365 changed files with 780 additions and 490 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include "src/ArduinoJson.h" #include "src/ArduinoJson.h"
+17
View File
@@ -1,6 +1,23 @@
ArduinoJson: change log ArduinoJson: change log
======================= =======================
v7.4.1 (2025-04-11)
------
* Fix crash with tiny Flash strings (issue #2170)
v7.4.0 (2025-04-09)
------
* Optimize storage of tiny strings (up to 3 characters)
* Fix support for `const char[]` (issue #2166)
v7.3.1 (2025-02-27)
------
* Fix conversion from static string to number
* Slightly reduce code size
v7.3.0 (2024-12-29) v7.3.0 (2024-12-29)
------ ------
+2 -2
View File
@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2024, Benoit BLANCHON # Copyright © 2014-2025, Benoit BLANCHON
# MIT License # MIT License
cmake_minimum_required(VERSION 3.15) cmake_minimum_required(VERSION 3.15)
@@ -10,7 +10,7 @@ if(ESP_PLATFORM)
return() return()
endif() endif()
project(ArduinoJson VERSION 7.3.0) project(ArduinoJson VERSION 7.4.1)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(CTest) include(CTest)
+1 -1
View File
@@ -1,7 +1,7 @@
The MIT License (MIT) The MIT License (MIT)
--------------------- ---------------------
Copyright © 2014-2024, Benoit BLANCHON Copyright © 2014-2025, Benoit BLANCHON
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+1 -1
View File
@@ -1,4 +1,4 @@
version: 7.3.0.{build} version: 7.4.1.{build}
environment: environment:
matrix: matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
// //
// This example shows how to store your project configuration in a file. // This example shows how to store your project configuration in a file.
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
// //
// This example shows how to use DeserializationOption::Filter // This example shows how to use DeserializationOption::Filter
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
// //
// This example shows how to generate a JSON document with ArduinoJson. // This example shows how to generate a JSON document with ArduinoJson.
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
// //
// This example shows how to parse a JSON document in an HTTP response. // This example shows how to parse a JSON document in an HTTP response.
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
// //
// This example shows how to deserialize a JSON document with ArduinoJson. // This example shows how to deserialize a JSON document with ArduinoJson.
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
// //
// This example shows how to implement an HTTP server that sends a JSON document // This example shows how to implement an HTTP server that sends a JSON document
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
// //
// This example shows how to send a JSON document to a UDP socket. // This example shows how to send a JSON document to a UDP socket.
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
// //
// This example shows how to deserialize a MessagePack document with // This example shows how to deserialize a MessagePack document with
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
// //
// This example shows the different ways you can use Flash strings with // This example shows the different ways you can use Flash strings with
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
// //
// This example shows the different ways you can use String with ArduinoJson. // This example shows the different ways you can use String with ArduinoJson.
@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2024, Benoit BLANCHON # Copyright © 2014-2025, Benoit BLANCHON
# MIT License # MIT License
cmake_minimum_required(VERSION 3.5) cmake_minimum_required(VERSION 3.5)
@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2024, Benoit BLANCHON # Copyright © 2014-2025, Benoit BLANCHON
# MIT License # MIT License
idf_component_register( idf_component_register(
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2024, Benoit BLANCHON # Copyright © 2014-2025, Benoit BLANCHON
# MIT License # MIT License
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD 11)
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
// This file is NOT use by Google's OSS fuzz // This file is NOT use by Google's OSS fuzz
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
// //
// This example shows how to generate a JSON document with ArduinoJson. // This example shows how to generate a JSON document with ArduinoJson.
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
// //
// This example shows how to deserialize a JSON document with ArduinoJson. // This example shows how to deserialize a JSON document with ArduinoJson.
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
// //
// This example shows how to generate a JSON document with ArduinoJson. // This example shows how to generate a JSON document with ArduinoJson.
+1 -1
View File
@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2024, Benoit BLANCHON # Copyright © 2014-2025, Benoit BLANCHON
# MIT License # MIT License
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD 11)
@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2024, Benoit BLANCHON # Copyright © 2014-2025, Benoit BLANCHON
# MIT License # MIT License
if(MSVC_VERSION LESS 1910) if(MSVC_VERSION LESS 1910)
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
// we expect ArduinoJson.h to include <string_view> // we expect ArduinoJson.h to include <string_view>
@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2024, Benoit BLANCHON # Copyright © 2014-2025, Benoit BLANCHON
# MIT License # MIT License
if(MSVC_VERSION LESS 1910) if(MSVC_VERSION LESS 1910)
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -46,7 +46,7 @@ TEST_CASE("BasicJsonDocument") {
deserializeJson(doc, "{\"hello\":\"world\"}"); deserializeJson(doc, "{\"hello\":\"world\"}");
REQUIRE(doc.as<std::string>() == "{\"hello\":\"world\"}"); REQUIRE(doc.as<std::string>() == "{\"hello\":\"world\"}");
doc.clear(); doc.clear();
REQUIRE(allocatorLog == "ARAARDDD"); REQUIRE(allocatorLog == "AARARDDD");
} }
SECTION("copy") { SECTION("copy") {
@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2024, Benoit BLANCHON # Copyright © 2014-2025, Benoit BLANCHON
# MIT License # MIT License
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2024, Benoit BLANCHON # Copyright © 2014-2025, Benoit BLANCHON
# MIT License # MIT License
macro(add_failing_build source_file) macro(add_failing_build source_file)
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#define ARDUINOJSON_USE_LONG_LONG 0 #define ARDUINOJSON_USE_LONG_LONG 0
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#define ARDUINOJSON_USE_LONG_LONG 0 #define ARDUINOJSON_USE_LONG_LONG 0
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#pragma once #pragma once
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#pragma once #pragma once
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#pragma once #pragma once
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#pragma once #pragma once
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#pragma once #pragma once
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#pragma once #pragma once
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#pragma once #pragma once
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#pragma once #pragma once
@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2024, Benoit BLANCHON # Copyright © 2014-2025, Benoit BLANCHON
# MIT License # MIT License
add_executable(IntegrationTests add_executable(IntegrationTests
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2024, Benoit BLANCHON # Copyright © 2014-2025, Benoit BLANCHON
# MIT License # MIT License
add_executable(JsonArrayTests add_executable(JsonArrayTests
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2024, Benoit BLANCHON # Copyright © 2014-2025, Benoit BLANCHON
# MIT License # MIT License
add_executable(JsonArrayConstTests add_executable(JsonArrayConstTests
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2024, Benoit BLANCHON # Copyright © 2014-2025, Benoit BLANCHON
# MIT License # MIT License
add_executable(JsonDeserializerTests add_executable(JsonDeserializerTests
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#define ARDUINOJSON_DECODE_UNICODE 1 #define ARDUINOJSON_DECODE_UNICODE 1
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#define ARDUINOJSON_ENABLE_COMMENTS 1 #define ARDUINOJSON_ENABLE_COMMENTS 1
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -26,8 +26,8 @@ TEST_CASE("deserializeJson(char*)") {
REQUIRE(spy.log() == REQUIRE(spy.log() ==
AllocatorLog{ AllocatorLog{
Allocate(sizeofStringBuffer()), Allocate(sizeofStringBuffer()),
Reallocate(sizeofStringBuffer(), sizeofString("hello")),
Allocate(sizeofPool()), Allocate(sizeofPool()),
Reallocate(sizeofStringBuffer(), sizeofString("hello")),
Allocate(sizeofStringBuffer()), Allocate(sizeofStringBuffer()),
Reallocate(sizeofStringBuffer(), sizeofString("world")), Reallocate(sizeofStringBuffer(), sizeofString("world")),
Reallocate(sizeofPool(), sizeofObject(1)), Reallocate(sizeofPool(), sizeofObject(1)),
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#define ARDUINOJSON_USE_LONG_LONG 0 #define ARDUINOJSON_USE_LONG_LONG 0
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -292,22 +292,23 @@ TEST_CASE("deserialize JSON object") {
} }
SECTION("Repeated key") { SECTION("Repeated key") {
DeserializationError err = deserializeJson(doc, "{a:{b:{c:1}},a:2}"); DeserializationError err =
deserializeJson(doc, "{alfa:{bravo:{charlie:1}},alfa:2}");
REQUIRE(err == DeserializationError::Ok); REQUIRE(err == DeserializationError::Ok);
REQUIRE(doc.as<std::string>() == "{\"a\":2}"); REQUIRE(doc.as<std::string>() == "{\"alfa\":2}");
REQUIRE(spy.log() == REQUIRE(spy.log() ==
AllocatorLog{ AllocatorLog{
Allocate(sizeofStringBuffer()), Allocate(sizeofStringBuffer()),
Reallocate(sizeofStringBuffer(), sizeofString("a")),
Allocate(sizeofPool()), Allocate(sizeofPool()),
Reallocate(sizeofStringBuffer(), sizeofString("alfa")),
Allocate(sizeofStringBuffer()), Allocate(sizeofStringBuffer()),
Reallocate(sizeofStringBuffer(), sizeofString("b")), Reallocate(sizeofStringBuffer(), sizeofString("bravo")),
Allocate(sizeofStringBuffer()), Allocate(sizeofStringBuffer()),
Reallocate(sizeofStringBuffer(), sizeofString("c")), Reallocate(sizeofStringBuffer(), sizeofString("charlie")),
Allocate(sizeofStringBuffer()), Allocate(sizeofStringBuffer()),
Deallocate(sizeofString("b")), Deallocate(sizeofString("bravo")),
Deallocate(sizeofString("c")), Deallocate(sizeofString("charlie")),
Deallocate(sizeofStringBuffer()), Deallocate(sizeofStringBuffer()),
Reallocate(sizeofPool(), sizeofObject(2) + sizeofObject(1)), Reallocate(sizeofPool(), sizeofObject(2) + sizeofObject(1)),
}); });
@@ -378,7 +379,7 @@ TEST_CASE("deserialize JSON object under memory constraints") {
} }
SECTION("pool allocation fails") { SECTION("pool allocation fails") {
timebomb.setCountdown(2); timebomb.setCountdown(1);
char input[] = "{\"a\":1}"; char input[] = "{\"a\":1}";
DeserializationError err = deserializeJson(doc, input); DeserializationError err = deserializeJson(doc, input);
@@ -389,11 +390,11 @@ TEST_CASE("deserialize JSON object under memory constraints") {
SECTION("string allocation fails") { SECTION("string allocation fails") {
timebomb.setCountdown(3); timebomb.setCountdown(3);
char input[] = "{\"a\":\"b\"}"; char input[] = "{\"alfa\":\"bravo\"}";
DeserializationError err = deserializeJson(doc, input); DeserializationError err = deserializeJson(doc, input);
REQUIRE(err == DeserializationError::NoMemory); REQUIRE(err == DeserializationError::NoMemory);
REQUIRE(doc.as<std::string>() == "{\"a\":null}"); REQUIRE(doc.as<std::string>() == "{\"alfa\":null}");
} }
} }
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#define ARDUINOJSON_DECODE_UNICODE 1 #define ARDUINOJSON_DECODE_UNICODE 1
@@ -133,8 +133,8 @@ TEST_CASE("Allocation of the key fails") {
REQUIRE(spy.log() == REQUIRE(spy.log() ==
AllocatorLog{ AllocatorLog{
Allocate(sizeofStringBuffer()), Allocate(sizeofStringBuffer()),
Reallocate(sizeofStringBuffer(), sizeofString("hello")),
Allocate(sizeofPool()), Allocate(sizeofPool()),
Reallocate(sizeofStringBuffer(), sizeofString("hello")),
AllocateFail(sizeofStringBuffer()), AllocateFail(sizeofStringBuffer()),
ReallocateFail(sizeofPool(), sizeofObject(1)), ReallocateFail(sizeofPool(), sizeofObject(1)),
}); });
@@ -155,8 +155,8 @@ TEST_CASE("Allocation of the key fails") {
REQUIRE(spy.log() == REQUIRE(spy.log() ==
AllocatorLog{ AllocatorLog{
Allocate(sizeofStringBuffer()), Allocate(sizeofStringBuffer()),
Reallocate(sizeofStringBuffer(), sizeofString("hello")),
Allocate(sizeofPool()), Allocate(sizeofPool()),
Reallocate(sizeofStringBuffer(), sizeofString("hello")),
AllocateFail(sizeofStringBuffer()), AllocateFail(sizeofStringBuffer()),
ReallocateFail(sizeofPool(), sizeofObject(1)), ReallocateFail(sizeofPool(), sizeofObject(1)),
}); });
@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2024, Benoit BLANCHON # Copyright © 2014-2025, Benoit BLANCHON
# MIT License # MIT License
add_executable(JsonDocumentTests add_executable(JsonDocumentTests
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#define ARDUINOJSON_ENABLE_ARDUINO_STRING 1 #define ARDUINOJSON_ENABLE_ARDUINO_STRING 1
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#define ARDUINOJSON_ENABLE_ARDUINO_STRING 1 #define ARDUINOJSON_ENABLE_ARDUINO_STRING 1
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2024, Benoit BLANCHON // Copyright © 2014-2025, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

Some files were not shown because too many files have changed in this diff Show More