@@ -1349,6 +1349,24 @@ TEST_CASE("MessagePack roundtrips", "[hide]")
13491349{
13501350 SECTION (" input from msgpack-python" )
13511351 {
1352+ // most of these are exluded due to differences in key order (not a real problem)
1353+ auto exclude_packed = std::set<std::string>{
1354+ " test/data/json.org/1.json" ,
1355+ " test/data/json.org/2.json" ,
1356+ " test/data/json.org/3.json" ,
1357+ " test/data/json.org/4.json" ,
1358+ " test/data/json.org/5.json" ,
1359+ " test/data/json_testsuite/sample.json" , // kills AppVeyor
1360+ " test/data/json_tests/pass1.json" ,
1361+ " test/data/regression/working_file.json" ,
1362+ " test/data/nst_json_testsuite/test_parsing/y_object.json" ,
1363+ " test/data/nst_json_testsuite/test_parsing/y_object_basic.json" ,
1364+ " test/data/nst_json_testsuite/test_parsing/y_object_duplicated_key.json" ,
1365+ " test/data/nst_json_testsuite/test_parsing/y_object_long_strings.json" ,
1366+ " test/data/nst_json_testsuite/test_parsing/y_object_simple.json" ,
1367+ " test/data/nst_json_testsuite/test_parsing/y_object_string_unicode.json" ,
1368+ };
1369+
13521370 for (std::string filename :
13531371 {
13541372 " test/data/json_nlohmann_tests/all_unicode.json" ,
@@ -1500,12 +1518,12 @@ TEST_CASE("MessagePack roundtrips", "[hide]")
15001518 {
15011519 CAPTURE (filename);
15021520
1503- // parse JSON file
1504- std::ifstream f_json (filename);
1505- json j1 = json::parse (f_json);
1506-
1507- SECTION (" std::vector<uint8_t>" )
1521+ SECTION (filename + " : std::vector<uint8_t>" )
15081522 {
1523+ // parse JSON file
1524+ std::ifstream f_json (filename);
1525+ json j1 = json::parse (f_json);
1526+
15091527 // parse MessagePack file
15101528 std::ifstream f_msgpack (filename + " .msgpack" , std::ios::binary);
15111529 std::vector<uint8_t > packed (
@@ -1518,8 +1536,12 @@ TEST_CASE("MessagePack roundtrips", "[hide]")
15181536 CHECK (j1 == j2);
15191537 }
15201538
1521- SECTION (" std::ifstream" )
1539+ SECTION (filename + " : std::ifstream" )
15221540 {
1541+ // parse JSON file
1542+ std::ifstream f_json (filename);
1543+ json j1 = json::parse (f_json);
1544+
15231545 // parse MessagePack file
15241546 std::ifstream f_msgpack (filename + " .msgpack" , std::ios::binary);
15251547 json j2;
@@ -1529,8 +1551,12 @@ TEST_CASE("MessagePack roundtrips", "[hide]")
15291551 CHECK (j1 == j2);
15301552 }
15311553
1532- SECTION (" uint8_t* and size" )
1554+ SECTION (filename + " : uint8_t* and size" )
15331555 {
1556+ // parse JSON file
1557+ std::ifstream f_json (filename);
1558+ json j1 = json::parse (f_json);
1559+
15341560 // parse MessagePack file
15351561 std::ifstream f_msgpack (filename + " .msgpack" , std::ios::binary);
15361562 std::vector<uint8_t > packed (
@@ -1543,19 +1569,26 @@ TEST_CASE("MessagePack roundtrips", "[hide]")
15431569 CHECK (j1 == j2);
15441570 }
15451571
1546- SECTION (" output to output adapters" )
1572+ SECTION (filename + " : output to output adapters" )
15471573 {
1574+ // parse JSON file
1575+ std::ifstream f_json (filename);
1576+ json j1 = json::parse (f_json);
1577+
15481578 // parse MessagePack file
15491579 std::ifstream f_msgpack (filename + " .msgpack" , std::ios::binary);
15501580 std::vector<uint8_t > packed (
15511581 (std::istreambuf_iterator<char >(f_msgpack)),
15521582 std::istreambuf_iterator<char >());
15531583
1554- SECTION ( " std::vector<uint8_t> " )
1584+ if (!exclude_packed. count (filename) )
15551585 {
1556- std::vector<uint8_t > vec;
1557- json::to_msgpack (j1, vec);
1558- CHECK (vec == packed);
1586+ SECTION (filename + " : output adapters: std::vector<uint8_t>" )
1587+ {
1588+ std::vector<uint8_t > vec;
1589+ json::to_msgpack (j1, vec);
1590+ CHECK (vec == packed);
1591+ }
15591592 }
15601593 }
15611594 }
0 commit comments