update ArduinoJson

This commit is contained in:
technyon
2023-03-11 11:11:14 +01:00
parent d134dc9aab
commit 7576244142
368 changed files with 17459 additions and 11509 deletions

View File

@@ -1,6 +1,6 @@
#pragma once #pragma once
#define NUKI_HUB_VERSION "8.17" #define NUKI_HUB_VERSION "8.18-pre-1"
#define MQTT_QOS_LEVEL 1 #define MQTT_QOS_LEVEL 1
#define MQTT_CLEAN_SESSIONS false #define MQTT_CLEAN_SESSIONS false

View File

@@ -1,12 +0,0 @@
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
BasedOnStyle: Google
Standard: Cpp03
AllowShortFunctionsOnASingleLine: Empty
IncludeBlocks: Preserve
IndentPPDirectives: AfterHash
DerivePointerAlignment: false
# Always break after if to get accurate coverage
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false

View File

@@ -1,3 +0,0 @@
.github/
examples/
extras/

View File

@@ -1 +0,0 @@
*.md

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include "src/ArduinoJson.h" #include "src/ArduinoJson.h"

View File

@@ -4,6 +4,12 @@ ArduinoJson: change log
HEAD HEAD
---- ----
* Drop support for C++98/C++03. Minimum required is C++11.
* Remove `ARDUINOJSON_NAMESPACE`; use `ArduinoJson` instead.
v6.20.1 (2023-02-08)
-------
* Remove explicit exclusion of `as<char*>()` and `as<char>()` (issue #1860) * Remove explicit exclusion of `as<char*>()` and `as<char>()` (issue #1860)
If you try to call them, you'll now get the same error message as any unsupported type. If you try to call them, you'll now get the same error message as any unsupported type.
You could also add a custom converter for `char*` and `char`. You could also add a custom converter for `char*` and `char`.

View File

@@ -1,19 +1,19 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2022, Benoit BLANCHON # Copyright © 2014-2023, Benoit BLANCHON
# MIT License # MIT License
cmake_minimum_required(VERSION 3.15) cmake_minimum_required(VERSION 3.15)
if(ESP_PLATFORM) if(ESP_PLATFORM)
# Build ArduinoJson as an ESP-IDF component # Build ArduinoJson as an ESP-IDF component
idf_component_register(INCLUDE_DIRS src) idf_component_register(INCLUDE_DIRS src)
return() return()
endif() endif()
project(ArduinoJson VERSION 6.20.0) project(ArduinoJson VERSION 6.20.1)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(CTest) include(CTest)
endif() endif()
add_subdirectory(src) add_subdirectory(src)

View File

@@ -1,7 +1,7 @@
The MIT License (MIT) The MIT License (MIT)
--------------------- ---------------------
Copyright © 2014-2022, Benoit BLANCHON Copyright © 2014-2023, 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:

View File

@@ -1,5 +1,5 @@
<p align="center"> <p align="center">
<a href="https://arduinojson.org/"><img alt="ArduinoJson" src="https://arduinojson.org/images/logo.svg" /></a> <a href="https://arduinojson.org/"><img alt="ArduinoJson" src="https://arduinojson.org/images/logo.svg" width="200" /></a>
</p> </p>
--- ---
@@ -8,9 +8,9 @@
[![Continuous Integration](https://ci.appveyor.com/api/projects/status/m7s53wav1l0abssg/branch/6.x?svg=true)](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x) [![Continuous Integration](https://ci.appveyor.com/api/projects/status/m7s53wav1l0abssg/branch/6.x?svg=true)](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x)
[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/arduinojson.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson) [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/arduinojson.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson)
[![Coveralls branch](https://img.shields.io/coveralls/github/bblanchon/ArduinoJson/6.x?logo=coveralls)](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x) [![Coveralls branch](https://img.shields.io/coveralls/github/bblanchon/ArduinoJson/6.x?logo=coveralls)](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x)
[![Arduino Library Manager](https://img.shields.io/static/v1?label=Arduino&message=v6.20.0&logo=arduino&logoColor=white&color=blue)](https://www.ardu-badge.com/ArduinoJson/6.20.0) [![Arduino Library Manager](https://img.shields.io/static/v1?label=Arduino&message=v6.20.1&logo=arduino&logoColor=white&color=blue)](https://www.ardu-badge.com/ArduinoJson/6.20.1)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/bblanchon/library/ArduinoJson.svg?version=6.20.0)](https://registry.platformio.org/packages/libraries/bblanchon/ArduinoJson?version=6.20.0) [![PlatformIO Registry](https://badges.registry.platformio.org/packages/bblanchon/library/ArduinoJson.svg?version=6.20.1)](https://registry.platformio.org/packages/libraries/bblanchon/ArduinoJson?version=6.20.1)
[![ESP IDF](https://img.shields.io/static/v1?label=ESP+IDF&message=v6.20.0&logo=cpu&logoColor=white&color=blue)](https://components.espressif.com/components/bblanchon/arduinojson) [![ESP IDF](https://img.shields.io/static/v1?label=ESP+IDF&message=v6.20.1&logo=cpu&logoColor=white&color=blue)](https://components.espressif.com/components/bblanchon/arduinojson)
[![GitHub stars](https://img.shields.io/github/stars/bblanchon/ArduinoJson?style=flat&logo=github&color=orange)](https://github.com/bblanchon/ArduinoJson/stargazers) [![GitHub stars](https://img.shields.io/github/stars/bblanchon/ArduinoJson?style=flat&logo=github&color=orange)](https://github.com/bblanchon/ArduinoJson/stargazers)
[![GitHub Sponsors](https://img.shields.io/github/sponsors/bblanchon?logo=github&color=orange)](https://github.com/sponsors/bblanchon) [![GitHub Sponsors](https://img.shields.io/github/sponsors/bblanchon?logo=github&color=orange)](https://github.com/sponsors/bblanchon)
@@ -46,7 +46,8 @@ ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things).
* Supports [custom converters](https://arduinojson.org/news/2021/05/04/version-6-18-0/) * Supports [custom converters](https://arduinojson.org/news/2021/05/04/version-6-18-0/)
* Portable * Portable
* Usable on any C++ project (not limited to Arduino) * Usable on any C++ project (not limited to Arduino)
* Compatible with C++98, C++11, C++14 and C++17 * Compatible with C++11, C++14 and C++17
* Support for C++98/C++03 available on [ArduinoJson 6.20.x](https://github.com/bblanchon/ArduinoJson/tree/6.20.x)
* Zero warnings with `-Wall -Wextra -pedantic` and `/W4` * Zero warnings with `-Wall -Wextra -pedantic` and `/W4`
* [Header-only library](https://en.wikipedia.org/wiki/Header-only) * [Header-only library](https://en.wikipedia.org/wiki/Header-only)
* Works with virtually any board * Works with virtually any board
@@ -83,9 +84,9 @@ ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things).
* Well tested * Well tested
* [Unit test coverage close to 100%](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x) * [Unit test coverage close to 100%](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x)
* Continuously tested on * Continuously tested on
* [Visual Studio 2010, 2012, 2013, 2015, 2017, 2019, 2022](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x) * [Visual Studio 2017, 2019, 2022](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x)
* [GCC 4.4, 4.6, 4.7, 4.8, 4.9, 5, 6, 7, 8, 9, 10, 11](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22) * [GCC 6, 7, 8, 9, 10, 11](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22)
* [Clang 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 5.0, 6.0, 7, 8, 9, 10](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22) * [Clang 3.8, 3.9, 4.0, 5.0, 6.0, 7, 8, 9, 10](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22)
* [Continuously fuzzed with Google OSS Fuzz](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson) * [Continuously fuzzed with Google OSS Fuzz](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson)
* Passes all default checks of [clang-tidy](https://releases.llvm.org/10.0.0/tools/clang/tools/extra/docs/clang-tidy/) * Passes all default checks of [clang-tidy](https://releases.llvm.org/10.0.0/tools/clang/tools/extra/docs/clang-tidy/)
* Well documented * Well documented

View File

@@ -1,4 +1,4 @@
version: 6.20.0.{build} version: 6.20.1.{build}
environment: environment:
matrix: matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
@@ -7,15 +7,6 @@ environment:
CMAKE_GENERATOR: Visual Studio 16 2019 CMAKE_GENERATOR: Visual Studio 16 2019
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CMAKE_GENERATOR: Visual Studio 15 2017 CMAKE_GENERATOR: Visual Studio 15 2017
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
CMAKE_GENERATOR: Visual Studio 14 2015
- CMAKE_GENERATOR: Visual Studio 12 2013
- CMAKE_GENERATOR: Visual Studio 11 2012
- CMAKE_GENERATOR: Visual Studio 10 2010
- CMAKE_GENERATOR: Ninja
MINGW: MinGW # MinGW 32-bit 5.3.0
- CMAKE_GENERATOR: Ninja
MINGW32: i686-5.3.0-posix-dwarf-rt_v4-rev0 # MinGW-w64 5.3.0
- CMAKE_GENERATOR: Ninja - CMAKE_GENERATOR: Ninja
MINGW32: i686-6.3.0-posix-dwarf-rt_v5-rev1 # MinGW-w64 6.3.0 i686 MINGW32: i686-6.3.0-posix-dwarf-rt_v5-rev1 # MinGW-w64 6.3.0 i686
- CMAKE_GENERATOR: Ninja - CMAKE_GENERATOR: Ninja

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, 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.

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
// //
// This example shows how to use DeserializationOption::Filter // This example shows how to use DeserializationOption::Filter

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, 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.

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, 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.

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, 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.
@@ -18,7 +18,8 @@ void setup() {
// Inside the brackets, 200 is the capacity of the memory pool in bytes. // Inside the brackets, 200 is the capacity of the memory pool in bytes.
// Don't forget to change this value to match your JSON document. // Don't forget to change this value to match your JSON document.
// Use https://arduinojson.org/v6/assistant to compute the capacity. // Use https://arduinojson.org/v6/assistant to compute the capacity.
c StaticJsonDocument<200> doc;
// StaticJsonDocument<N> allocates memory on the stack, it can be // StaticJsonDocument<N> allocates memory on the stack, it can be
// replaced by DynamicJsonDocument which allocates in the heap. // replaced by DynamicJsonDocument which allocates in the heap.
// //

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, 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

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, 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.

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, 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

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, 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

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, 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.

View File

@@ -27,11 +27,10 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
if(${COVERAGE}) if(${COVERAGE})
set(CMAKE_CXX_FLAGS "-fprofile-arcs -ftest-coverage") set(CMAKE_CXX_FLAGS "-fprofile-arcs -ftest-coverage")
endif() endif()
endif() endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.8) AND (NOT ${COVERAGE})) if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.8) AND(NOT ${COVERAGE}))
add_compile_options(-g -Og) add_compile_options(-g -Og)
else() else()
add_compile_options(-g -O0) add_compile_options(-g -O0)
@@ -65,7 +64,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif() endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.0) AND (NOT ${COVERAGE})) if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.0) AND(NOT ${COVERAGE}))
add_compile_options(-g -Og) add_compile_options(-g -Og)
else() else()
add_compile_options(-g -O0) add_compile_options(-g -O0)
@@ -73,7 +72,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
endif() endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0) AND (NOT ${COVERAGE})) if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0) AND(NOT ${COVERAGE}))
add_compile_options(-g -Og) add_compile_options(-g -Og)
else() else()
add_compile_options(-g -O0) add_compile_options(-g -O0)
@@ -85,17 +84,12 @@ if(MSVC)
add_compile_options( add_compile_options(
/W4 # Set warning level /W4 # Set warning level
/WX # Treats all compiler warnings as errors. /WX # Treats all compiler warnings as errors.
/Zc:__cplusplus # Enable updated __cplusplus macro
) )
if (NOT MSVC_VERSION LESS 1910) # >= Visual Studio 2017
add_compile_options(
/Zc:__cplusplus # Enable updated __cplusplus macro
)
endif()
endif() endif()
if(MINGW) if(MINGW)
# Static link on MinGW to avoid linking with the wrong DLLs when multiple # Static link on MinGW to avoid linking with the wrong DLLs when multiple
# versions are installed. # versions are installed.
add_link_options(-static) add_link_options(-static)
endif() endif()

View File

@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2022, Benoit BLANCHON # Copyright © 2014-2023, Benoit BLANCHON
# MIT License # MIT License
cmake_minimum_required(VERSION 3.5) cmake_minimum_required(VERSION 3.5)

View File

@@ -1,6 +1,8 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2022, Benoit BLANCHON # Copyright © 2014-2023, Benoit BLANCHON
# MIT License # MIT License
idf_component_register(SRCS "main.cpp" idf_component_register(
INCLUDE_DIRS "") SRCS "main.cpp"
INCLUDE_DIRS ""
)

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -9,7 +9,7 @@ static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN");
static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE"); static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE");
static_assert(sizeof(ARDUINOJSON_NAMESPACE::VariantSlot) == 8, static_assert(sizeof(ArduinoJson::detail::VariantSlot) == 8,
"sizeof(VariantSlot)"); "sizeof(VariantSlot)");
void setup() {} void setup() {}

View File

@@ -9,7 +9,7 @@ static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN");
static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE"); static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE");
static_assert(sizeof(ARDUINOJSON_NAMESPACE::VariantSlot) == 16, static_assert(sizeof(ArduinoJson::detail::VariantSlot) == 16,
"sizeof(VariantSlot)"); "sizeof(VariantSlot)");
void setup() {} void setup() {}

View File

@@ -9,7 +9,7 @@ static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN");
static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE"); static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE");
static_assert(sizeof(ARDUINOJSON_NAMESPACE::VariantSlot) == 32, static_assert(sizeof(ArduinoJson::detail::VariantSlot) == 32,
"sizeof(VariantSlot)"); "sizeof(VariantSlot)");
int main() {} int main() {}

View File

@@ -9,7 +9,7 @@ static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN");
static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE"); static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE");
static_assert(sizeof(ARDUINOJSON_NAMESPACE::VariantSlot) == 16, static_assert(sizeof(ArduinoJson::detail::VariantSlot) == 16,
"sizeof(VariantSlot)"); "sizeof(VariantSlot)");
int main() {} int main() {}

View File

@@ -1,7 +1,10 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2022, Benoit BLANCHON # Copyright © 2014-2023, Benoit BLANCHON
# MIT License # MIT License
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(MSVC) if(MSVC)
add_compile_options(-D_CRT_SECURE_NO_WARNINGS) add_compile_options(-D_CRT_SECURE_NO_WARNINGS)
endif() endif()
@@ -22,7 +25,7 @@ target_link_libraries(json_reproducer
ArduinoJson ArduinoJson
) )
macro(add_fuzzer name) macro(add_fuzzer name)
set(FUZZER "${name}_fuzzer") set(FUZZER "${name}_fuzzer")
set(CORPUS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${name}_corpus") set(CORPUS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${name}_corpus")
set(SEED_CORPUS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${name}_seed_corpus") set(SEED_CORPUS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${name}_seed_corpus")
@@ -33,27 +36,23 @@ macro(add_fuzzer name)
ArduinoJson ArduinoJson
) )
set_target_properties("${FUZZER}" set_target_properties("${FUZZER}"
PROPERTIES PROPERTIES
COMPILE_FLAGS COMPILE_FLAGS "-fprofile-instr-generate -fcoverage-mapping -fsanitize=fuzzer -fno-sanitize-recover=all"
"-fprofile-instr-generate -fcoverage-mapping -fsanitize=fuzzer -fno-sanitize-recover=all" LINK_FLAGS "-fprofile-instr-generate -fcoverage-mapping -fsanitize=fuzzer -fno-sanitize-recover=all"
LINK_FLAGS
"-fprofile-instr-generate -fcoverage-mapping -fsanitize=fuzzer -fno-sanitize-recover=all"
) )
add_test( add_test(
NAME NAME "${FUZZER}"
"${FUZZER}" COMMAND "${FUZZER}" "${CORPUS_DIR}" "${SEED_CORPUS_DIR}" -max_total_time=5 -timeout=1
COMMAND
"${FUZZER}" "${CORPUS_DIR}" "${SEED_CORPUS_DIR}" -max_total_time=5 -timeout=1
) )
set_tests_properties("${FUZZER}" set_tests_properties("${FUZZER}"
PROPERTIES PROPERTIES
LABELS "Fuzzing" LABELS "Fuzzing"
) )
endmacro() endmacro()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6) if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6)
add_fuzzer(json) add_fuzzer(json)
add_fuzzer(msgpack) add_fuzzer(msgpack)
endif() endif()

View File

@@ -1,6 +1,6 @@
# CAUTION: this file is invoked by https://github.com/google/oss-fuzz # CAUTION: this file is invoked by https://github.com/google/oss-fuzz
CXXFLAGS += -I../../src -DARDUINOJSON_DEBUG=1 CXXFLAGS += -I../../src -DARDUINOJSON_DEBUG=1 -std=c++11
all: \ all: \
$(OUT)/json_fuzzer \ $(OUT)/json_fuzzer \

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, 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

View File

@@ -18,6 +18,6 @@ rm -f "$OUTPUT"
src \ src \
keywords.txt \ keywords.txt \
library.properties \ library.properties \
LICENSE.md \ LICENSE.txt \
README.md \ README.md \
ArduinoJson.h ArduinoJson.h

View File

@@ -53,7 +53,8 @@ process()
} }
simplify_namespaces() { simplify_namespaces() {
perl -p0i -e 's|\} // namespace ARDUINOJSON_NAMESPACE\r?\nnamespace ARDUINOJSON_NAMESPACE \{\r?\n||igs' "$1" perl -p0i -e 's|ARDUINOJSON_END_PUBLIC_NAMESPACE\r?\nARDUINOJSON_BEGIN_PUBLIC_NAMESPACE\r?\n||igs' "$1"
perl -p0i -e 's|ARDUINOJSON_END_PRIVATE_NAMESPACE\r?\nARDUINOJSON_BEGIN_PRIVATE_NAMESPACE\r?\n||igs' "$1"
rm -f "$1.bak" rm -f "$1.bak"
} }

View File

@@ -9,7 +9,7 @@ trap 'rm -rf "$WORK_DIR"' EXIT
cp "$SOURCE_DIR/README.md" "$WORK_DIR/README.md" cp "$SOURCE_DIR/README.md" "$WORK_DIR/README.md"
cp "$SOURCE_DIR/CHANGELOG.md" "$WORK_DIR/CHANGELOG.md" cp "$SOURCE_DIR/CHANGELOG.md" "$WORK_DIR/CHANGELOG.md"
cp "$SOURCE_DIR/library.properties" "$WORK_DIR/library.properties" cp "$SOURCE_DIR/library.properties" "$WORK_DIR/library.properties"
cp "$SOURCE_DIR/LICENSE.md" "$WORK_DIR/LICENSE.txt" cp "$SOURCE_DIR/LICENSE.txt" "$WORK_DIR/LICENSE.txt"
cp -r "$SOURCE_DIR/src" "$WORK_DIR/" cp -r "$SOURCE_DIR/src" "$WORK_DIR/"
cp -r "$SOURCE_DIR/examples" "$WORK_DIR/" cp -r "$SOURCE_DIR/examples" "$WORK_DIR/"

View File

@@ -51,7 +51,7 @@ update_version_in_source () {
} }
commit_new_version () { commit_new_version () {
git add src/ArduinoJson/version.hpp README.md CHANGELOG.md library.json library.properties appveyor.yml CMakeLists.txt git add src/ArduinoJson/version.hpp README.md CHANGELOG.md library.json library.properties appveyor.yml CMakeLists.txt idf_component.yml
git commit -m "Set version to $VERSION" git commit -m "Set version to $VERSION"
} }

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, 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.

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, 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.

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, 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.

View File

@@ -1,8 +1,8 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2022, Benoit BLANCHON # Copyright © 2014-2023, Benoit BLANCHON
# MIT License # MIT License
set(CMAKE_CXX_STANDARD 98) set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_subdirectory(catch) add_subdirectory(catch)
@@ -10,7 +10,6 @@ add_subdirectory(catch)
link_libraries(ArduinoJson catch) link_libraries(ArduinoJson catch)
include_directories(Helpers) include_directories(Helpers)
add_subdirectory(Cpp11)
add_subdirectory(Cpp17) add_subdirectory(Cpp17)
add_subdirectory(Cpp20) add_subdirectory(Cpp20)
add_subdirectory(FailingBuilds) add_subdirectory(FailingBuilds)

View File

@@ -1,36 +0,0 @@
# ArduinoJson - https://arduinojson.org
# Copyright © 2014-2022, Benoit BLANCHON
# MIT License
if("cxx_nullptr" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
list(APPEND SOURCES nullptr.cpp)
add_definitions(-DARDUINOJSON_HAS_NULLPTR=1)
endif()
if("cxx_auto_type" IN_LIST CMAKE_CXX_COMPILE_FEATURES AND "cxx_constexpr" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
list(APPEND SOURCES issue1120.cpp)
endif()
if("cxx_long_long_type" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
list(APPEND SOURCES use_long_long_0.cpp use_long_long_1.cpp)
endif()
if("cxx_range_for" IN_LIST CMAKE_CXX_COMPILE_FEATURES AND "cxx_generalized_initializers" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
list(APPEND SOURCES stl_containers.cpp)
endif()
if(NOT SOURCES)
return()
endif()
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable(Cpp11Tests ${SOURCES})
add_test(Cpp11 Cpp11Tests)
set_tests_properties(Cpp11
PROPERTIES
LABELS "Catch"
)

View File

@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2022, Benoit BLANCHON # Copyright © 2014-2023, Benoit BLANCHON
# MIT License # MIT License
if(MSVC_VERSION LESS 1910) if(MSVC_VERSION LESS 1910)
@@ -25,5 +25,5 @@ add_test(Cpp17 Cpp17Tests)
set_tests_properties(Cpp17 set_tests_properties(Cpp17
PROPERTIES PROPERTIES
LABELS "Catch" LABELS "Catch"
) )

View File

@@ -1,6 +1,6 @@
#include <ArduinoJson.h> #include <ArduinoJson.h>
#include <catch.hpp> #include <catch.hpp>
#include <string_view> #include <string_view>
#if !ARDUINOJSON_ENABLE_STRING_VIEW #if !ARDUINOJSON_ENABLE_STRING_VIEW
@@ -86,7 +86,7 @@ TEST_CASE("string_view") {
} }
} }
using ARDUINOJSON_NAMESPACE::adaptString; using ArduinoJson::detail::adaptString;
TEST_CASE("StringViewAdapter") { TEST_CASE("StringViewAdapter") {
std::string_view str("bravoXXX", 5); std::string_view str("bravoXXX", 5);

View File

@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2022, Benoit BLANCHON # Copyright © 2014-2023, Benoit BLANCHON
# MIT License # MIT License
if(MSVC_VERSION LESS 1910) if(MSVC_VERSION LESS 1910)
@@ -25,5 +25,5 @@ add_test(Cpp20 Cpp20Tests)
set_tests_properties(Cpp20 set_tests_properties(Cpp20
PROPERTIES PROPERTIES
LABELS "Catch" LABELS "Catch"
) )

View File

@@ -1,29 +1,25 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2022, Benoit BLANCHON # Copyright © 2014-2023, Benoit BLANCHON
# MIT License # MIT License
macro(build_should_fail target) macro(build_should_fail target)
set_target_properties(${target} set_target_properties(${target}
PROPERTIES PROPERTIES
EXCLUDE_FROM_ALL TRUE EXCLUDE_FROM_ALL TRUE
EXCLUDE_FROM_DEFAULT_BUILD TRUE EXCLUDE_FROM_DEFAULT_BUILD TRUE
) )
add_test( add_test(
NAME NAME ${target}
${target} COMMAND ${CMAKE_COMMAND} --build . --target ${target} --config $<CONFIGURATION>
COMMAND WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
${CMAKE_COMMAND} --build . --target ${target} --config $<CONFIGURATION>
WORKING_DIRECTORY
${CMAKE_BINARY_DIR}
) )
set_tests_properties(${target} set_tests_properties(${target}
PROPERTIES PROPERTIES
WILL_FAIL TRUE WILL_FAIL TRUE
LABELS "WillFail;Catch" LABELS "WillFail;Catch"
) )
endmacro() endmacro()
add_executable(Issue978 Issue978.cpp) add_executable(Issue978 Issue978.cpp)
build_should_fail(Issue978) build_should_fail(Issue978)
@@ -31,11 +27,9 @@ add_executable(Issue1189 Issue1189.cpp)
build_should_fail(Issue1189) build_should_fail(Issue1189)
add_executable(read_long_long read_long_long.cpp) add_executable(read_long_long read_long_long.cpp)
set_property(TARGET read_long_long PROPERTY CXX_STANDARD 11)
build_should_fail(read_long_long) build_should_fail(read_long_long)
add_executable(write_long_long write_long_long.cpp) add_executable(write_long_long write_long_long.cpp)
set_property(TARGET write_long_long PROPERTY CXX_STANDARD 11)
build_should_fail(write_long_long) build_should_fail(write_long_long)
add_executable(delete_jsondocument delete_jsondocument.cpp) add_executable(delete_jsondocument delete_jsondocument.cpp)

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#define ARDUINOJSON_USE_LONG_LONG 0 #define ARDUINOJSON_USE_LONG_LONG 0
@@ -9,10 +9,6 @@
# error This test requires sizeof(long) < 8 # error This test requires sizeof(long) < 8
#endif #endif
#if !ARDUINOJSON_HAS_LONG_LONG
# error This test requires C++11
#endif
ARDUINOJSON_ASSERT_INTEGER_TYPE_IS_SUPPORTED(long long) ARDUINOJSON_ASSERT_INTEGER_TYPE_IS_SUPPORTED(long long)
int main() { int main() {
DynamicJsonDocument doc(1024); DynamicJsonDocument doc(1024);

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#define ARDUINOJSON_USE_LONG_LONG 0 #define ARDUINOJSON_USE_LONG_LONG 0
@@ -9,10 +9,6 @@
# error This test requires sizeof(long) < 8 # error This test requires sizeof(long) < 8
#endif #endif
#if !ARDUINOJSON_HAS_LONG_LONG
# error This test requires C++11
#endif
int main() { int main() {
DynamicJsonDocument doc(1024); DynamicJsonDocument doc(1024);
doc["dummy"] = static_cast<long long>(42); doc["dummy"] = static_cast<long long>(42);

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#pragma once #pragma once
@@ -11,6 +11,7 @@ class CustomReader {
public: public:
CustomReader(const char* input) : _stream(input) {} CustomReader(const char* input) : _stream(input) {}
CustomReader(const CustomReader&) = delete;
int read() { int read() {
return _stream.get(); return _stream.get();
@@ -20,7 +21,4 @@ class CustomReader {
_stream.read(buffer, static_cast<std::streamsize>(length)); _stream.read(buffer, static_cast<std::streamsize>(length));
return static_cast<size_t>(_stream.gcount()); return static_cast<size_t>(_stream.gcount());
} }
private:
CustomReader(const CustomReader&);
}; };

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#pragma once #pragma once

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <stdint.h> // uint8_t #include <stdint.h> // uint8_t
@@ -23,7 +23,7 @@ inline uint8_t pgm_read_byte(const void* p) {
return *reinterpret_cast<const uint8_t*>(convertFlashToPtr(p)); return *reinterpret_cast<const uint8_t*>(convertFlashToPtr(p));
} }
#define ARDUINOJSON_DEFINE_PROGMEM_ARRAY(type, name, value) \ #define ARDUINOJSON_DEFINE_PROGMEM_ARRAY(type, name, ...) \
static type const ARDUINOJSON_CONCAT2(name, _progmem)[] = value; \ static type const ARDUINOJSON_CONCAT2(name, _progmem)[] = __VA_ARGS__; \
static type const* name = reinterpret_cast<type const*>( \ static type const* name = reinterpret_cast<type const*>( \
convertPtrToFlash(ARDUINOJSON_CONCAT2(name, _progmem))); convertPtrToFlash(ARDUINOJSON_CONCAT2(name, _progmem)));

View File

@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2022, Benoit BLANCHON # Copyright © 2014-2023, Benoit BLANCHON
# MIT License # MIT License
add_executable(IntegrationTests add_executable(IntegrationTests
@@ -12,7 +12,7 @@ add_executable(IntegrationTests
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
target_compile_options(IntegrationTests target_compile_options(IntegrationTests
PUBLIC PUBLIC
-fsingle-precision-constant # issue 544 -fsingle-precision-constant # issue 544
) )
endif() endif()
@@ -20,5 +20,5 @@ add_test(IntegrationTests IntegrationTests)
set_tests_properties(IntegrationTests set_tests_properties(IntegrationTests
PROPERTIES PROPERTIES
LABELS "Catch" LABELS "Catch"
) )

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2022, Benoit BLANCHON # Copyright © 2014-2023, Benoit BLANCHON
# MIT License # MIT License
add_executable(JsonArrayTests add_executable(JsonArrayTests
@@ -24,5 +24,5 @@ add_test(JsonArray JsonArrayTests)
set_tests_properties(JsonArray set_tests_properties(JsonArray
PROPERTIES PROPERTIES
LABELS "Catch" LABELS "Catch"
) )

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2022, Benoit BLANCHON # Copyright © 2014-2023, Benoit BLANCHON
# MIT License # MIT License
add_executable(JsonDeserializerTests add_executable(JsonDeserializerTests
@@ -24,5 +24,5 @@ add_test(JsonDeserializer JsonDeserializerTests)
set_tests_properties(JsonDeserializer set_tests_properties(JsonDeserializer
PROPERTIES PROPERTIES
LABELS "Catch" LABELS "Catch"
) )

View File

@@ -1,10 +1,12 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
#include <catch.hpp> #include <catch.hpp>
#include <sstream>
void testStringification(DeserializationError error, std::string expected) { void testStringification(DeserializationError error, std::string expected) {
REQUIRE(error.c_str() == expected); REQUIRE(error.c_str() == expected);
} }

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#define ARDUINOJSON_ENABLE_COMMENTS 1 #define ARDUINOJSON_ENABLE_COMMENTS 1

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#define ARDUINOJSON_DECODE_UNICODE 1 #define ARDUINOJSON_DECODE_UNICODE 1

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#define ARDUINOJSON_DECODE_UNICODE 1 #define ARDUINOJSON_DECODE_UNICODE 1

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,10 +1,12 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
#include <catch.hpp> #include <catch.hpp>
#include <sstream>
#define SHOULD_WORK(expression) REQUIRE(DeserializationError::Ok == expression); #define SHOULD_WORK(expression) REQUIRE(DeserializationError::Ok == expression);
#define SHOULD_FAIL(expression) \ #define SHOULD_FAIL(expression) \
REQUIRE(DeserializationError::TooDeep == expression); REQUIRE(DeserializationError::TooDeep == expression);

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#define ARDUINOJSON_USE_LONG_LONG 0 #define ARDUINOJSON_USE_LONG_LONG 0
@@ -11,8 +11,8 @@
#include <catch.hpp> #include <catch.hpp>
namespace my { namespace my {
using ARDUINOJSON_NAMESPACE::isinf; using ArduinoJson::detail::isinf;
using ARDUINOJSON_NAMESPACE::isnan; using ArduinoJson::detail::isnan;
} // namespace my } // namespace my
TEST_CASE("deserialize an integer") { TEST_CASE("deserialize an integer") {

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#define ARDUINOJSON_DECODE_UNICODE 1 #define ARDUINOJSON_DECODE_UNICODE 1

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
@@ -8,12 +8,11 @@
#include <sstream> #include <sstream>
#include <utility> #include <utility>
using ARDUINOJSON_NAMESPACE::addPadding;
class SpyingAllocator { class SpyingAllocator {
public: public:
SpyingAllocator(const SpyingAllocator& src) : _log(src._log) {} SpyingAllocator(const SpyingAllocator& src) : _log(src._log) {}
SpyingAllocator(std::ostream& log) : _log(log) {} SpyingAllocator(std::ostream& log) : _log(log) {}
SpyingAllocator& operator=(const SpyingAllocator& src) = delete;
void* allocate(size_t n) { void* allocate(size_t n) {
_log << "A" << n; _log << "A" << n;
@@ -25,8 +24,6 @@ class SpyingAllocator {
} }
private: private:
SpyingAllocator& operator=(const SpyingAllocator& src);
std::ostream& _log; std::ostream& _log;
}; };
@@ -72,7 +69,6 @@ TEST_CASE("BasicJsonDocument") {
REQUIRE(log.str() == "A4096A4096FF"); REQUIRE(log.str() == "A4096A4096FF");
} }
#if ARDUINOJSON_HAS_RVALUE_REFERENCES
SECTION("Move construct") { SECTION("Move construct") {
{ {
BasicJsonDocument<SpyingAllocator> doc1(4096, log); BasicJsonDocument<SpyingAllocator> doc1(4096, log);
@@ -87,7 +83,6 @@ TEST_CASE("BasicJsonDocument") {
} }
REQUIRE(log.str() == "A4096F"); REQUIRE(log.str() == "A4096F");
} }
#endif
SECTION("Copy assign larger") { SECTION("Copy assign larger") {
{ {
@@ -134,7 +129,6 @@ TEST_CASE("BasicJsonDocument") {
REQUIRE(log.str() == "A1024A1024FF"); REQUIRE(log.str() == "A1024A1024FF");
} }
#if ARDUINOJSON_HAS_RVALUE_REFERENCES
SECTION("Move assign") { SECTION("Move assign") {
{ {
BasicJsonDocument<SpyingAllocator> doc1(4096, log); BasicJsonDocument<SpyingAllocator> doc1(4096, log);
@@ -150,7 +144,6 @@ TEST_CASE("BasicJsonDocument") {
} }
REQUIRE(log.str() == "A4096A8FF"); REQUIRE(log.str() == "A4096A8FF");
} }
#endif
SECTION("garbageCollect()") { SECTION("garbageCollect()") {
BasicJsonDocument<ControllableAllocator> doc(4096); BasicJsonDocument<ControllableAllocator> doc(4096);

View File

@@ -1,5 +1,5 @@
# ArduinoJson - https://arduinojson.org # ArduinoJson - https://arduinojson.org
# Copyright © 2014-2022, Benoit BLANCHON # Copyright © 2014-2023, Benoit BLANCHON
# MIT License # MIT License
add_executable(JsonDocumentTests add_executable(JsonDocumentTests
@@ -12,6 +12,7 @@ add_executable(JsonDocumentTests
DynamicJsonDocument.cpp DynamicJsonDocument.cpp
ElementProxy.cpp ElementProxy.cpp
isNull.cpp isNull.cpp
issue1120.cpp
MemberProxy.cpp MemberProxy.cpp
nesting.cpp nesting.cpp
overflowed.cpp overflowed.cpp
@@ -27,5 +28,5 @@ add_test(JsonDocument JsonDocumentTests)
set_tests_properties(JsonDocument set_tests_properties(JsonDocument
PROPERTIES PROPERTIES
LABELS "Catch" LABELS "Catch"
) )

View File

@@ -1,11 +1,11 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
#include <catch.hpp> #include <catch.hpp>
using ARDUINOJSON_NAMESPACE::addPadding; using ArduinoJson::detail::addPadding;
static void REQUIRE_JSON(JsonDocument& doc, const std::string& expected) { static void REQUIRE_JSON(JsonDocument& doc, const std::string& expected) {
std::string json; std::string json;

View File

@@ -1,11 +1,11 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
#include <catch.hpp> #include <catch.hpp>
typedef ARDUINOJSON_NAMESPACE::ElementProxy<JsonDocument&> ElementProxy; typedef ArduinoJson::detail::ElementProxy<JsonDocument&> ElementProxy;
TEST_CASE("ElementProxy::add()") { TEST_CASE("ElementProxy::add()") {
DynamicJsonDocument doc(4096); DynamicJsonDocument doc(4096);

View File

@@ -1,11 +1,11 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>
#include <catch.hpp> #include <catch.hpp>
typedef ARDUINOJSON_NAMESPACE::MemberProxy<JsonDocument&, const char*> typedef ArduinoJson::detail::MemberProxy<JsonDocument&, const char*>
MemberProxy; MemberProxy;
TEST_CASE("MemberProxy::add()") { TEST_CASE("MemberProxy::add()") {

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, Benoit BLANCHON
// MIT License // MIT License
#include <ArduinoJson.h> #include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org // ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON // Copyright © 2014-2023, 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