File tree Expand file tree Collapse file tree 4 files changed +49
-0
lines changed Expand file tree Collapse file tree 4 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1
1
ArduinoJson: change log
2
2
=======================
3
3
4
+ HEAD
5
+ ----
6
+
7
+ * Fix truncated strings on Arduino Due (issue #2181 )
8
+
4
9
v7.4.1 (2025-04-11)
5
10
------
6
11
Original file line number Diff line number Diff line change @@ -29,3 +29,23 @@ set_tests_properties(Misc
29
29
PROPERTIES
30
30
LABELS "Catch"
31
31
)
32
+
33
+ add_executable (Issue2181
34
+ issue2181.cpp # Cannot be linked with other tests
35
+ )
36
+
37
+ set_target_properties (Issue2181 PROPERTIES UNITY_BUILD OFF )
38
+
39
+ add_test (Issue2181 Issue2181 )
40
+
41
+ set_tests_properties (Issue2181
42
+ PROPERTIES
43
+ LABELS "Catch"
44
+ )
45
+
46
+ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
47
+ target_compile_options (Issue2181
48
+ PRIVATE
49
+ -Wno-keyword-macro # keyword is hidden by macro definition
50
+ )
51
+ endif ()
Original file line number Diff line number Diff line change
1
+ // ArduinoJson - https://arduinojson.org
2
+ // Copyright © 2014-2025, Benoit BLANCHON
3
+ // MIT License
4
+
5
+ #define true 0x1
6
+ #define false 0x0
7
+
8
+ #include < ArduinoJson.h>
9
+ #include < catch.hpp>
10
+
11
+ TEST_CASE (" Issue #2181" ) {
12
+ JsonDocument doc;
13
+ doc[" hello" ] = " world" ;
14
+ REQUIRE (doc.as <std::string>() == " {\" hello\" :\" world\" }" );
15
+ }
Original file line number Diff line number Diff line change 26
26
# endif
27
27
#endif
28
28
29
+ // Remove true and false macros defined by some cores, such as Arduino Due's
30
+ // See issues #2181 and arduino/ArduinoCore-sam#50
31
+ #ifdef true
32
+ # undef true
33
+ #endif
34
+ #ifdef false
35
+ # undef false
36
+ #endif
37
+
29
38
#include " ArduinoJson/Array/JsonArray.hpp"
30
39
#include " ArduinoJson/Object/JsonObject.hpp"
31
40
#include " ArduinoJson/Variant/JsonVariantConst.hpp"
You can’t perform that action at this time.
0 commit comments