Commit Graph

4377 Commits

Author SHA1 Message Date
Qianqian Fang
5786991973 polish patch to remove ci errors 2022-04-23 09:00:59 -04:00
Qianqian Fang
4c9dd311bd partially fix ci errors, add tests to improve coverage 2022-04-23 09:00:59 -04:00
Qianqian Fang
069b4d68f1 encode and decode bjdata ndarray in jdata annotations, enable roundtrip tests 2022-04-23 09:00:59 -04:00
Qianqian Fang
be6cdaa4b9 fix ci error, remove unwanted param comment 2022-04-23 09:00:59 -04:00
Qianqian Fang
45a7c365ee make use_bjdata a non-default parameter 2022-04-23 09:00:59 -04:00
Qianqian Fang
6b9da3bf0a code polishing following @gregmarr's feedback 2022-04-23 09:00:59 -04:00
Qianqian Fang
ee9e078a5c amalgamate code 2022-04-23 09:00:12 -04:00
Qianqian Fang
4615c4b7cc update BJData Spect V1 Draft-2 URL after spec release 2022-04-23 09:00:12 -04:00
Qianqian Fang
8083430a7a revert order to avoid msvc 2015 unreferenced formal param error 2022-04-23 09:00:12 -04:00
Qianqian Fang
8dd4a61ad6 pass use_bjdata via output adapter 2022-04-23 09:00:12 -04:00
Qianqian Fang
7589b604aa move is_bjdata to an optional param to write_ubjson 2022-04-23 09:00:12 -04:00
Qianqian Fang
53855c14d4 remove the unwanted assert 2022-04-23 09:00:12 -04:00
Qianqian Fang
29c7a4365f make is_bjdata const after using initializer list 2022-04-23 09:00:12 -04:00
Qianqian Fang
d5e590efe3 fix ci errors, add tests for new bjdata switch structure 2022-04-23 09:00:12 -04:00
Qianqian Fang
ed8c4c681d move bjdata new markers from default to the same level as ubjson markers 2022-04-23 09:00:12 -04:00
Qianqian Fang
e9d0f420bc full coverage, I hope 2022-04-23 09:00:12 -04:00
Qianqian Fang
122e9fc7e8 remove broken test due to alloc limit 2022-04-23 09:00:12 -04:00
Qianqian Fang
408144ae73 simplify endian condition, format unit-bjdata 2022-04-23 08:59:47 -04:00
Qianqian Fang
9e723360c7 fix No newline at end of file error by clang 2022-04-23 08:59:47 -04:00
Qianqian Fang
5a485d56a3 add half precision error test 2022-04-23 08:59:47 -04:00
Qianqian Fang
3d211b883d complete test coverage, fix ci_test errors 2022-04-23 08:59:47 -04:00
Qianqian Fang
6fc779005c fix ci_test errors 2022-04-23 08:59:47 -04:00
Qianqian Fang
42701cc2fc gcc warn useless conversion but msvc gives an error 2022-04-23 08:59:29 -04:00
Qianqian Fang
c8752b349f add tests for optimized ndarray, improve coverage, fix clang/gcc warnings 2022-04-23 08:59:29 -04:00
Qianqian Fang
55682ffb5a add more tests to cover the new bjdata types 2022-04-23 08:59:29 -04:00
Qianqian Fang
4985323bb7 fix additional warnings and errors for clang and msvc 2022-04-23 08:59:29 -04:00
Qianqian Fang
76ee885fd2 fix more VS compilation errors 2022-04-23 08:59:14 -04:00
Qianqian Fang
58efde83f0 fix additional VS errors 2022-04-23 08:59:14 -04:00
Qianqian Fang
94b0268cc2 partially fix VS compilation errors 2022-04-23 08:59:14 -04:00
Qianqian Fang
02d8f926f0 fix Codacy warning 2022-04-23 08:59:14 -04:00
Qianqian Fang
3c820dd215 support UBJSON-derived Binary JData (BJData) format 2022-04-23 08:59:14 -04:00
Florian Albrechtskirchinger
1a90c9463a
Disable regression test for #3070 on GCC <8.4 (#3451) 2022-04-22 14:21:16 +02:00
JungHoon Lee
a94430615d
Fix typo in basic_json documentation (#3439) 2022-04-12 15:58:06 +02:00
Florian Albrechtskirchinger
616caea27a
Re-template json_pointer on string type (#3415)
* Make exception context optional

Change exception context parameter to pointer and replace context with
nullptr where appropriate.

* Support escaping other string types

* Add string concatenation function

Add variadic concat() function for concatenating char *, char, and
string types.

* Replace string concatenations using + with concat()

* Template json_pointer on string type

Change json_pointer from being templated on basic_json to being
templated on string type.

* Add unit test for #3388

Closes #3388.

* Fix regression test for #2958

* Add backwards compatibility with json_pointer<basic_json>

* Update json_pointer docs

* Allow comparing different json_pointers

* Update version numbers
2022-04-12 14:18:16 +02:00
Florian Albrechtskirchinger
1deeb434c6
Exclude std::any from implicit conversion (fixes #3428) (#3437)
* Exclude std::any from implicit conversion

Fixes #3428 (MSVC) and silences compiler warning on GCC (-Wconversion).

* Exclude std::any from implicit conversion
2022-04-12 14:08:20 +02:00
Niels Lohmann
10344907ff
📝 document which version introduced the macros #3429 (#3431) 2022-04-09 18:09:23 +02:00
Florian Albrechtskirchinger
261cc4e509
Fix constraints on from_json() for strings (#3427)
Constrain from_json() overload for StringType to not accept json_ref and
require it to be assignable, instead of constructible, from
basic_json::string_t.

Re-enable C++14 tests on Clang <4.0.

Fixes #3171.
Fixes #3267.
Fixes #3312.
Fixes #3384.
2022-04-08 10:22:47 +02:00
Michael Nosthoff
15fa6a342a
at.md: fix typo (#3426) 2022-04-06 15:26:35 +02:00
Niels Lohmann
448b173ccf
Update CI image (#3420)
* ⬆️ use new CI image

* ⬆️ use new CI image

* 🚨 suppress Clang-Tidy warnings

* 💚 use proper scan-build version

* 🚨 suppress Clang-Tidy warnings

* ⬆️ use more recent GitHub actions

* 💚 add missing compiler

* 📝 update used compilers

* 🚨 fix duplicate inclusion
2022-04-06 15:14:14 +02:00
Niels Lohmann
52e16a9f9c
🚸 add check if different version is also included #3337 (#3418) 2022-04-06 08:29:01 +02:00
Florian Albrechtskirchinger
fa91409a73
CI: speedup AppVeyor builds by ~30% (#3422)
AppVeyor build VMs should provide at least two cores. Parallelize builds
and tests.
In addition, enable output on failure and disable verbose test output.
2022-04-06 08:26:49 +02:00
Florian Albrechtskirchinger
c2054b96b9
Restore disabled check for #3070 (except on MSVC) (#3421)
Restore the previously disabled check for regression #3070 on all
compilers but MSVC.

To summarize the issue:
Given namespace fs = std::filesystem.
On MSVC attempting to construct an fs::path from json results in an
ambiguous overload resolution because fs::path can be constructed from
both a std::string as well as another fs::path.
To the best of my knowledge there is no way to fix an ambiguous overload
situation involving a type we do not control and with json implicitly
converting to both std::string and fs::path.

Re-enabling the check where it compiles and keeping it disabled for MSVC
is the best we can do.

Closes #3377 and #3382.
2022-04-06 08:25:35 +02:00
flagarde
ab5cecb34f
Report the right __cplusplus value for MSVC in basic_json meta() (#3417)
* Report the right __cplusplus value for MSVC in basic_json meta()

* Run amalgamate
2022-04-04 20:45:19 +02:00
Florian Albrechtskirchinger
33b75e513a
CI: windows-2016 has been deprecated; remove jobs (#3416) 2022-04-04 13:18:00 +02:00
DarkZeros
6121dbbe02
Avoid clash with Arduino defines (#3338)
* Avoid clash with Arduino defines

* Arduino defines B0/B1 in "binary.h"
     #define B0 0
     #define B1 1
  This clashes with names of the template
  variables in conjuction

* Renaming them to "B" rather than "B1"
  Now it can be used as-is in Arduino projects

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Daniel Ansorregui <d.ansorregui@samsung.com>
Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
2022-04-03 18:33:33 +02:00
Krzysiek Karbowiak
3b16057ffa
Refactor unit tests to use more convenient doctest assertion macros (Part 2) (#3405)
* Refactor assertion and adjust expected error message

* Refactor assertion and adjust expected error message

* Refactor assertion and remove redundant local variable

* Refactor assertion and remove redundant local variable

* Rename local variable

* Apply formatting
2022-04-01 14:38:17 +02:00
Niels Lohmann
66f6b4b6a0
🔧 overwork issue template #3348 2022-03-25 10:16:21 +01:00
Niels Lohmann
1ba736893e
🔧 overwork issue template #3348 2022-03-25 10:12:33 +01:00
Niels Lohmann
f7490e33da
🔧 overwork issue template #3348 2022-03-25 10:10:21 +01:00
Krzysiek Karbowiak
ce35256825
Refactor unit tests to use more convenient doctest assertion macros (#3393)
* Add missing check

* Refactor assertions in unit-algorithms.cpp

* Refactor assertions in unit-bson.cpp

* Refactor assertions in unit-cbor.cpp

* Refactor assertions in unit-class_const_iterator.cpp

* Refactor assertions in unit-class_iterator.cpp

* Refactor assertions in unit-class_parser.cpp

* Refactor assertions in unit-constructor1.cpp

* Refactor assertions in unit-convenience.cpp

* Refactor assertions in unit-conversions.cpp

* Refactor assertions in unit-deserialization.cpp

* Refactor assertions in unit-element_access1.cpp

* Refactor assertions in unit-element_access2.cpp

* Refactor assertions in unit-iterators1.cpp

* Refactor assertions in unit-iterators2.cpp

* Refactor assertions in unit-json_patch.cpp

* Refactor assertions in unit-json_pointer.cpp

* Refactor assertions in unit-modifiers.cpp

* Refactor assertions in unit-msgpack.cpp

* Refactor assertions in unit-reference_access.cpp

* Refactor assertions in unit-regression1.cpp

* Refactor assertions in unit-serialization.cpp

* Refactor assertions in unit-ubjson.cpp

* Refactor assertions in unit-unicode1.cpp

* Apply formatting
2022-03-24 15:55:35 +01:00