8000 Added macros `ARDUINOJSON_VERSION`, `ARDUINOJSON_VERSION_MAJOR`... · janelia-arduino/ArduinoJson@eb20ae6 · GitHub
[go: up one dir, main page]

Skip to content

Commit eb20ae6

Browse files
committed
Added macros ARDUINOJSON_VERSION, ARDUINOJSON_VERSION_MAJOR...
1 parent 7c0af91 commit eb20ae6

File tree

5 files changed

+30
-0
lines changed

5 files changed

+30
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ HEAD
77
* Fixed `JsonBuffer::parse()` not respecting nesting limit correctly (issue #693)
88
* Fixed inconsistencies in nesting level counting (PR #695 from Zhenyu Wu)
99
* Fixed null values that could be pass to `strcmp()` (PR #745 from Mike Karlesky)
10+
* Added macros `ARDUINOJSON_VERSION`, `ARDUINOJSON_VERSION_MAJOR`...
1011

1112
v5.13.1
1213
-------

src/ArduinoJson.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#pragma once
66

7+
#include "ArduinoJson/version.hpp"
8+
79
#include "ArduinoJson/DynamicJsonBuffer.hpp"
810
#include "ArduinoJson/JsonArray.hpp"
911
#include "ArduinoJson/JsonObject.hpp"

src/ArduinoJson/version.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// ArduinoJson - arduinojson.org
2+
// Copyright Benoit Blanchon 2014-2018
3+
// MIT License
4+
5+
#pragma once
6+
7+
#define ARDUINOJSON_VERSION "5.13.1"
8+
#define ARDUINOJSON_VERSION_MAJOR 5
9+
#define ARDUINOJSON_VERSION_MINOR 13
10+
#define ARDUINOJSON_VERSION_REVISION 1

test/Misc/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ add_executable(MiscTests
1111
StringTraits.cpp
1212
TypeTraits.cpp
1313
unsigned_char.cpp
14+
version.cpp
1415
vla.cpp
1516
)
1617

test/Misc/version.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// ArduinoJson - arduinojson.org
2+
// Copyright Benoit Blanchon 2014-2018
3+
// MIT License
4+
5+
#include <ArduinoJson/version.hpp>
6+
#include <catch.hpp>
7+
#include <sstream>
8+
9+
TEST_CASE("ARDUINOJSON_VERSION") {
10+
std::stringstream version;
11+
12+
version << ARDUINOJSON_VERSION_MAJOR << "." << ARDUINOJSON_VERSION_MINOR
13+
<< "." << ARDUINOJSON_VERSION_REVISION;
14+
15+
REQUIRE(version.str() == ARDUINOJSON_VERSION);
16+
}

0 commit comments

Comments
 (0)
0