Commit Graph

1463 Commits (b5364faf9d732052506cefc933d3f4e4f04513a5)

Author SHA1 Message Date
Niels Lohmann 7b98df515f
add regression test 2020-12-29 14:48:18 +01:00
Jaakko Moisio 467f622c65 Fix compilation of input_adapter(container) in edge cases
This fixes a compilation issue with the library if trying to use containers that
don't have non-member `begin()` and `end()` functions via ADL.

This patch extends the `using std::begin` and `using std::end` declarations to
also cover the return type deduction of the input_adapter() template
specialization for containers. The previous implementation only enabled the
detection of `std::begin()` and `std::end()` in the function body, making the
specialization unusable for container types that only have member `begin()` and
`end()` functions.

It is not typical to have `using` declarations in the namespace scope in a
header file. But a C++11 implementation can't rely on fully automatic return
type deduction, and needs to rely on ADL enabled helper templates. To prevent
the using declarations leaking, they are enclosed in another nested namespace.
2020-12-28 22:21:02 +01:00
Niels Lohmann f15d447522
🚨 fix warnings 2020-12-26 14:55:19 +01:00
Alexander Karzhenkov cd7acc1dc5 Include <string_view> in "nlohmann/json.hpp" when C++17 is used 2020-12-20 19:40:36 +05:00
Alexander Karzhenkov 39b8d6bd33 Restore intentionally disrupted C++17 tests 2020-12-20 12:43:35 +05:00
Alexander Karzhenkov 8247a217bb Disrupt all C++17 tests to check if they are executed 2020-12-19 18:58:49 +05:00
Krylov Yaroslav a1772743a1
Doctest is updated to v2.4.3 2020-12-18 07:27:22 +03:00
Niels Lohmann c026e1a475
🚨 fix warnings 2020-12-16 21:44:35 +01:00
Krylov Yaroslav 6390fca71a
Doctest is updated to v2.4.1 2020-12-12 05:27:03 +03:00
Krylov Yaroslav 972c15f26e
ordered_map::insert(InputIt first, InputIt last) is added 2020-12-07 20:15:41 +03:00
Krylov Yaroslav 5155cc2c48
Ranged insert test section is added in unit-ordered_json.cpp 2020-12-07 19:47:41 +03:00
Niels Lohmann 1047d09b2a
annotate non-reproducible tests #2324 2020-08-30 13:23:34 +02:00
Niels Lohmann 9d726c25d5
♻️ remove "#define private public" 2020-08-12 13:30:06 +02:00
Niels Lohmann 4080d0b1a4
add test to compile without exceptions 2020-08-10 09:48:11 +02:00
Niels Lohmann b3e5cb7f20
🔖 set version to 3.9.1 2020-08-06 13:45:29 +02:00
Niels Lohmann 3888b1642a
🐛 fix lexer to properly cope with repeated comments #2330 2020-07-31 18:59:22 +02:00
Niels Lohmann 2326abc547
♻️ split regression tests 2020-07-30 12:13:05 +02:00
Niels Lohmann f13af83a94
🐛 add more functions from std::map to nlohmann::ordered_map 2020-07-28 21:47:06 +02:00
Niels Lohmann e590604822
🐛 fix a bug due to missing overloads in ordered_map container 2020-07-28 14:20:31 +02:00
Niels Lohmann e110667d21
🔖 set version to 3.9.0 2020-07-27 15:48:09 +02:00
Niels Lohmann e22cbacc41
🚨 fix warning 2020-07-26 12:12:17 +02:00
Niels Lohmann 67ed63b196
Merge pull request #2312 from nlohmann/docs
Update documentation
2020-07-26 10:06:01 +02:00
Niels Lohmann a34070d36a
fix test for meta() function 2020-07-25 22:28:14 +02:00
Niels Lohmann 42f8708940
Merge branch 'develop' of https://github.com/nlohmann/json into issue2286
 Conflicts:
	single_include/nlohmann/json.hpp
2020-07-25 21:44:58 +02:00
Niels Lohmann 40b78d3847
Merge pull request #2308 from nlohmann/cbor_tags
Fix bug in CBOR tag handling
2020-07-25 19:43:11 +02:00
Niels Lohmann 448ceb2e12
Merge pull request #2303 from nlohmann/cleanup
Cleanup
2020-07-25 05:41:51 +02:00
Niels Lohmann 480ad529e3
🐛 fix bug in CBOR tag handling 2020-07-24 14:18:39 +02:00
Niels Lohmann 33662417c1
improve coverage 2020-07-24 09:32:03 +02:00
Niels Lohmann 0cd120f7e1
🚨 fix UBSAN warning 2020-07-23 14:06:09 +02:00
Niels Lohmann bba57cc4af
🚨 fix UBSAN warning 2020-07-23 14:02:49 +02:00
Niels Lohmann e571c67c0d
🚨 fix implicit conversion warning when opening binary file 2020-07-23 14:02:12 +02:00
Niels Lohmann 43e07bb92d
Merge pull request #2301 from nlohmann/regression2281
Add test with multiple translation units
2020-07-23 13:14:24 +02:00
Niels Lohmann 8159091d8f
🔀 rename variable to avoid shadowing 2020-07-23 12:58:09 +02:00
Niels Lohmann a33c3fdf25
Merge branch 'develop' of https://github.com/nlohmann/json into issue2286
 Conflicts:
	single_include/nlohmann/json.hpp
2020-07-23 12:30:07 +02:00
Niels Lohmann a048b72fe1
Merge pull request #1559 from theodelrieu/feat/explicit_conversion_operator
Feat/explicit conversion operator
2020-07-23 08:52:51 +02:00
Niels Lohmann a6d112ffbf
add regression test for #2281 2020-07-22 13:39:40 +02:00
Niels Lohmann 2301bd1177
add regression test for #2281 2020-07-22 13:24:07 +02:00
Niels Lohmann c4356c68e0
add regression test for #2281 2020-07-22 12:38:39 +02:00
Niels Lohmann 4d63252c6c
add regression test for #2281 2020-07-22 12:23:58 +02:00
Niels Lohmann a7c4c84d68
add regression test for #2281 2020-07-22 12:03:37 +02:00
Théo DELRIEU 74b446f5fd
add a switch to enable implicit conversions (defaults to true)
wrap implicit conversions tests around the JSON_USE_IMPLICIT_CONVERSIONS
macro
2020-07-22 10:49:01 +02:00
Niels Lohmann 8b14c9b305
🚨 fix warnings 2020-07-21 23:00:56 +02:00
Niels Lohmann 3249a4d821
Merge branch 'develop' of https://github.com/nlohmann/json into issue2286
 Conflicts:
	single_include/nlohmann/json.hpp
2020-07-21 22:01:32 +02:00
Niels Lohmann 96e9f66025
🔇 remove debug output 2020-07-21 22:01:15 +02:00
Niels Lohmann 8046754c15
🔊 add debug output to tests 2020-07-21 12:44:38 +02:00
Niels Lohmann a9117828e1
🚨 fix warnings 2020-07-20 22:38:00 +02:00
Niels Lohmann 8344857764
Merge pull request #2287 from pfeatherstone/develop
Serialisation macros: increase upper bound on number of member variables
2020-07-20 21:35:55 +02:00
Niels Lohmann 8aa6da61dc
🚧 support for UBJSON high-precision numbers #2286 2020-07-20 13:57:19 +02:00
Niels Lohmann 7360e09830
🚧 support for UBJSON high-precision numbers #2286 2020-07-20 13:12:20 +02:00
pf 35b899e988 [JSON] initialise all member variables. Maybe this will shut valgrind up. std::tie probably wasn't the problem initially 2020-07-20 10:51:43 +01:00
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