Commit Graph

132 Commits (b5364faf9d732052506cefc933d3f4e4f04513a5)

Author SHA1 Message Date
onqtam da5b7833a0 fixing the remaining of the pedantic gcc/clang target warnings 2019-03-31 13:57:44 +03:00
onqtam a0000c3235 finished the last of the warnings 2019-03-27 01:09:47 +02:00
onqtam 2b346099df Merge branch 'develop' of https://github.com/nlohmann/json into doctest 2019-03-24 17:21:44 +02:00
Niels Lohmann efa1b9a7bb
🔖 set version to 3.6.1 2019-03-20 20:50:05 +01:00
Niels Lohmann b37392b7ac
🔖 set version to 3.6.0 2019-03-20 00:19:07 +01:00
Viktor Kirilov 365944b0bc
Merge branch 'develop' into doctest 2019-03-18 16:59:36 +02:00
Niels Lohmann d359fd3a8d
🚧 trying nodiscard attribute #1433 2019-01-19 17:32:23 +01:00
onqtam 2f44ac1def moved from Catch to doctest for unit tests 2019-01-15 22:02:16 +02:00
Niels Lohmann 6f89613acd
🚨 fixed some warnings 2018-12-23 13:56:18 +01:00
Niels Lohmann 78348afeb6
🔖 set version to 3.5.0 2018-12-21 23:52:29 +01:00
Niels Lohmann 7b2f8cce03
🔖 set version to 3.4.0 2018-10-30 21:30:20 +01:00
Niels Lohmann dbb0b63187
improved error messages for binary formats #1288
This commit is the equivalent of #1282 for CBOR, MessagePack, and UBJSON.
2018-10-17 12:15:58 +02:00
Niels Lohmann 011b15dd08
added line positions to error messages
This is a follow-up to #1210.
2018-10-07 12:27:24 +02:00
Niels Lohmann b968faa882
🔖 set version to 3.3.0 2018-10-05 10:59:33 +02:00
Niels Lohmann 9f3857ef6f
🔖 set version to 3.2.0 2018-08-18 18:46:15 +02:00
Théo DELRIEU 442886d040
use templates in the sax interface instead of virtuals 2018-08-16 11:58:52 +02:00
Niels Lohmann fed70f6bff
🎨 reindented code 2018-08-14 22:11:08 +02:00
Michael Gmelin 05b27e83b7 Exclude bytewise comparison in certain tests.
These tests never worked - they weren't run before
d5aaeb4.

Note that these tests would fail because of this library
ordering dictionary keys (which is legal). So changing the
input files (or modifying stored cbor/msgpack/ubjson files)
would make the tests work and they could get removed from
"exclude_packaged".

Also move parsing of files in these unit tests to within
the inner sections, so that they're only parsed
number_of_files * number_of_sections instead of
number_of_files * number_of_files * number_of_sections
(so, instead of close to 100k parses about 700).
2018-07-29 14:52:52 +02:00
Michael Gmelin d5aaeb4cce Make section names unique in loops, as catch doesn't support duplicate
sections, see also https://github.com/catchorg/Catch2/issues/816#issuecomment-278268122

As a result, when built with gcc, loop iterations were skipped. When
built with clang, the test aborted with an assertion in catch.hpp
line 6222.

This also addresses the issues discussed here:
https://github.com/nlohmann/json/issues/1032#issuecomment-378707696

and here:
https://github.com/catchorg/Catch2/issues/1241

Please note that this introduces new problems, as some of
the unit tests fail now - the library stores keys in
lexographical order, while the cbor/msgpack/ubjson examples
store them in original order.
2018-07-29 10:44:36 +02:00
Niels Lohmann 5ff2abb90d
Merge branch 'develop' into feature/sax2 2018-05-06 13:29:23 +02:00
Niels Lohmann ed69e50ad2
📄 added SPDX-License-Identifier 2018-05-03 17:41:45 +02:00
Niels Lohmann b5d1755dfb
🔥 removed commented-out test cases #1060 2018-04-22 15:41:42 +02:00
Niels Lohmann 4f6b2b6429
🔨 changed SAX interface 2018-03-21 20:12:06 +01:00
Niels Lohmann 9e1abb4842
improved coverage 2018-03-20 22:39:08 +01:00
Niels Lohmann 1e38ffc014
more tests 2018-03-20 20:04:11 +01:00
Niels Lohmann 99ecca55c4
improved test coverage 2018-03-20 18:49:10 +01:00
Niels Lohmann 9e07e9b4ec
implemented non-throwing binary reader 2018-03-19 22:48:13 +01:00
Niels Lohmann afef474c0d
🔖 set version to 3.1.2 2018-03-14 21:09:27 +01:00
Niels Lohmann 938c861a09
🔖 set version to 3.1.1 2018-02-12 22:59:36 +01:00
Niels Lohmann 8b457ace25
🐛 fixing CBOR's indefinity length strings #961
Beside the fix discussed in #961, we also had to re-adjust a test case. It seems that it was failing before, and I "fixed" it to work with the broken implementation...
2018-02-06 20:43:03 +01:00
Niels Lohmann 0258484626
🔖 set version to 3.1.0
- updated documentation wrt. new repository layout
- temporarily switched off Homebrew --HEAD building (can only be switched on after release)
- set copyright date to 2018
2018-02-01 22:20:26 +01:00
Théo DELRIEU 14cd019861
fix cmake install directory (for real this time)
* Rename 'develop' folder to 'include/nlohmann'
* Rename 'src' folder to 'single_include/nlohmann'
* Use <nlohmann/*> headers in sources and tests
* Change amalgamate config file
2018-02-01 11:06:51 +01:00
Niels Lohmann 102c474397
🔨 clean up 2018-01-28 14:13:02 +01:00
Niels Lohmann 92484f0caf
🔖 set version to 3.0.1 2017-12-29 18:31:13 +01:00
Niels Lohmann 9e3c4ad11f
🔖 set version to 3.0.0 2017-12-17 08:31:18 +01:00
Niels Lohmann 569d275f65
💥 throwing an exception in case dump encounters a non-UTF-8 string #838
We had a lot of issues with failing roundtrips (i.e., parse errors from serializations) in case string were stored in the library that were not UTF-8 encoded. This PR adds an exception in this case.
2017-12-11 22:38:05 +01:00
Niels Lohmann 8af49d4be5
🚨 removing compiler warnings #755 2017-09-30 11:00:26 +02:00
Niels Lohmann 7410763731
improved test coverage 2017-09-10 11:42:43 +02:00
Niels Lohmann da97cf7895
improved test coverage 2017-09-10 10:21:53 +02:00
Niels Lohmann 8acaf5bdbc
🚨 fixing two compiler warnings 2017-08-20 19:31:07 +02:00
Niels Lohmann aba8b58492
🔨 approach to un-break the changes for #462 2017-08-16 20:11:05 +02:00
Niels Lohmann 22b59693f1
💥 CBOR/MessagePack input must end with EOF #505
The CBOR and MessagePack parsers now expect the input to be read until the end. Unless the new parameter "strict" is set to false (it is true by default), an exception is raised if the parser ends prematurely. This is a breaking change as the parsers ignored unread input so far.

Furthermore, the offset/startIndex paramter introduced in #462 was removed as this behavior can be mimicked with an iterator range. For instance, instead of calling "from_cbor(vec, 5);", you can write "from_cbor({vec.begin()+5, vec.end()});".
2017-08-16 14:48:23 +02:00
Niels Lohmann 5851daa576
binary formats can be stored in std::string, std::ofstreams or std::ostringstream #477 2017-07-28 00:21:55 +02:00
Niels Lohmann 4414f94cd5
🔨 using input/output adapters for CBOR and MessagePack
- You can now pass a reference to a vector to the to_cbor and to_msgpack functions. The output will be written (appended) to the vector. #476

- You can now pass an output stream with uint8_t character type to the to_cbor and to_msgpack functions. #477

- You can now read from uint8_t */size in the to_cbor and to_msgpack functions. An input adapter will be created from this pair, so you need to use braces. #478
2017-07-23 23:02:24 +02:00
Niels Lohmann 8b123107c0
🔨 fixed some pedantic GCC warnings 2017-07-07 22:41:22 +02:00
Niels Lohmann 2f007ca092
improved coverage 2017-06-20 22:03:36 +02:00
Niels Lohmann 6f99d5b2e9
🔨 fixed test case
One test case for CBOR and MessagePack assumed little endianess.
2017-04-08 23:39:17 +02:00
Niels Lohmann b15fc13dd1
🔨 implemented MessagePack in binary_reader 2017-04-04 16:59:19 +02:00
Niels Lohmann 89efe627fe
🔨 a lot of restructuring
- removed uncached input stream adapter; it was too slow anyway
- implemented a class binary_read which parses CBOR based on input
adapters
- in the CBOR parser, numbers are created via memcpy to avoid undefined
behavior
2017-04-02 18:46:21 +02:00
Niels Lohmann c5711f3072
🚧 a lot of minor changes
- Removed unused headers.
- Added override where needed.
- Added description for parse_error.113 exception.
- Fixed some conversion warnings.
- Integrated cbor_expect_string function for CBOR maps.
- Added documentation on the supported CBOR/MessagePack features.
- Added test to check all initial bytes for CBOR input.
2017-03-16 18:39:33 +01:00
Niels Lohmann 855cdcf05c
🔀 merge branch 'develop' into feature/exceptions_3.0.0 2017-03-12 20:22:30 +01:00
Niels Lohmann 8feaf8dc94
💥 implemented new handling of NaN and INF #70 #329 #388
- If an overflow occurs during parsing a number from a JSON text, an
exception (std::out_of_range for the moment, to be replaced by a
user-defined exception #244) is thrown so that the overflow is detected
early and roundtripping is guaranteed.
- NaN and INF floating-point values can be stored in a JSON value and
are not replaced by null. That is, the basic_json class behaves like
double in this regard (no exception occurs). However, NaN and INF are
serialized to “null”.
- Adjusted test cases appropriately.
2017-03-12 18:38:05 +01:00
Niels Lohmann c8a6ce79ea
🚑 fixing fuzzers to work with new exceptions 2017-03-08 18:37:03 +01:00
Niels Lohmann fc9b528ec9
🔨 changed an exception 2017-03-08 18:07:21 +01:00
Niels Lohmann 625cf7e3f7
🔨 added user-defined exception 112 2017-03-07 20:05:34 +01:00
Niels Lohmann 21ec0e7806
🔨 added user-defined exception 110 2017-03-06 21:00:13 +01:00
Niels Lohmann 27c65b860b
🔖 version 2.1.1 2017-02-25 16:34:38 +01:00
Niels Lohmann 8cec55a271
🚧 fixed more warnings 2017-02-22 18:14:29 +01:00
Niels Lohmann 1a6d7f5bca
🚧 try to fix some warnings in MSVC 2017-02-20 18:32:11 +01:00
Niels Lohmann 83f1d2c81b
added start index for from_cbor and from_msgpack (#462) 2017-02-19 21:17:05 +01:00
Niels Lohmann d870826811 🔖 set version to 2.1.0 2017-01-28 16:03:35 +01:00
Niels Lohmann 1ab26ab367 option to switch off exceptions 2017-01-16 22:11:07 +01:00
Niels Lohmann 8b46eb8ec0 📄 it's 2017 already 2017-01-02 09:40:00 +01:00
Niels Lohmann 60b3703c62 🔖 version bump to 2.0.10 2017-01-02 09:35:57 +01:00
Niels Lohmann d7029c37aa improved test coverage 2016-12-30 13:04:33 +01:00
Niels Lohmann 888f5b9f60 🚚 renamed test files to allow windows build 2016-12-28 12:18:48 +01:00
Niels Lohmann acb7e0558d 🚑 fixed bugs detected by AFL-Fuzz 2016-12-28 12:09:15 +01:00
Niels Lohmann 303e873ae8 🔖 bumped version to 2.0.9 2016-12-16 20:45:46 +01:00
Niels Lohmann 447e01427d 🚨 fixed some warnings 2016-12-12 18:21:17 +01:00
Niels Lohmann e8c903294f more test cases for CBOR and msgpack 2016-12-11 00:05:29 +01:00
Niels Lohmann 41673e8fed 🐛 fixed CBOR code and added test cases 2016-12-10 23:12:57 +01:00
Niels Lohmann d99c230f51 implemented indefinite-length CBOR types (#387) 2016-12-10 18:32:56 +01:00
Niels Lohmann 81a4272444 more test cases for CBOR 2016-12-07 23:14:37 +01:00
Niels Lohmann 3a0f5398a2 more CBOR test cases 2016-12-07 22:50:10 +01:00
Niels Lohmann b7e0c12966 CBOR support for half-precision floats 2016-12-07 21:43:59 +01:00
Niels Lohmann 17c9b17a7e test cases from RFC 7049 #384 2016-12-07 21:25:22 +01:00
Niels Lohmann 74571d531c 💚 still fixing the AppVeyor error 2016-12-07 16:34:02 +01:00
Niels Lohmann ba3c5e1a25 more test cases 2016-11-29 09:49:05 +01:00
Niels Lohmann c46b4ea990 more test cases 2016-11-29 08:37:27 +01:00
Niels Lohmann ee0f23fdc6 🚧 bug fixes and more tests 2016-11-28 23:20:03 +01:00
Niels Lohmann 93589e630c CBOR roundtrip tests 2016-11-27 17:47:56 +01:00
Niels Lohmann eef408e5fb tests for CBOR 2016-11-27 00:09:24 +01:00