Merge branch 'develop' of https://github.com/nlohmann/json into issue2286

 Conflicts:
	single_include/nlohmann/json.hpp
This commit is contained in:
Niels Lohmann
2020-07-25 21:44:58 +02:00
22 changed files with 2770 additions and 2785 deletions

View File

@@ -36,6 +36,7 @@ using nlohmann::json;
#include <fstream>
#include <set>
#include <test_data.hpp>
#include <test_utils.hpp>
namespace
{
@@ -2508,11 +2509,8 @@ TEST_CASE("UBJSON roundtrips" * doctest::skip())
std::ifstream f_json(filename);
json j1 = json::parse(f_json);
// parse MessagePack file
std::ifstream f_ubjson(filename + ".ubjson", std::ios::binary);
std::vector<uint8_t> packed(
(std::istreambuf_iterator<char>(f_ubjson)),
std::istreambuf_iterator<char>());
// parse UBJSON file
auto packed = utils::read_binary_file(filename + ".ubjson");
json j2;
CHECK_NOTHROW(j2 = json::from_ubjson(packed));
@@ -2526,7 +2524,7 @@ TEST_CASE("UBJSON roundtrips" * doctest::skip())
std::ifstream f_json(filename);
json j1 = json::parse(f_json);
// parse MessagePack file
// parse UBJSON file
std::ifstream f_ubjson(filename + ".ubjson", std::ios::binary);
json j2;
CHECK_NOTHROW(j2 = json::from_ubjson(f_ubjson));
@@ -2541,11 +2539,8 @@ TEST_CASE("UBJSON roundtrips" * doctest::skip())
std::ifstream f_json(filename);
json j1 = json::parse(f_json);
// parse MessagePack file
std::ifstream f_ubjson(filename + ".ubjson", std::ios::binary);
std::vector<uint8_t> packed(
(std::istreambuf_iterator<char>(f_ubjson)),
std::istreambuf_iterator<char>());
// parse UBJSON file
auto packed = utils::read_binary_file(filename + ".ubjson");
json j2;
CHECK_NOTHROW(j2 = json::from_ubjson({packed.data(), packed.size()}));
@@ -2559,11 +2554,8 @@ TEST_CASE("UBJSON roundtrips" * doctest::skip())
std::ifstream f_json(filename);
json j1 = json::parse(f_json);
// parse MessagePack file
std::ifstream f_ubjson(filename + ".ubjson", std::ios::binary);
std::vector<uint8_t> packed(
(std::istreambuf_iterator<char>(f_ubjson)),
std::istreambuf_iterator<char>());
// parse UBJSON file
auto packed = utils::read_binary_file(filename + ".ubjson");
{
INFO_WITH_TEMP(filename + ": output adapters: std::vector<uint8_t>");