Commit Graph

1463 Commits (b5364faf9d732052506cefc933d3f4e4f04513a5)

Author SHA1 Message Date
Niels Lohmann 7cf2fe149c
🚧 support for UBJSON high-precision numbers #2286 2020-07-20 09:42:37 +02:00
pf 7660ea12f6 [JSON] drop use of std::tie and std::tupe for operator== overload. valgrind and clang < 4 complain 2020-07-20 08:31:56 +01:00
pf 678d310b85 [JSON] don't know why CHECK doesn't like "CHECK(obj1 == obj2)". So using a temporary bool. 2020-07-19 21:29:39 +01:00
pf e83ddb185d [JSON] use CHECK from doctest 2020-07-19 21:25:27 +01:00
pf 254f0e3cee [JSON] CHECK in doctest only accepts std::string ? Use assert statement instead. Does the job 2020-07-19 18:22:16 +01:00
pf 578217eaa3 [JSON] doctest: need another section ? 2020-07-19 18:17:03 +01:00
pf 6d9b2040ab [JSON] as per Nlohmann's suggestion, added unit tests for the (de)serialisation macros 2020-07-19 18:12:13 +01:00
jprochazk 851315c878 add regression test 2020-07-19 18:35:58 +02:00
Niels Lohmann 2fd57d3ed1
add test for target_include_directories #1818 2020-07-17 14:26:22 +02:00
Niels Lohmann a10d486e36
Merge pull request #2244 from matthewbauer/tag-cbor
Tag binary values in cbor if set
2020-07-17 14:05:48 +02:00
Niels Lohmann e65cc9dccb
Merge pull request #2274 from nlohmann/analyzers
Clean up maintainer Makefiles and fix some linter warnings
2020-07-17 14:01:19 +02:00
Niels Lohmann 548e7e54c9
Merge pull request #2273 from nlohmann/issue1968
Add option to ignore CBOR tags
2020-07-17 13:59:55 +02:00
Niels Lohmann 6023a7ccd9
Merge branch 'develop' into analyzers 2020-07-17 13:59:32 +02:00
Niels Lohmann 26196f25f6
🔥 remove test Makefile targets (all handled by CMake) 2020-07-16 13:38:25 +02:00
Niels Lohmann 93cdf05928
add tests 2020-07-15 14:23:22 +02:00
Niels Lohmann b821ed074f
💡 add documentation 2020-07-15 13:45:16 +02:00
Niels Lohmann 496ddd127c
💚 make test deterministic 2020-07-15 12:14:30 +02:00
Niels Lohmann 9449dfcc6a
💚 add test cases for hash 2020-07-15 09:27:01 +02:00
Niels Lohmann e316f5c5b6
Merge pull request #2258 from nlohmann/issue2179
Add ordered_json specialization with ordered object keys
2020-07-12 13:11:23 +02:00
Niels Lohmann 4d28694756
♻️ replace further alternative operators 2020-07-11 19:28:58 +02:00
Niels Lohmann 738c83d6af
💚 add test for ordered_map 2020-07-11 19:24:32 +02:00
Niels Lohmann dc06f100be
Merge branch 'develop' of https://github.com/nlohmann/json into clang_windows
 Conflicts:
	include/nlohmann/detail/input/binary_reader.hpp
	include/nlohmann/detail/input/json_sax.hpp
	include/nlohmann/detail/input/lexer.hpp
	include/nlohmann/detail/input/parser.hpp
	include/nlohmann/detail/json_pointer.hpp
	include/nlohmann/detail/output/serializer.hpp
	include/nlohmann/json.hpp
	single_include/nlohmann/json.hpp
2020-07-11 14:04:40 +02:00
Niels Lohmann b2240f7508
🏁 remove failing code for Clang/Windows 2020-07-11 13:46:04 +02:00
Niels Lohmann 9c21285133
Merge branch 'develop' of https://github.com/nlohmann/json into issue2179
 Conflicts:
	single_include/nlohmann/json.hpp
2020-07-11 13:20:16 +02:00
Niels Lohmann 4c7bd014d9
Merge pull request #2242 from nlohmann/issue2239
Make assert configurable via JSON_ASSERT
2020-07-09 15:13:12 +02:00
Niels Lohmann f774a32d2b
fix test 2020-07-08 14:47:22 +02:00
Niels Lohmann e3e9ccfc02
🚑 fix regression from #2181 2020-07-08 14:02:28 +02:00
Niels Lohmann 1b04092c5c
fix test 2020-07-08 12:38:46 +02:00
Matthew Bauer dd08f7705f Add simple test for cbor byte 2020-07-06 18:06:10 -04:00
Niels Lohmann 28ef87370b
🚨 fix warning 2020-07-06 13:19:06 +02:00
Niels Lohmann 99fc6b16ab
Merge branch 'develop' of https://github.com/nlohmann/json into issue2239 2020-07-06 12:52:59 +02:00
Niels Lohmann ba8174041e
add test case for JSON_ASSERT 2020-07-06 12:52:48 +02:00
Niels Lohmann efcc826ecb
🚨 fix warning 2020-07-06 12:37:39 +02:00
Niels Lohmann f59f4a2b61
💚 fix build 2020-06-30 19:55:40 +02:00
Niels Lohmann c7e079cc98
🚑 add specialization of get_to #2175 2020-06-30 14:26:52 +02:00
Niels Lohmann eb7376bb13
Merge pull request #2225 from nlohmann/issue2175
Simplify conversion from/to custom types
2020-06-29 14:41:09 +02:00
Niels Lohmann ac3922c7aa
Merge branch 'develop' of https://github.com/nlohmann/json into clang_windows
 Conflicts:
	include/nlohmann/detail/input/binary_reader.hpp
	include/nlohmann/detail/input/input_adapters.hpp
	include/nlohmann/detail/input/lexer.hpp
	include/nlohmann/detail/output/binary_writer.hpp
	include/nlohmann/json.hpp
	single_include/nlohmann/json.hpp
2020-06-27 13:14:48 +02:00
Niels Lohmann 3948b5b091
Merge pull request #2212 from nlohmann/comments
Add option to ignore comments in parse/accept functions
2020-06-27 12:44:51 +02:00
gatopeich cf18ba2394 Test initialization with dup keys 2020-06-23 17:50:51 +01:00
gatopeich 49623a75ee Revert "Using ordered_json instead of fifo_map in test-regression"
This reverts commit 5fe3d3929a.
2020-06-23 11:30:52 +01:00
Niels Lohmann 4bfe4add20
Merge pull request #2203 from t-b/use-unsigned-indizies-for-array-index-in-json-pointer
Use unsigned indizies for array index in json pointer
2020-06-23 09:16:01 +02:00
gatopeich 5fe3d3929a Using ordered_json instead of fifo_map in test-regression
This is more comprehensive and the "my_workaround_fifo_map" wrapper does not allow to infer value type as required in this branch.

This reverts commit 064a9c9212.
2020-06-22 19:10:35 +01:00
Thomas Braun ecbb2756fd json_pointer::array_index: Use unsigned values for the array index when parsing
The current code uses std::stoi to convert the input string to an int
array_index. This limits the maximum addressable array size to ~2GB on
most platforms.

But all callers immediately convert the result of array_index to
BasicJsonType::size_type.

So let's parse it as unsigned long long, which allows us to have as
big arrays as available memory. And also makes the call sites nicer to
read.

One complication arises on platforms where size_type is smaller than
unsigned long long. We need to bail out on these if the parsed array
index does not fit into size_type.
2020-06-22 13:42:55 +02:00
Niels Lohmann 29ad2178c6
Merge pull request #2176 from gracicot/cpp20-support-no-std-fct-templ-specialization
C++20 support by removing swap specialization
2020-06-21 20:39:58 +02:00
Niels Lohmann e22ce45065
🚸 improve diagnostics 2020-06-21 13:28:00 +02:00
Niels Lohmann 139a0258cc
Merge branch 'develop' of https://github.com/nlohmann/json into comments 2020-06-21 12:40:21 +02:00
Niels Lohmann 0fe9f23254
add macros from #2175 2020-06-20 14:11:37 +02:00
Niels Lohmann e4675887a6
Merge branch 'develop' of https://github.com/nlohmann/json into issue2189 2020-06-20 09:47:12 +02:00
Niels Lohmann 4fd0d02b6f
🚧 toward an ordered_json type 2020-06-19 15:27:05 +02:00
Niels Lohmann 0585ecc56b
add tests for comment skipping 2020-06-19 13:10:35 +02:00
Niels Lohmann 74520d8bb0
🚧 extend API 2020-06-17 22:03:14 +02:00
Niels Lohmann 88a37010d6
🐛 serialize 32-bit floating-point numbers as float 32 in MessagePack (0xCA) #2196 2020-06-17 21:14:23 +02:00
Niels Lohmann e86b3fae98
🔧 add label to tests that require a git checkout 2020-06-17 12:35:59 +02:00
Niels Lohmann 4d96f4cf6a
🔧 overwork CMake files 2020-06-16 20:23:01 +02:00
Niels Lohmann b53c6e2f81
ignore comments 2020-06-16 12:28:59 +02:00
Niels Lohmann 5f862710fe
🔖 set version to 3.8.0 2020-06-14 17:16:45 +02:00
Tanuj Garg c3c5c03ea3 added fuzzing with different values to default argument in to_ubjson method 2020-06-10 20:50:25 +05:30
Niels Lohmann 262d9cc67d
🚨 fix a maybe-uninitialized warning 2020-06-09 16:57:06 +02:00
Niels Lohmann 2cf16625ac
add test for character types 2020-06-07 22:49:39 +02:00
Niels Lohmann d4bc0c39af
add test for character types 2020-06-07 22:47:54 +02:00
Guillaume Racicot 82fbbeeac5 Adapted unit tests to use ADL calls for swap like the new swappable concept 2020-06-06 12:28:52 -04:00
Niels Lohmann bf2e714e96
🚨 fix warnings 2020-06-06 14:30:17 +02:00
Niels Lohmann 7444c7fa25
Merge pull request #2145 from FrancoisChabot/1813-user-input
Fix Issue#1813: user defined input adapters
2020-06-05 14:30:39 +02:00
Niels Lohmann dd7e25927f
🚨 fix warning 2020-06-05 08:27:15 +02:00
Niels Lohmann 5fe6b83c26
Merge pull request #2158 from dota17/output_adapter
Fix PR#1006
2020-06-05 08:25:19 +02:00
Niels Lohmann 65c4b07451
🎨 replace alternative operators (and, not, or) 2020-06-03 21:22:07 +02:00
chenguoping eca4b8785c fix test case in PR#1006 2020-06-02 15:44:26 +08:00
chenguoping 8cd39578e3 add test case 2020-06-01 11:34:03 +08:00
Francois Chabot 897061c434 amalgamate 2020-05-28 10:11:19 -04:00
Niels Lohmann 5ff4d7b7ff
Merge branch 'develop' of https://github.com/nlohmann/json into develop 2020-05-28 12:54:13 +02:00
Francois Chabot d3caf93ab0
Merge branch 'develop' into 1813-user-input 2020-05-28 03:40:34 -04:00
Francois Chabot 3a91a05db6 added custom input to readme 2020-05-28 03:13:39 -04:00
Francois Chabot f1969e60a3 reamalgamate 2020-05-27 12:56:26 -04:00
Francois Chabot 5684d9a498 unified input API 2020-05-27 12:40:04 -04:00
Niels Lohmann 325e8ab8ab
🔧 explicitly switch on tests in CI 2020-05-27 13:22:14 +02:00
Niels Lohmann 225fa58f16
🚧 add fix from #1715 2020-05-20 22:20:40 +02:00
Niels Lohmann a82c80e9af
Merge pull request #2125 from nlohmann/binary_type
Clean up implementation of binary type
2020-05-20 18:58:29 +02:00
Niels Lohmann 4d39644bd0
💚 fix build 2020-05-19 13:45:52 +02:00
Niels Lohmann 21b1680ea1
🚚 rename binary_array() to binary() 2020-05-19 13:30:22 +02:00
Niels Lohmann 79347b484b
improve test coverage 2020-05-19 12:40:32 +02:00
Niels Lohmann b7ff40029a
💥 change serialization of binary values 2020-05-18 13:53:20 +02:00
Niels Lohmann 9eb19bcc27
add more tests for binary type 2020-05-18 12:33:26 +02:00
gistrec 9e765f5aed Fixed std::numeric_limit::max() call 2020-05-18 10:25:55 +00:00
Niels Lohmann 904642f261
♻️ rename internal_binary_t with binary_t 2020-05-17 22:50:27 +02:00
Niels Lohmann dead99eb0e
🔨 overwork binary subtypes 2020-05-17 13:51:59 +02:00
Niels Lohmann ab6e76dd05
Merge branches 'binary_type' and 'develop' of https://github.com/nlohmann/json into binary_type 2020-05-17 12:27:58 +02:00
Niels Lohmann 28e20bd9e4
🚨 fix warnings #2113 2020-05-16 14:26:17 +02:00
Niels Lohmann c0cf67ead3
Merge branch 'develop' of https://github.com/nlohmann/json into binary_type 2020-05-16 12:58:13 +02:00
Niels Lohmann f40a9f876a
Merge pull request #2044 from dota17/issue#1719
Fix issue#1719
2020-05-16 12:57:00 +02:00
chenguoping ed9c205b5d add somes test cases 2020-05-15 21:48:29 +08:00
Niels Lohmann daf2d296dd
♻️ move wrapped binary type to separate file 2020-05-15 14:12:32 +02:00
chenguoping 779a0ec7df update 2020-05-15 17:35:43 +08:00
chenguoping 47c6570470 Add some test cases about to_cbor() 2020-05-14 15:11:38 +08:00
Niels Lohmann 0857140839
Merge pull request #1950 from FrancoisChabot/issues/1457
templated input adapters
2020-05-14 07:52:02 +02:00
Niels Lohmann d7b032f565
add tests to improve coverage 2020-05-13 21:28:43 +02:00
Niels Lohmann a4266bbb7d
Merge branch 'develop' into issues/1457 2020-05-13 12:48:46 +02:00
Niels Lohmann a414e35971
🚨 add newline to end of file 2020-05-13 12:35:11 +02:00
Niels Lohmann 6014419818
Merge branches 'develop' and 'issue2082' of https://github.com/nlohmann/json into issue2082 2020-05-12 12:28:34 +02:00
Niels Lohmann 76c01501f7
🔧 fix pedantic maintainer targets 2020-05-11 20:03:13 +02:00
Niels Lohmann 5c42847011
add tests for binary type 2020-05-10 13:23:18 +02:00
Niels Lohmann fff46ea98c
add tests for binary type 2020-05-09 23:18:12 +02:00
Niels Lohmann 34430994bf
add tests for binary type 2020-05-09 14:16:57 +02:00
Niels Lohmann 3fa94f0755
add tests for binary type 2020-05-09 13:46:24 +02:00
Niels Lohmann f0c6ab4d3b
🐛 fix bug in SAX callback parser 2020-05-08 14:21:11 +02:00
Niels Lohmann 5bfb27c865
🚨 fix some warnings 2020-05-08 12:32:28 +02:00
Niels Lohmann cf4a6552f3
add tests for binary serialization 2020-05-06 22:24:48 +02:00
Niels Lohmann 3cd2a977ae
add test for get_ptr<binary_t*> 2020-05-06 22:13:55 +02:00
Niels Lohmann 1d6f7b0d4e
add tests for binary serialization 2020-05-06 22:13:31 +02:00
Niels Lohmann ddff459fa3
add test for BSON binary subtype 2020-05-06 21:24:00 +02:00
Niels Lohmann 2b39efd545
add tests for binary type 2020-05-05 12:59:57 +02:00
Niels Lohmann 908941b87d
fix test cases 2020-05-05 07:47:20 +02:00
Niels Lohmann 2a34f4cd63
add tests for binary type 2020-05-04 22:07:50 +02:00
Niels Lohmann a50a14088c
Merge pull request #2081 from nlohmann/external_test_data
Use external test data
2020-05-04 20:58:02 +02:00
Niels Lohmann e7a88b2d7f
💚 fix AppVeyor and Travis builds 2020-05-03 19:33:01 +02:00
Niels Lohmann 24237af983
🎨 fix format 2020-05-03 13:40:23 +02:00
Niels Lohmann 2f0d37d7d2
🔥 remove fastcov 2020-05-02 23:48:11 +02:00
Niels Lohmann 929f5d398c
🔨 fix coverage tests 2020-05-02 23:24:21 +02:00
Niels Lohmann 752c62b4bd
🔨 remove double tests 2020-05-02 16:07:09 +02:00
Niels Lohmann f0050c9ba0
Merge pull request #2019 from dota17/contains_v2
fix #1982:json_pointer.contains() exception is incorrectly raised
2020-05-02 11:04:57 +02:00
Niels Lohmann bec554936c
🔨 fix paths 2020-05-02 10:56:01 +02:00
Niels Lohmann cfb2f34ebb
🔨 fix benchmarks 2020-05-01 20:59:47 +02:00
Niels Lohmann ec5cfdd307
🔨 properly find and use Git 2020-05-01 16:18:04 +02:00
Niels Lohmann 7ade3a0efb
remove dependency to FetchContent 2020-05-01 15:14:37 +02:00
Niels Lohmann dbf1a1f413
♻️ download test data from external repository 2020-05-01 14:32:37 +02:00
Niels Lohmann c9f404dc98
Merge pull request #2076 from rmisev/patch-1
Fix error message about invalid surrogate pairs
2020-05-01 12:47:39 +02:00
Niels Lohmann b27d8a3253
Merge pull request #2074 from ArthurSonzogni/develop
Add CMake fetchcontent documentation and tests
2020-05-01 12:42:29 +02:00
Rimas Misevičius 6f1800889a Fix tests 2020-05-01 00:59:12 +03:00
Rimas Misevičius 4c053e3ec9 Fix tests 2020-05-01 00:48:24 +03:00
ArthurSonzogni c331706644 Add CMake fetchcontent documentation and tests
Github issue:
https://github.com/nlohmann/json/issues/2073

nlohmann::json documents 2 way of depending on it using CMake
1) Copy-paste the project/source into your own project.
2) Install nlohman::json and then use find_package.

(1) pollutes your git repository, (2) requires everyone to install the
dependencies themselves.

Since 2018, CMake provide some kind of 'package manager' features using
[FetchContent](https://cmake.org/cmake/help/v3.17/module/FetchContent.html)
It gives the following:
~~~cmake
include(FetchContent)

FetchContent_Declare(json
  GIT_REPOSITORY https://github.com/nlohmann/json
  GIT_TAG v3.7.3)

FetchContent_GetProperties(json)
if(NOT json_POPULATED)
  FetchContent_Populate(json)
  add_subdirectory( ${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
~~~

Then declares the dependency in the target using it:
~~~cmake
target_link_library(my_project PRIVATE nlohmann_json::nlohmann_json
~~~

This patch updates the documentation and provides tests.
2020-04-29 18:28:06 +02:00
Niels Lohmann 2e5727d778
🐛 properly pass serialize_binary to dump function #2067 2020-04-27 15:10:23 +02:00
Niels Lohmann 9e0180b698
🐛 fix returning reference to local temporary object #2064 2020-04-27 14:43:49 +02:00
Niels Lohmann 63afc8e3f8
Merge pull request #2043 from dota17/unit-constructor1
Add missing testcase about NaN in unit-constructor1.cpp
2020-04-21 07:35:44 +02:00
Niels Lohmann a29e3b1318
Merge pull request #2054 from nlohmann/feature/issue1983
Fix bug in diff function
2020-04-20 19:44:35 +02:00
Niels Lohmann c0a39b22a6
🚨 fix compiler warning 2020-04-20 19:42:58 +02:00
Niels Lohmann 3607687a14
Merge pull request #2053 from nlohmann/gcc10warnings
Fix GCC compiler warnings
2020-04-20 08:05:42 +02:00
Niels Lohmann 721a1a0b5d
Merge pull request #2051 from nlohmann/clang10warnings
Fix Clang compiler warnings
2020-04-20 08:04:23 +02:00
chenguoping c379d02b3e Add missing testcase about NaN in unit-constructor1.cpp 2020-04-20 10:25:44 +08:00
Niels Lohmann e8356928bd
🚨 fix compiler warnings #2052 2020-04-19 13:25:02 +02:00
Niels Lohmann 4fb0795ec1
🚨 fix compiler warnings #2049 2020-04-19 13:01:36 +02:00
Niels Lohmann 45d5b09425
⬆️ doctest 2.3.7 #2048 2020-04-19 12:33:42 +02:00
Niels Lohmann f2b43a36b2
Merge pull request #1662 from OmnipotentEntity/develop
Add binary type support to all binary file formats, as well as an internally represented binary type
2020-04-16 11:14:32 +02:00
Michael Reilly 012c9665ac Add binary type support to all binary file formats, as well as an internally represented binary type 2020-04-14 10:22:45 -04:00
Niels Lohmann dd04a32918
🐛 fix bug in diff function #1983 2020-04-13 14:35:36 +02:00
chenguoping f5a487d1b4 fix issue1982: contains() exceptions are incorrectly raised 2020-04-13 19:41:13 +08:00
Niels Lohmann b7be613b6e
Merge pull request #1990 from dota17/json_pointer
catch exceptions for json_pointer : ..../+99
2020-04-13 13:29:33 +02:00
Niels Lohmann 6121fc52cf
🎨 fix indentation 2020-04-10 13:22:58 +02:00
Artöm Bakri Al-Sarmini 8db02bcc55 Fix for gcc 2020-04-08 15:53:14 +03:00
Artöm Bakri Al-Sarmini fec0bdd93b still fixing 2020-04-08 00:42:03 +03:00
Artöm Bakri Al-Sarmini 4ce31695f1 Fixed formatting, trying to fix msvc build error in appveyor 2020-04-08 00:26:43 +03:00
Artöm Bakri Al-Sarmini a74a031bba Fix build error 2020-04-02 15:47:08 +03:00
Artöm Bakri Al-Sarmini e4d8dc02e8 Fixes #1971 (memory leak in basic_json::push_back) 2020-04-02 15:20:25 +03:00
chenguoping e07686f0c7 update array_index() and add testcases 2020-03-25 15:57:20 +08:00
Francois Chabot 7eadd6daef added back forward declaration to address warnings 2020-02-28 18:15:11 -05:00
Francois Chabot 2e2cf02cfd duck-typed object input adapters 2020-02-19 14:59:31 -05:00
Francois Chabot 617b3cf42e templated input adapters 2020-02-19 10:32:49 -05:00
Antoine Cœur 8d92ca865f Some typos 2020-02-02 17:29:37 +08:00
Sonu Lohani 4c1ebb4413
Fix warning: ignoring return value 2019-12-16 14:22:41 +05:30
Niels Lohmann 7439cfe5c8
Merge pull request #1844 from Tridacnid/develop
Update tests that generate CMake projects to use main project's C++ compiler
2019-11-19 19:27:14 +01:00
Michael Balszun 25e0175bc3 Remove unnecessary warning suppressions in test cmake file 2019-11-19 11:26:35 +01:00
Joe Burzinski fbb0bd7556 Update tests that generate CMake projects to use the CMAKE_CXX_COMPILER the main project was CMake'd with. Fixes #1747. 2019-11-18 21:46:34 -06:00
Niels Lohmann c5eafe74e8
🔖 set version to 3.7.3 2019-11-17 12:09:12 +01:00
Niels Lohmann 56109eacd7
🔖 set version to 3.7.2 2019-11-10 21:23:39 +01:00
Isaac Nickaein 7e2445a0f4 Move deep JSON test to a separate unit-test 2019-11-09 21:42:39 +03:30
Isaac Nickaein 68d0a7b246 Reduce depth in unit-test to avoid choking valgrind 2019-11-09 21:19:12 +03:30
Isaac Nickaein eec1974218 Merge remote-tracking branch 'nlohmann/develop' into iterate-on-destruction 2019-11-09 14:50:48 +03:30
Niels Lohmann 1a9de88117
🚨 fix a linter warning
Coverity detected two "Memory - illegal accesses  (OVERRUN)" issues. Resizing the buffer should silence this warning.
2019-11-07 08:00:21 +01:00
Niels Lohmann aacdc6bbe3
🔖 set version to 3.7.1 2019-11-06 18:37:26 +01:00
Niels Lohmann 1e9f16dff0
🚨 fix linter errors 2019-11-05 20:25:53 +01:00
Niels Lohmann c0ae88bf50
🚨 fix linter errors 2019-11-05 20:23:17 +01:00
Niels Lohmann 7bcaba0ca9
Merge pull request #1821 from AnthonyVH/develop
Fix for #1647
2019-11-05 19:15:54 +01:00
Niels Lohmann 1ca6f2901b
Merge pull request #1826 from cbegue/develop
Add restriction for tuple specialization of to_json
2019-11-05 19:14:37 +01:00
Niels Lohmann abccafa5c5
⬆️ upgrade Doctest to 2.3.5 2019-11-05 19:11:54 +01:00
Anthony VH c4923e3d05 Merge remote-tracking branch 'upstream/develop' into develop 2019-11-04 20:50:43 +01:00
Anthony VH ec9647ae63 Moved test for #1647 regression to regressions file. 2019-11-04 20:45:24 +01:00
Camille Bégué 8b686b30eb Add restriction for tuple specialization of to_json
This commit fix the issue #1825

Signed-off-by: Camille Bégué <c.begue@samsung.com>
2019-11-04 09:57:16 +01:00
Niels Lohmann dfe53c36da
🚨 fix UBSAN warnings 2019-11-03 13:48:25 +01:00
Niels Lohmann 4d1e4c6d93
Merge pull request #1780 from t-b/add-msvc-16-2019
appveyor.yml: Add MSVC 16 2019 support
2019-11-02 08:16:53 +01:00
Niels Lohmann a1828bbf57
Merge pull request #1806 from cbegue/develop
Fix issue #1805
2019-11-01 19:46:19 +01:00
Camille Bégué 794a3d411a Fix issue #1805
* Add some restriction on pair partial specialization of to_json

Signed-off-by: Camille Bégué <camille.begue.pro@gmail.com>
2019-10-31 18:04:15 +01:00
Anthony Van Herrewege fb9a2643c8 Add test for #1647. 2019-10-30 15:46:31 +01:00
Niels Lohmann 507d5676ad
🚨 fix warning 2019-10-23 20:57:10 +02:00
Florian Pigorsch b93d414a35 Fix some spelling errors - mostly in comments & documentation.
I did not touch the Changelog file and any third party stuff.

additonal -> additional (1)
apppend -> append (2)
constuctor -> constructor (2)
contect -> context (2)
dobulequote -> doublequote (1)
elemnts -> elements (1)
exakt -> exact (2)
exluded -> exclude (1)
explicitely -> explicitly (2)
narcissic -> narcissistic (1)
ocurred -> occurred (1)
occuring -> occurring (2)
preceeds -> preceded (1)
ot -> to (2)
wehther -> whether (2)
2019-10-19 11:59:51 +02:00
Thomas Braun 35b47c2793 iteration_proxy: Fix integer truncation from std::size_t to int
Bug introduced in 0f073e26 (Allow items() to be used with custom string,
2019-09-26).
2019-10-16 20:00:05 +02:00
Thomas Braun 5541a2bd25 test/cmake_import: Pass the generator platform required by MSVC 2019 2019-10-16 17:10:19 +02:00
Thomas Braun eb6fe421ae test/CMakeLists.txt: Use an explicit list instead of GLOB
Using GLOB is slow and considered bad practice.

From https://cmake.org/cmake/help/latest/command/file.html:

> We do not recommend using GLOB to collect a list of source files from
> your source tree. If no CMakeLists.txt file changes when a source is
> added or removed then the generated build system cannot know when to ask
> CMake to regenerate. The CONFIGURE_DEPENDS flag may not work reliably on
> all generators, or if a new generator is added in the future that cannot
> support it, projects using it will be stuck. Even if CONFIGURE_DEPENDS
> works reliably, there is still a cost to perform the check on every
> rebuild.
2019-10-07 21:13:09 +02:00
Niels Lohmann d187488e0d
Merge pull request #1765 from crazyjul/fix/items-with-alt-string
Allow items() to be used with custom string
2019-10-05 22:11:14 +02:00
christian 7476f5ee0c Make json_pointer::back const (resolves #1764) 2019-10-01 00:57:27 +02:00
Julien Hamaide 0f073e26eb Allow items() to be used with custom string 2019-09-26 13:20:57 +02:00
Miguel Sacristan e26a2904fc Fix and add test's for SFINAE problem 2019-09-10 21:36:23 +02:00
Niels Lohmann 06ccd43a2a
Merge pull request #1722 from t-b/fix-int64-min-issue
Fix int64 min issue
2019-09-10 07:58:02 +02:00
Thomas Braun 8067c3ca5b Add serialization unit tests for extreme integer values 2019-09-03 13:55:19 +02:00
Thomas Braun 70aa8a31a2 Add regression test for dumping the minimum value of int64_t 2019-09-03 13:55:19 +02:00
Thomas Braun 9ea3e19121 .travis/cmake: Rework clang sanitizer invocation
- Switch to clang-7
- Adapt PATH so that llvm-symbolizer can be found for useful stacktraces
- Adapt compile flags
  "-O0" ensures much faster compile times
  "-fno-sanitize-recover=all
  -fsanitize-recover=unsigned-integer-overflow" this fails the build on
  all issues except unsigned integer overflows. Not failing in this case
  is required in combination with the sanitizer suppression file as only
  recoverable errors can be suppressed.

The UBSAN suppression file ignores errors from stl_bvector.h (which
holds std::vector<bool>).

Clang reports that error as

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_bvector.h:158:20 in

      Start 34: test-deserialization_all
28/88 Test #71: test-testsuites_default .............***Failed    0.32 sec
/usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_bvector.h:158:20: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned int'
    #0 0x628f72 in std::_Bit_iterator_base::_M_bump_down() /usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_bvector.h:158:20
    #1 0x628d16 in std::_Bit_iterator::operator--() /usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_bvector.h:251:7
    #2 0x634aac in std::vector<bool, std::allocator<bool> >::pop_back() /usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_bvector.h:1010:7
    #3 0x61eff0 in bool nlohmann::detail::parser<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer> >::sax_parse_internal<nlohmann::detail::json_sax_dom_parser<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer> > >(nlohmann::detail::json_sax_dom_parser<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer> >*) /home/firma/devel/json/include/nlohmann/detail/input/parser.hpp:439:28
    #4 0x604864 in nlohmann::detail::parser<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer> >::parse(bool, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>&) /home/firma/devel/json/include/nlohmann/detail/input/parser.hpp:116:13
    #5 0x5f8079 in nlohmann::operator>>(std::istream&, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>&) /home/firma/devel/json/include/nlohmann/json.hpp:6356:42
    #6 0x5e1d92 in _DOCTEST_ANON_FUNC_21() /home/firma/devel/json/test/src/unit-testsuites.cpp:343:9
    #7 0x7207fe in doctest::Context::run() /home/firma/devel/json/test/thirdparty/doctest/doctest.h:5938:21
    #8 0x72681a in main /home/firma/devel/json/test/thirdparty/doctest/doctest.h:6016:71
    #9 0x7f75d22362e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
    #10 0x4c28b9 in _start (/home/firma/devel/json/build/test/test-testsuites+0x4c28b9)

The pop_back() in parser.hpp

      assert(not states.empty());
  ->  states.pop_back();

triggers the UBSAN report. But the assertion above ensure that we only
call pop_back() on an non-empty vector, therefore this is a STL library
bug and thus must be ignored for us.
2019-09-03 13:22:03 +02:00
Thomas Braun f0bff49ffd test/CMakeLists.txt: Remove trailing whitespace 2019-09-03 13:22:03 +02:00
Niels Lohmann 48e1fe03b5
🔖 set version to 3.7.0 2019-07-28 20:20:41 +02:00
Niels Lohmann a501365ea2
Merge branch 'feature/hedley' into develop 2019-07-14 20:58:08 +02:00
Niels Lohmann b17440c12f
🚨 fix compiler warnings 2019-07-12 21:05:16 +02:00
Niels Lohmann 104c5c1996
Merge branch 'feature/json_pointer_contains' into develop 2019-07-09 08:08:56 +02:00
Niels Lohmann 7a23aa1c0d
Merge branch 'feature/emplace_back' into develop 2019-07-09 08:06:27 +02:00
Niels Lohmann 947656544d
🚨 fix warnings 2019-07-02 21:06:42 +02:00