mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-03 13:46:46 +02:00
Compare commits
47 Commits
Author | SHA1 | Date | |
---|---|---|---|
36bcc7b355 | |||
c7c0b729c1 | |||
6aeefda3b6 | |||
4780174ee1 | |||
ab23625091 | |||
a88cf8fab7 | |||
2be528a3fa | |||
337864618c | |||
526cad54d7 | |||
506cf7f438 | |||
4b89878c10 | |||
06fad301cb | |||
7be0c2c650 | |||
43f0db45ad | |||
892c37db08 | |||
d8a1d1a120 | |||
64e52e97ee | |||
2a777a659a | |||
898f429826 | |||
88fbe3ac34 | |||
4ddc674846 | |||
fc4f5fd05f | |||
a002393716 | |||
a889f6560c | |||
4db17ecd93 | |||
2a57f2b365 | |||
803e07c188 | |||
ff44d93e68 | |||
d5d2209d09 | |||
c81e8fc93a | |||
347ac422f4 | |||
d7f5b56ca4 | |||
53d6f0d492 | |||
e4ce75e20c | |||
9094179856 | |||
3aab36fec2 | |||
744d61f6fd | |||
05498aa178 | |||
b1eb273d5b | |||
8a3f8510d6 | |||
22904a48a6 | |||
1730304f46 | |||
1038fc35df | |||
71f44aaee1 | |||
cc7ebfd11e | |||
54d4b308f4 | |||
5234c8124b |
@ -3,6 +3,7 @@
|
||||
BasedOnStyle: Google
|
||||
Standard: Cpp03
|
||||
AllowShortFunctionsOnASingleLine: Empty
|
||||
IncludeBlocks: Preserve
|
||||
|
||||
# Always break after if to get accurate coverage
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
|
4
.github/FUNDING.yml
vendored
4
.github/FUNDING.yml
vendored
@ -1,2 +1,4 @@
|
||||
github: bblanchon
|
||||
custom: https://arduinojson.org/book/
|
||||
custom:
|
||||
- https://arduinojson.org/book/
|
||||
- https://donate.benoitblanchon.fr/
|
||||
|
123
.github/workflows/ci.yml
vendored
123
.github/workflows/ci.yml
vendored
@ -3,27 +3,41 @@ name: Continuous Integration
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
clang-format:
|
||||
name: Clang-Format
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Install
|
||||
run: sudo apt-get install -y clang-format
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Format
|
||||
run: find src/ extras/ -name '*.[ch]pp' | xargs clang-format -i --verbose --style=file
|
||||
- name: Diff
|
||||
run: git diff --exit-code
|
||||
|
||||
gcc:
|
||||
name: GCC
|
||||
needs: clang-format
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- gcc: '4.4'
|
||||
- gcc: '4.6'
|
||||
- gcc: '4.7'
|
||||
- gcc: '4.8'
|
||||
- gcc: '4.9'
|
||||
- gcc: '5'
|
||||
- gcc: '6'
|
||||
- gcc: '7'
|
||||
cxxflags: -fsanitize=leak
|
||||
- gcc: '8'
|
||||
cxxflags: -fsanitize=undefined
|
||||
- gcc: '9'
|
||||
cxxflags: -fsanitize=address
|
||||
- gcc: '10'
|
||||
- gcc: "4.4"
|
||||
- gcc: "4.6"
|
||||
- gcc: "4.7"
|
||||
- gcc: "4.8"
|
||||
- gcc: "4.9"
|
||||
- gcc: "5"
|
||||
- gcc: "6"
|
||||
- gcc: "7"
|
||||
cxxflags: -fsanitize=leak -fno-sanitize-recover=all
|
||||
- gcc: "8"
|
||||
cxxflags: -fsanitize=undefined -fno-sanitize-recover=all
|
||||
- gcc: "9"
|
||||
cxxflags: -fsanitize=address -fno-sanitize-recover=all
|
||||
- gcc: "10"
|
||||
steps:
|
||||
- name: Install
|
||||
run: |
|
||||
@ -35,7 +49,6 @@ jobs:
|
||||
sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ bionic universe'
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
|
||||
if: ${{ matrix.gcc < 7 }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Configure
|
||||
@ -48,29 +61,32 @@ jobs:
|
||||
run: cmake --build .
|
||||
- name: Test
|
||||
run: ctest --output-on-failure -C Debug .
|
||||
env:
|
||||
UBSAN_OPTIONS: print_stacktrace=1
|
||||
|
||||
clang:
|
||||
name: Clang
|
||||
needs: clang-format
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- clang: '3.5'
|
||||
- clang: '3.6'
|
||||
- clang: '3.7'
|
||||
- clang: '3.8'
|
||||
- clang: '3.9'
|
||||
- clang: '4.0'
|
||||
- clang: '5.0'
|
||||
- clang: '6.0'
|
||||
- clang: '7'
|
||||
- clang: '8'
|
||||
cxxflags: -fsanitize=leak
|
||||
- clang: '9'
|
||||
cxxflags: -fsanitize=undefined
|
||||
- clang: '10'
|
||||
cxxflags: -fsanitize=address
|
||||
- clang: "3.5"
|
||||
- clang: "3.6"
|
||||
- clang: "3.7"
|
||||
- clang: "3.8"
|
||||
- clang: "3.9"
|
||||
- clang: "4.0"
|
||||
- clang: "5.0"
|
||||
- clang: "6.0"
|
||||
- clang: "7"
|
||||
- clang: "8"
|
||||
cxxflags: -fsanitize=leak -fno-sanitize-recover=all
|
||||
- clang: "9"
|
||||
cxxflags: -fsanitize=undefined -fno-sanitize-recover=all
|
||||
- clang: "10"
|
||||
cxxflags: -fsanitize=address -fno-sanitize-recover=all
|
||||
steps:
|
||||
- name: Install
|
||||
run: |
|
||||
@ -82,7 +98,6 @@ jobs:
|
||||
sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ bionic universe'
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang-${{ matrix.clang }}
|
||||
if: ${{ matrix.clang < 8 }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Configure
|
||||
@ -90,11 +105,13 @@ jobs:
|
||||
env:
|
||||
CC: clang-${{ matrix.clang }}
|
||||
CXX: clang++-${{ matrix.clang }}
|
||||
CXXFLAGS: ${{ matrix.cxxflags }}
|
||||
CXXFLAGS: ${{ matrix.cxxflags }}
|
||||
- name: Build
|
||||
run: cmake --build .
|
||||
- name: Test
|
||||
run: ctest --output-on-failure -C Debug .
|
||||
env:
|
||||
UBSAN_OPTIONS: print_stacktrace=1
|
||||
|
||||
xcode:
|
||||
name: XCode
|
||||
@ -104,9 +121,9 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- xcode: '10.3'
|
||||
- xcode: '11.7'
|
||||
- xcode: '12.4'
|
||||
- xcode: "10.3"
|
||||
- xcode: "11.7"
|
||||
- xcode: "12.4"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
@ -142,23 +159,24 @@ jobs:
|
||||
arduino:
|
||||
name: Arduino
|
||||
needs: gcc
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arduino: '1.6.7'
|
||||
- arduino: "1.6.7"
|
||||
os: ubuntu-18.04 # java.lang.Error: Cannot load com.sun.java.swing.plaf.gtk.GTKLookAndFeel
|
||||
board: arduino:avr:uno
|
||||
- arduino: '1.8.2'
|
||||
- arduino: "1.8.2"
|
||||
board: arduino:samd:mkr1000
|
||||
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Build
|
||||
run: extras/ci/arduino.sh ${{ matrix.board }}
|
||||
env:
|
||||
BOARD: ${{ matrix.board }}
|
||||
VERSION: ${{ matrix.arduino }}
|
||||
BOARD: ${{ matrix.board }}
|
||||
VERSION: ${{ matrix.arduino }}
|
||||
|
||||
platformio:
|
||||
name: PlatformIO
|
||||
@ -176,7 +194,7 @@ jobs:
|
||||
- name: Set up Python 3.x
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: "3.x"
|
||||
- name: Install PlatformIO
|
||||
run: pip install platformio
|
||||
- name: Build
|
||||
@ -202,7 +220,6 @@ jobs:
|
||||
- name: Compile
|
||||
run: extras/ci/particle.sh ${{ matrix.board }}
|
||||
|
||||
|
||||
arm:
|
||||
name: GCC for ARM processor
|
||||
needs: gcc
|
||||
@ -234,7 +251,7 @@ jobs:
|
||||
- name: Build
|
||||
run: ninja
|
||||
- name: Test
|
||||
run: ninja test
|
||||
run: ctest -LE 'WillFail|Fuzzing' -T test
|
||||
- name: lcov --capture
|
||||
run: lcov --capture --no-external --directory . --output-file coverage.info
|
||||
- name: lcov --remove
|
||||
@ -251,3 +268,23 @@ jobs:
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
path-to-lcov: coverage_filtered.info
|
||||
|
||||
valgrind:
|
||||
needs: gcc
|
||||
name: Valgrind
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Install
|
||||
run: sudo apt-get install -y valgrind ninja-build
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Configure
|
||||
run: cmake -G Ninja -D MEMORYCHECK_COMMAND_OPTIONS="--error-exitcode=1 --leak-check=full" .
|
||||
- name: Build
|
||||
run: ninja
|
||||
- name: Memcheck
|
||||
run: ctest -LE WillFail -T memcheck
|
||||
id: memcheck
|
||||
- name: MemoryChecker.*.log
|
||||
run: cat Testing/Temporary/MemoryChecker.*.log
|
||||
if: failure()
|
||||
|
@ -1,6 +1,3 @@
|
||||
.github/
|
||||
examples/
|
||||
fuzzing/
|
||||
scripts/
|
||||
test/
|
||||
third-party/
|
||||
extras/
|
1
.prettierignore
Normal file
1
.prettierignore
Normal file
@ -0,0 +1 @@
|
||||
*.md
|
8
.vscode/settings.json
vendored
Normal file
8
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
|
||||
"cmake.generator": "Ninja",
|
||||
"git.inputValidationLength": 80,
|
||||
"git.inputValidationSubjectLength": 72,
|
||||
"files.insertFinalNewline": true,
|
||||
"files.trimFinalNewlines": true
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
80
CHANGELOG.md
80
CHANGELOG.md
@ -1,6 +1,86 @@
|
||||
ArduinoJson: change log
|
||||
=======================
|
||||
|
||||
v6.18.0 (2021-05-05)
|
||||
-------
|
||||
|
||||
* Added support for custom converters (issue #687)
|
||||
* Added support for `Printable` (issue #1444)
|
||||
* Removed support for `char` values, see below (issue #1498)
|
||||
* `deserializeJson()` leaves `\uXXXX` unchanged instead of returning `NotSupported`
|
||||
* `deserializeMsgPack()` inserts `null` instead of returning `NotSupported`
|
||||
* Removed `DeserializationError::NotSupported`
|
||||
* Added `JsonVariant::is<JsonArrayConst/JsonObjectConst>()` (issue #1412)
|
||||
* Added `JsonVariant::is<JsonVariant/JsonVariantConst>()` (issue #1412)
|
||||
* Changed `JsonVariantConst::is<JsonArray/JsonObject>()` to return `false` (issue #1412)
|
||||
* Simplified `JsonVariant::as<T>()` to always return `T` (see below)
|
||||
* Updated folders list in `.mbedignore` (PR #1515 by @AGlass0fMilk)
|
||||
* Fixed member-call-on-null-pointer in `getMember()` when array is empty
|
||||
* `serializeMsgPack(doc, buffer, size)` doesn't add null-terminator anymore (issue #1545)
|
||||
* `serializeJson(doc, buffer, size)` adds null-terminator only if there is enough room
|
||||
* PlatformIO: set `build.libArchive` to `false` (PR #1550 by @askreet)
|
||||
|
||||
> ### BREAKING CHANGES
|
||||
>
|
||||
> #### Support for `char` removed
|
||||
>
|
||||
> We cannot cast a `JsonVariant` to a `char` anymore, so the following will break:
|
||||
> ```c++
|
||||
> char age = doc["age"]; // error: no matching function for call to 'variantAs(VariantData*&)'
|
||||
> ```
|
||||
> Instead, you must use another integral type, such as `int8_t`:
|
||||
> ```c++
|
||||
> int8_t age = doc["age"]; // OK
|
||||
> ```
|
||||
>
|
||||
> Similarly, we cannot assign from a `char` anymore, so the following will break:
|
||||
> ```c++
|
||||
> char age;
|
||||
> doc["age"] = age; // error: no matching function for call to 'VariantRef::set(const char&)'
|
||||
> ```
|
||||
> Instead, you must use another integral type, such as `int8_t`:
|
||||
> ```c++
|
||||
> int8_t age;
|
||||
> doc["age"] = age; // OK
|
||||
> ```
|
||||
> A deprecation warning with the message "Support for `char` is deprecated, use `int8_t` or `uint8_t` instead" was added to allow a smooth transition.
|
||||
>
|
||||
> #### `as<T>()` always returns `T`
|
||||
>
|
||||
> Previously, `JsonVariant::as<T>()` could return a type different from `T`.
|
||||
> The most common example is `as<char*>()` that returned a `const char*`.
|
||||
> While this feature simplified a few use cases, it was confusing and complicated the
|
||||
> implementation of custom converters.
|
||||
>
|
||||
> Starting from this version, `as<T>` doesn't try to auto-correct the return type and always return `T`,
|
||||
> which means that you cannot write this anymore:
|
||||
>
|
||||
> ```c++
|
||||
> Serial.println(doc["sensor"].as<char*>()); // error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
|
||||
> ```
|
||||
>
|
||||
> Instead, you must write:
|
||||
>
|
||||
> ```c++
|
||||
> Serial.println(doc["sensor"].as<const char*>()); // OK
|
||||
> ```
|
||||
>
|
||||
> A deprecation warning with the message "Replace `as<char*>()` with `as<const char*>()`" was added to allow a smooth transition.
|
||||
>
|
||||
> #### `DeserializationError::NotSupported` removed
|
||||
>
|
||||
> On a different topic, `DeserializationError::NotSupported` has been removed.
|
||||
> Instead of returning this error:
|
||||
>
|
||||
> * `deserializeJson()` leaves `\uXXXX` unchanged (only when `ARDUINOJSON_DECODE_UNICODE` is `0`)
|
||||
> * `deserializeMsgPack()` replaces unsupported values with `null`s
|
||||
>
|
||||
> #### Const-aware `is<T>()`
|
||||
>
|
||||
> Lastly, a very minor change concerns `JsonVariantConst::is<T>()`.
|
||||
> It used to return `true` for `JsonArray` and `JsonOject`, but now it returns `false`.
|
||||
> Instead, you must use `JsonArrayConst` and `JsonObjectConst`.
|
||||
|
||||
v6.17.3 (2021-02-15)
|
||||
-------
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
# ArduinoJson - arduinojson.org
|
||||
# ArduinoJson - https://arduinojson.org
|
||||
# Copyright Benoit Blanchon 2014-2021
|
||||
# MIT License
|
||||
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(ArduinoJson VERSION 6.17.3)
|
||||
project(ArduinoJson VERSION 6.18.0)
|
||||
|
||||
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
||||
include(CTest)
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
---
|
||||
|
||||
[](https://www.ardu-badge.com/ArduinoJson/6.17.3)
|
||||
[](https://www.ardu-badge.com/ArduinoJson/6.18.0)
|
||||
[](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A6.x)
|
||||
[](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x)
|
||||
[](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson)
|
||||
@ -34,10 +34,11 @@ ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things).
|
||||
* Deduplicates strings
|
||||
* Versatile
|
||||
* [Supports custom allocators (to use external RAM chip, for example)](https://arduinojson.org/v6/how-to/use-external-ram-on-esp32/?utm_source=github&utm_medium=readme)
|
||||
* Supports [Arduino's `String`](https://arduinojson.org/v6/api/config/enable_arduino_string/) and [STL's `std::string`](https://arduinojson.org/v6/api/config/enable_std_string/?utm_source=github&utm_medium=readme)
|
||||
* Supports Arduino's `Stream` and [STL's `std::istream`/`std::ostream`](https://arduinojson.org/v6/api/config/enable_std_stream/?utm_source=github&utm_medium=readme)
|
||||
* Supports [Arduino's `String`](https://arduinojson.org/v6/api/config/enable_arduino_string/?utm_source=github&utm_medium=readme) and [STL's `std::string`](https://arduinojson.org/v6/api/config/enable_std_string/?utm_source=github&utm_medium=readme)
|
||||
* Supports [Arduino's `Stream`](https://arduinojson.org/v6/api/config/enable_arduino_stream/?utm_source=github&utm_medium=readme) and [STL's `std::istream`/`std::ostream`](https://arduinojson.org/v6/api/config/enable_std_stream/?utm_source=github&utm_medium=readme)
|
||||
* [Supports Flash strings](https://arduinojson.org/v6/api/config/enable_progmem/?utm_source=github&utm_medium=readme)
|
||||
* Supports [custom readers](https://arduinojson.org/v6/api/json/deserializejson/?utm_source=github&utm_medium=readme#custom-reader) and [custom writers](https://arduinojson.org/v6/api/json/serializejson/?utm_source=github&utm_medium=readme#custom-writer)
|
||||
* Supports custom converters
|
||||
* Portable
|
||||
* Usable on any C++ project (not limited to Arduino)
|
||||
* Compatible with C++98
|
||||
@ -86,7 +87,7 @@ ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things).
|
||||
* [How-tos](https://arduinojson.org/v6/example/?utm_source=github&utm_medium=readme)
|
||||
* [FAQ](https://arduinojson.org/v6/faq/?utm_source=github&utm_medium=readme)
|
||||
* [Book](https://arduinojson.org/book/?utm_source=github&utm_medium=readme)
|
||||
* [Changelog](changelog.md)
|
||||
* [Changelog](CHANGELOG.md)
|
||||
* Vibrant user community
|
||||
* Most popular of all Arduino libraries on [GitHub](https://github.com/search?o=desc&q=arduino+library&s=stars&type=Repositories) and [PlatformIO](https://platformio.org/lib/search)
|
||||
* [Used in hundreds of projects](https://www.hackster.io/search?i=projects&q=arduinojson)
|
||||
|
@ -1,4 +1,4 @@
|
||||
version: 6.17.3.{build}
|
||||
version: 6.18.0.{build}
|
||||
environment:
|
||||
matrix:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
//
|
||||
@ -44,7 +44,7 @@ void loadConfiguration(const char *filename, Config &config) {
|
||||
|
||||
// Allocate a temporary JsonDocument
|
||||
// Don't forget to change the capacity to match your requirements.
|
||||
// Use arduinojson.org/v6/assistant to compute the capacity.
|
||||
// Use https://arduinojson.org/v6/assistant to compute the capacity.
|
||||
StaticJsonDocument<512> doc;
|
||||
|
||||
// Deserialize the JSON document
|
||||
@ -76,7 +76,7 @@ void saveConfiguration(const char *filename, const Config &config) {
|
||||
|
||||
// Allocate a temporary JsonDocument
|
||||
// Don't forget to change the capacity to match your requirements.
|
||||
// Use arduinojson.org/assistant to compute the capacity.
|
||||
// Use https://arduinojson.org/assistant to compute the capacity.
|
||||
StaticJsonDocument<256> doc;
|
||||
|
||||
// Set the values in the document
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
//
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
//
|
||||
@ -17,7 +17,7 @@ void setup() {
|
||||
//
|
||||
// Inside the brackets, 200 is the RAM allocated to this document.
|
||||
// Don't forget to change this value to match your requirement.
|
||||
// Use arduinojson.org/v6/assistant to compute the capacity.
|
||||
// Use https://arduinojson.org/v6/assistant to compute the capacity.
|
||||
StaticJsonDocument<200> doc;
|
||||
|
||||
// StaticJsonObject allocates memory on the stack, it can be
|
||||
|
@ -1,11 +1,11 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
//
|
||||
// This example shows how to parse a JSON document in an HTTP response.
|
||||
// It uses the Ethernet library, but can be easily adapted for Wifi.
|
||||
//
|
||||
// It performs a GET resquest on arduinojson.org/example.json
|
||||
// It performs a GET resquest on https://arduinojson.org/example.json
|
||||
// Here is the expected response:
|
||||
// {
|
||||
// "sensor": "gps",
|
||||
@ -77,7 +77,7 @@ void setup() {
|
||||
}
|
||||
|
||||
// Allocate the JSON document
|
||||
// Use arduinojson.org/v6/assistant to compute the capacity.
|
||||
// Use https://arduinojson.org/v6/assistant to compute the capacity.
|
||||
const size_t capacity = JSON_OBJECT_SIZE(3) + JSON_ARRAY_SIZE(2) + 60;
|
||||
DynamicJsonDocument doc(capacity);
|
||||
|
||||
@ -92,7 +92,7 @@ void setup() {
|
||||
|
||||
// Extract values
|
||||
Serial.println(F("Response:"));
|
||||
Serial.println(doc["sensor"].as<char*>());
|
||||
Serial.println(doc["sensor"].as<const char*>());
|
||||
Serial.println(doc["time"].as<long>());
|
||||
Serial.println(doc["data"][0].as<float>(), 6);
|
||||
Serial.println(doc["data"][1].as<float>(), 6);
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
//
|
||||
@ -17,7 +17,7 @@ void setup() {
|
||||
//
|
||||
// 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.
|
||||
// Use arduinojson.org/v6/assistant to compute the capacity.
|
||||
// Use https://arduinojson.org/v6/assistant to compute the capacity.
|
||||
StaticJsonDocument<200> doc;
|
||||
|
||||
// StaticJsonDocument<N> allocates memory on the stack, it can be
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
//
|
||||
@ -55,7 +55,7 @@ void loop() {
|
||||
while (client.available()) client.read();
|
||||
|
||||
// Allocate a temporary JsonDocument
|
||||
// Use arduinojson.org/v6/assistant to compute the capacity.
|
||||
// Use https://arduinojson.org/v6/assistant to compute the capacity.
|
||||
StaticJsonDocument<500> doc;
|
||||
|
||||
// Create the "analog" array
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
//
|
||||
@ -46,7 +46,7 @@ void setup() {
|
||||
|
||||
void loop() {
|
||||
// Allocate a temporary JsonDocument
|
||||
// Use arduinojson.org/v6/assistant to compute the capacity.
|
||||
// Use https://arduinojson.org/v6/assistant to compute the capacity.
|
||||
StaticJsonDocument<500> doc;
|
||||
|
||||
// Create the "analog" array
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
//
|
||||
@ -18,7 +18,7 @@ void setup() {
|
||||
//
|
||||
// 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.
|
||||
// Use arduinojson.org/v6/assistant to compute the capacity.
|
||||
// Use https://arduinojson.org/v6/assistant to compute the capacity.
|
||||
StaticJsonDocument<200> doc;
|
||||
|
||||
// StaticJsonObject allocates memory on the stack, it can be
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
//
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
//
|
||||
|
@ -1,4 +1,4 @@
|
||||
# ArduinoJson - arduinojson.org
|
||||
# ArduinoJson - https://arduinojson.org
|
||||
# Copyright Benoit Blanchon 2014-2021
|
||||
# MIT License
|
||||
|
||||
@ -46,6 +46,11 @@ macro(add_fuzzer name)
|
||||
COMMAND
|
||||
"${FUZZER}" "${CORPUS_DIR}" "${SEED_CORPUS_DIR}" -max_total_time=5 -timeout=1
|
||||
)
|
||||
|
||||
set_tests_properties("${FUZZER}"
|
||||
PROPERTIES
|
||||
LABELS "Fuzzing"
|
||||
)
|
||||
endmacro()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6)
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
//
|
||||
@ -12,7 +12,7 @@ int main() {
|
||||
//
|
||||
// Inside the brackets, 200 is the RAM allocated to this document.
|
||||
// Don't forget to change this value to match your requirement.
|
||||
// Use arduinojson.org/v6/assistant to compute the capacity.
|
||||
// Use https://arduinojson.org/v6/assistant to compute the capacity.
|
||||
StaticJsonDocument<200> doc;
|
||||
|
||||
// StaticJsonObject allocates memory on the stack, it can be
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
//
|
||||
@ -12,7 +12,7 @@ int main() {
|
||||
//
|
||||
// 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.
|
||||
// Use arduinojson.org/v6/assistant to compute the capacity.
|
||||
// Use https://arduinojson.org/v6/assistant to compute the capacity.
|
||||
StaticJsonDocument<300> doc;
|
||||
|
||||
// StaticJsonDocument<N> allocates memory on the stack, it can be
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
//
|
||||
@ -12,7 +12,7 @@ int main() {
|
||||
//
|
||||
// Inside the brackets, 300 is the size of the memory pool in bytes.
|
||||
// Don't forget to change this value to match your JSON document.
|
||||
// Use arduinojson.org/assistant to compute the capacity.
|
||||
// Use https://arduinojson.org/assistant to compute the capacity.
|
||||
StaticJsonDocument<300> doc;
|
||||
|
||||
// StaticJsonObject allocates memory on the stack, it can be
|
||||
|
@ -1,4 +1,4 @@
|
||||
# ArduinoJson - arduinojson.org
|
||||
# ArduinoJson - https://arduinojson.org
|
||||
# Copyright Benoit Blanchon 2014-2021
|
||||
# MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# ArduinoJson - arduinojson.org
|
||||
# ArduinoJson - https://arduinojson.org
|
||||
# Copyright Benoit Blanchon 2014-2021
|
||||
# MIT License
|
||||
|
||||
@ -18,7 +18,8 @@ macro(build_should_fail target)
|
||||
)
|
||||
set_tests_properties(${target}
|
||||
PROPERTIES
|
||||
WILL_FAIL TRUE
|
||||
WILL_FAIL TRUE
|
||||
LABELS "WillFail;Catch"
|
||||
)
|
||||
endmacro()
|
||||
|
||||
@ -39,3 +40,9 @@ build_should_fail(write_long_long)
|
||||
|
||||
add_executable(delete_jsondocument delete_jsondocument.cpp)
|
||||
build_should_fail(delete_jsondocument)
|
||||
|
||||
add_executable(variant_as_char variant_as_char.cpp)
|
||||
build_should_fail(variant_as_char)
|
||||
|
||||
add_executable(assign_char assign_char.cpp)
|
||||
build_should_fail(assign_char)
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
12
extras/tests/FailingBuilds/assign_char.cpp
Normal file
12
extras/tests/FailingBuilds/assign_char.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
// See issue #1498
|
||||
|
||||
int main() {
|
||||
DynamicJsonDocument doc(1024);
|
||||
doc["dummy"] = 'A';
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
12
extras/tests/FailingBuilds/variant_as_char.cpp
Normal file
12
extras/tests/FailingBuilds/variant_as_char.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
// See issue #1498
|
||||
|
||||
int main() {
|
||||
DynamicJsonDocument doc(1024);
|
||||
doc["dummy"].as<char>();
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "api/Print.h"
|
||||
#include "api/Stream.h"
|
||||
#include "api/String.h"
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
33
extras/tests/Helpers/api/Print.h
Normal file
33
extras/tests/Helpers/api/Print.h
Normal file
@ -0,0 +1,33 @@
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
class Print {
|
||||
public:
|
||||
virtual ~Print() {}
|
||||
|
||||
virtual size_t write(uint8_t) = 0;
|
||||
virtual size_t write(const uint8_t *buffer, size_t size) = 0;
|
||||
|
||||
size_t write(const char *str) {
|
||||
if (!str)
|
||||
return 0;
|
||||
return write(reinterpret_cast<const uint8_t *>(str), strlen(str));
|
||||
}
|
||||
|
||||
size_t write(const char *buffer, size_t size) {
|
||||
return write(reinterpret_cast<const uint8_t *>(buffer), size);
|
||||
}
|
||||
};
|
||||
|
||||
class Printable {
|
||||
public:
|
||||
virtual ~Printable() {}
|
||||
virtual size_t printTo(Print &p) const = 0;
|
||||
};
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# ArduinoJson - arduinojson.org
|
||||
# ArduinoJson - https://arduinojson.org
|
||||
# Copyright Benoit Blanchon 2014-2021
|
||||
# MIT License
|
||||
|
||||
@ -17,3 +17,8 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
endif()
|
||||
|
||||
add_test(IntegrationTests IntegrationTests)
|
||||
|
||||
set_tests_properties(IntegrationTests
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
)
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# ArduinoJson - arduinojson.org
|
||||
# ArduinoJson - https://arduinojson.org
|
||||
# Copyright Benoit Blanchon 2014-2021
|
||||
# MIT License
|
||||
|
||||
@ -20,3 +20,8 @@ add_executable(JsonArrayTests
|
||||
)
|
||||
|
||||
add_test(JsonArray JsonArrayTests)
|
||||
|
||||
set_tests_properties(JsonArray
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
)
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
@ -60,7 +60,6 @@ TEST_CASE("JsonArray::operator[]") {
|
||||
|
||||
array[0] = str;
|
||||
REQUIRE(str == array[0].as<const char*>());
|
||||
REQUIRE(str == array[0].as<char*>()); // <- short hand
|
||||
REQUIRE(true == array[0].is<const char*>());
|
||||
REQUIRE(false == array[0].is<int>());
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# ArduinoJson - arduinojson.org
|
||||
# ArduinoJson - https://arduinojson.org
|
||||
# Copyright Benoit Blanchon 2014-2021
|
||||
# MIT License
|
||||
|
||||
@ -21,3 +21,8 @@ add_executable(JsonDeserializerTests
|
||||
set_target_properties(JsonDeserializerTests PROPERTIES UNITY_BUILD OFF)
|
||||
|
||||
add_test(JsonDeserializer JsonDeserializerTests)
|
||||
|
||||
set_tests_properties(JsonDeserializer
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
)
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
@ -34,7 +34,6 @@ TEST_CASE("DeserializationError") {
|
||||
TEST_STRINGIFICATION(IncompleteInput);
|
||||
TEST_STRINGIFICATION(InvalidInput);
|
||||
TEST_STRINGIFICATION(NoMemory);
|
||||
TEST_STRINGIFICATION(NotSupported);
|
||||
TEST_STRINGIFICATION(TooDeep);
|
||||
}
|
||||
|
||||
@ -44,7 +43,6 @@ TEST_CASE("DeserializationError") {
|
||||
TEST_BOOLIFICATION(IncompleteInput, true);
|
||||
TEST_BOOLIFICATION(InvalidInput, true);
|
||||
TEST_BOOLIFICATION(NoMemory, true);
|
||||
TEST_BOOLIFICATION(NotSupported, true);
|
||||
TEST_BOOLIFICATION(TooDeep, true);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
@ -99,8 +99,8 @@ TEST_CASE("deserialize JSON array") {
|
||||
|
||||
REQUIRE(err == DeserializationError::Ok);
|
||||
REQUIRE(2 == arr.size());
|
||||
REQUIRE(arr[0].as<char*>() == 0);
|
||||
REQUIRE(arr[1].as<char*>() == 0);
|
||||
REQUIRE(arr[0].as<const char*>() == 0);
|
||||
REQUIRE(arr[1].as<const char*>() == 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
@ -182,8 +182,8 @@ TEST_CASE("deserialize JSON object") {
|
||||
REQUIRE(err == DeserializationError::Ok);
|
||||
REQUIRE(doc.is<JsonObject>());
|
||||
REQUIRE(obj.size() == 2);
|
||||
REQUIRE(obj["key1"].as<char*>() == 0);
|
||||
REQUIRE(obj["key2"].as<char*>() == 0);
|
||||
REQUIRE(obj["key1"].as<const char*>() == 0);
|
||||
REQUIRE(obj["key2"].as<const char*>() == 0);
|
||||
}
|
||||
|
||||
SECTION("Array") {
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# ArduinoJson - arduinojson.org
|
||||
# ArduinoJson - https://arduinojson.org
|
||||
# Copyright Benoit Blanchon 2014-2021
|
||||
# MIT License
|
||||
|
||||
@ -22,3 +22,8 @@ add_executable(JsonDocumentTests
|
||||
)
|
||||
|
||||
add_test(JsonDocument JsonDocumentTests)
|
||||
|
||||
set_tests_properties(JsonDocument
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
)
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# ArduinoJson - arduinojson.org
|
||||
# ArduinoJson - https://arduinojson.org
|
||||
# Copyright Benoit Blanchon 2014-2021
|
||||
# MIT License
|
||||
|
||||
@ -20,3 +20,8 @@ add_executable(JsonObjectTests
|
||||
)
|
||||
|
||||
add_test(JsonObject JsonObjectTests)
|
||||
|
||||
set_tests_properties(JsonObject
|
||||
PROPERTIES
|
||||
LABELS "Catch"
|
||||
)
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user