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,5 +1,5 @@
# ArduinoJson - https://arduinojson.org
# Copyright © 2014-2022, Benoit BLANCHON
# Copyright © 2014-2023, Benoit BLANCHON
# MIT License
add_executable(MixedConfigurationTests
@@ -19,6 +19,8 @@ add_executable(MixedConfigurationTests
issue1707.cpp
use_double_0.cpp
use_double_1.cpp
use_long_long_0.cpp
use_long_long_1.cpp
)
set_target_properties(MixedConfigurationTests PROPERTIES UNITY_BUILD OFF)
@@ -27,5 +29,5 @@ add_test(MixedConfiguration MixedConfigurationTests)
set_tests_properties(MixedConfiguration
PROPERTIES
LABELS "Catch"
LABELS "Catch"
)

View File

@@ -1,11 +1,11 @@
#define ARDUINOJSON_NAMESPACE ArduinoJson_NoAlignment
#define ARDUINOJSON_VERSION_NAMESPACE NoAlignment
#define ARDUINOJSON_ENABLE_ALIGNMENT 0
#include <ArduinoJson.h>
#include <catch.hpp>
TEST_CASE("ARDUINOJSON_ENABLE_ALIGNMENT == 0") {
using namespace ARDUINOJSON_NAMESPACE;
using namespace ArduinoJson::detail;
const size_t N = sizeof(void*);

View File

@@ -4,7 +4,7 @@
#include <catch.hpp>
TEST_CASE("ARDUINOJSON_ENABLE_ALIGNMENT == 1") {
using namespace ARDUINOJSON_NAMESPACE;
using namespace ArduinoJson::detail;
const size_t N = sizeof(void*);

View File

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

View File

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

View File

@@ -5,7 +5,7 @@
#include <limits>
namespace my {
using ARDUINOJSON_NAMESPACE::isinf;
using ArduinoJson::detail::isinf;
} // namespace my
TEST_CASE("ARDUINOJSON_ENABLE_INFINITY == 1") {

View File

@@ -5,7 +5,7 @@
#include <limits>
namespace my {
using ARDUINOJSON_NAMESPACE::isnan;
using ArduinoJson::detail::isnan;
} // namespace my
TEST_CASE("ARDUINOJSON_ENABLE_NAN == 1") {

View File

@@ -1,5 +1,5 @@
// ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON
// Copyright © 2014-2023, Benoit BLANCHON
// MIT License
#include "progmem_emulation.hpp"
@@ -53,7 +53,7 @@ TEST_CASE("Flash strings") {
}
TEST_CASE("parseNumber()") { // tables are in Flash
using ARDUINOJSON_NAMESPACE::parseNumber;
using ArduinoJson::detail::parseNumber;
CHECK(parseNumber<float>("1") == 1.f);
CHECK(parseNumber<float>("1.23") == 1.23f);
@@ -95,7 +95,7 @@ TEST_CASE("memcpy_P") {
}
TEST_CASE("BoundedReader<const __FlashStringHelper*>") {
using namespace ARDUINOJSON_NAMESPACE;
using namespace ArduinoJson::detail;
SECTION("read") {
BoundedReader<const __FlashStringHelper*> reader(F("\x01\xFF"), 2);
@@ -135,7 +135,7 @@ TEST_CASE("BoundedReader<const __FlashStringHelper*>") {
}
TEST_CASE("Reader<const __FlashStringHelper*>") {
using namespace ARDUINOJSON_NAMESPACE;
using namespace ArduinoJson::detail;
SECTION("read()") {
Reader<const __FlashStringHelper*> reader(F("\x01\xFF\x00\x12"));

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,16 @@
#define ARDUINOJSON_USE_LONG_LONG 0
#include <ArduinoJson.h>
#include <catch.hpp>
TEST_CASE("ARDUINOJSON_USE_LONG_LONG == 0") {
DynamicJsonDocument doc(4096);
doc["A"] = 42;
doc["B"] = 84;
std::string json;
serializeJson(doc, json);
REQUIRE(json == "{\"A\":42,\"B\":84}");
}

View File

@@ -0,0 +1,17 @@
#define ARDUINOJSON_USE_LONG_LONG 1
#include <ArduinoJson.h>
#include <catch.hpp>
TEST_CASE("ARDUINOJSON_USE_LONG_LONG == 1") {
DynamicJsonDocument doc(4096);
JsonObject root = doc.to<JsonObject>();
root["A"] = 123456789123456789;
root["B"] = 987654321987654321;
std::string json;
serializeJson(doc, json);
REQUIRE(json == "{\"A\":123456789123456789,\"B\":987654321987654321}");
}