mirror of
https://github.com/nlohmann/json.git
synced 2026-03-13 12:41:25 +00:00
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).
This commit is contained in:
@@ -2199,12 +2199,12 @@ TEST_CASE("UBJSON roundtrips", "[hide]")
|
||||
{
|
||||
CAPTURE(filename);
|
||||
|
||||
// parse JSON file
|
||||
std::ifstream f_json(filename);
|
||||
json j1 = json::parse(f_json);
|
||||
|
||||
SECTION(filename + ": std::vector<uint8_t>")
|
||||
{
|
||||
// parse JSON file
|
||||
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(
|
||||
@@ -2219,6 +2219,10 @@ TEST_CASE("UBJSON roundtrips", "[hide]")
|
||||
|
||||
SECTION(filename + ": std::ifstream")
|
||||
{
|
||||
// parse JSON file
|
||||
std::ifstream f_json(filename);
|
||||
json j1 = json::parse(f_json);
|
||||
|
||||
// parse MessagePack file
|
||||
std::ifstream f_ubjson(filename + ".ubjson", std::ios::binary);
|
||||
json j2;
|
||||
@@ -2230,6 +2234,10 @@ TEST_CASE("UBJSON roundtrips", "[hide]")
|
||||
|
||||
SECTION(filename + ": uint8_t* and size")
|
||||
{
|
||||
// parse JSON file
|
||||
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(
|
||||
@@ -2244,6 +2252,10 @@ TEST_CASE("UBJSON roundtrips", "[hide]")
|
||||
|
||||
SECTION(filename + ": output to output adapters")
|
||||
{
|
||||
// parse JSON file
|
||||
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(
|
||||
|
||||
Reference in New Issue
Block a user