mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-26 16:57:32 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
1360b6a396 | |||
16e51b83ab | |||
aa7cc5351c | |||
30da920135 |
4
.gitignore
vendored
4
.gitignore
vendored
@ -10,3 +10,7 @@
|
||||
/extras/fuzzing/*_fuzzer.options
|
||||
/extras/fuzzing/*_fuzzer_seed_corpus.zip
|
||||
.vs/
|
||||
|
||||
# Used by CI for Particle
|
||||
/src/*.ino
|
||||
/project.properties
|
||||
|
@ -128,6 +128,7 @@ matrix:
|
||||
- env: SCRIPT=arduino VERSION=1.8.2 BOARD=arduino:samd:mkr1000
|
||||
- env: SCRIPT=platformio BOARD=uno
|
||||
- env: SCRIPT=platformio BOARD=esp01
|
||||
- env: SCRIPT=particle BOARD=argon
|
||||
cache:
|
||||
directories:
|
||||
- "~/.platformio"
|
||||
|
@ -1,6 +1,13 @@
|
||||
ArduinoJson: change log
|
||||
=======================
|
||||
|
||||
v6.17.2 (2020-11-14)
|
||||
-------
|
||||
|
||||
* Fixed invalid conversion error in `operator|(JsonVariant, char*)` (issue #1432)
|
||||
* Changed the default value of `ARDUINOJSON_ENABLE_PROGMEM` (issue #1433).
|
||||
It now checks that the `pgm_read_XXX` macros are defined before enabling `PROGMEM`.
|
||||
|
||||
v6.17.1 (2020-11-07)
|
||||
-------
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(ArduinoJson VERSION 6.17.1)
|
||||
project(ArduinoJson VERSION 6.17.2)
|
||||
|
||||
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
||||
include(CTest)
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
---
|
||||
|
||||
[](https://www.ardu-badge.com/ArduinoJson/6.17.1)
|
||||
[](https://www.ardu-badge.com/ArduinoJson/6.17.2)
|
||||
[](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x)
|
||||
[](https://travis-ci.org/bblanchon/ArduinoJson)
|
||||
[](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson)
|
||||
|
@ -1,4 +1,4 @@
|
||||
version: 6.17.1.{build}
|
||||
version: 6.17.2.{build}
|
||||
environment:
|
||||
matrix:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||
|
12
extras/ci/particle.sh
Executable file
12
extras/ci/particle.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
cd "$(dirname "$0")/../../"
|
||||
|
||||
npm install -g particle-cli
|
||||
|
||||
particle login -t "${PARTICLE_TOKEN}"
|
||||
|
||||
cp extras/particle/src/smocktest.ino src/
|
||||
cp extras/particle/project.properties ./
|
||||
|
||||
particle compile "$BOARD"
|
1
extras/particle/project.properties
Normal file
1
extras/particle/project.properties
Normal file
@ -0,0 +1 @@
|
||||
name=ArduinoJsonCI
|
5
extras/particle/src/smocktest.ino
Normal file
5
extras/particle/src/smocktest.ino
Normal file
@ -0,0 +1,5 @@
|
||||
#include "ArduinoJson.h"
|
||||
|
||||
void setup() {}
|
||||
|
||||
void loop() {}
|
@ -137,6 +137,20 @@ TEST_CASE("JsonVariant::operator|()") {
|
||||
REQUIRE(result == "not default");
|
||||
}
|
||||
|
||||
SECTION("const char* | char*") {
|
||||
char dflt[] = "default";
|
||||
variant.set("not default");
|
||||
std::string result = variant | dflt;
|
||||
REQUIRE(result == "not default");
|
||||
}
|
||||
|
||||
SECTION("int | char*") {
|
||||
char dflt[] = "default";
|
||||
variant.set(42);
|
||||
std::string result = variant | dflt;
|
||||
REQUIRE(result == "default");
|
||||
}
|
||||
|
||||
SECTION("const char* | int") {
|
||||
variant.set("not default");
|
||||
int result = variant | 42;
|
||||
|
@ -7,7 +7,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/bblanchon/ArduinoJson.git"
|
||||
},
|
||||
"version": "6.17.1",
|
||||
"version": "6.17.2",
|
||||
"authors": {
|
||||
"name": "Benoit Blanchon",
|
||||
"url": "https://blog.benoitblanchon.fr"
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=ArduinoJson
|
||||
version=6.17.1
|
||||
version=6.17.2
|
||||
author=Benoit Blanchon <blog.benoitblanchon.fr>
|
||||
maintainer=Benoit Blanchon <blog.benoitblanchon.fr>
|
||||
sentence=A simple and efficient JSON library for embedded C++.
|
||||
|
@ -172,7 +172,8 @@
|
||||
#endif // ARDUINO
|
||||
|
||||
#ifndef ARDUINOJSON_ENABLE_PROGMEM
|
||||
#ifdef PROGMEM
|
||||
#if defined(PROGMEM) && defined(pgm_read_byte) && defined(pgm_read_dword) && \
|
||||
defined(pgm_read_ptr) && defined(pgm_read_float)
|
||||
#define ARDUINOJSON_ENABLE_PROGMEM 1
|
||||
#else
|
||||
#define ARDUINOJSON_ENABLE_PROGMEM 0
|
||||
|
@ -19,15 +19,23 @@ CompareResult compare(const T1 &lhs, const T2 &rhs); // VariantCompare.cpp
|
||||
template <typename TVariant>
|
||||
struct VariantOperators {
|
||||
// Returns the default value if the VariantRef is undefined or incompatible
|
||||
//
|
||||
// int operator|(JsonVariant, int)
|
||||
// float operator|(JsonVariant, float)
|
||||
// bool operator|(JsonVariant, bool)
|
||||
// const char* operator|(JsonVariant, const char*)
|
||||
// char* operator|(JsonVariant, const char*)
|
||||
template <typename T>
|
||||
friend typename enable_if<!IsVariant<T>::value, T>::type operator|(
|
||||
const TVariant &variant, T defaultValue) {
|
||||
friend typename enable_if<!IsVariant<T>::value,
|
||||
typename VariantAs<T>::type>::type
|
||||
operator|(const TVariant &variant, T defaultValue) {
|
||||
if (variant.template is<T>())
|
||||
return variant.template as<T>();
|
||||
else
|
||||
return defaultValue;
|
||||
}
|
||||
// Returns the default value if the VariantRef is undefined or incompatible
|
||||
//
|
||||
// JsonVariant operator|(JsonVariant, JsonVariant)
|
||||
template <typename T>
|
||||
friend typename enable_if<IsVariant<T>::value, typename T::variant_type>::type
|
||||
operator|(const TVariant &variant, T defaultValue) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define ARDUINOJSON_VERSION "6.17.1"
|
||||
#define ARDUINOJSON_VERSION "6.17.2"
|
||||
#define ARDUINOJSON_VERSION_MAJOR 6
|
||||
#define ARDUINOJSON_VERSION_MINOR 17
|
||||
#define ARDUINOJSON_VERSION_REVISION 1
|
||||
#define ARDUINOJSON_VERSION_REVISION 2
|
||||
|
Reference in New Issue
Block a user