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:
Michael Gmelin
2018-07-29 11:57:56 +02:00
parent d5aaeb4cce
commit 05b27e83b7
3 changed files with 95 additions and 20 deletions

View File

@@ -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(