Lines Matching full:json
2 // __| | __| | | | JSON for Modern C++ (supporting code)
4 // |_____|_____|_____|_|___| https://github.com/nlohmann/json
12 #include <nlohmann/json.hpp>
13 using nlohmann::json;
42 bool number_integer(json::number_integer_t /*unused*/) in number_integer()
47 bool number_unsigned(json::number_unsigned_t /*unused*/) in number_unsigned()
52 bool number_float(json::number_float_t /*unused*/, const std::string& /*unused*/) in number_float()
92 …bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/, const json::exception& /*u… in parse_error()
215 …nlohmann::detail::binary_reader<json, decltype(ia)> br{std::move(ia), json::input_format_t::bjdata…
226 json j = json::value_t::discarded;
227 const auto result = json::to_bjdata(j);
233 json j = nullptr;
235 const auto result = json::to_bjdata(j);
239 CHECK(json::from_bjdata(result) == j);
240 CHECK(json::from_bjdata(result, true, false) == j);
247 json j = true;
249 const auto result = json::to_bjdata(j);
253 CHECK(json::from_bjdata(result) == j);
254 CHECK(json::from_bjdata(result, true, false) == j);
259 json j = false;
261 const auto result = json::to_bjdata(j);
265 CHECK(json::from_bjdata(result) == j);
266 CHECK(json::from_bjdata(result, true, false) == j);
292 // create JSON value with integer number
293 json j = i;
311 const auto result = json::to_bjdata(j);
328 CHECK(json::from_bjdata(result) == j);
329 CHECK(json::from_bjdata(result, true, false) == j);
347 // create JSON value with integer number
348 json j = i;
362 const auto result = json::to_bjdata(j);
375 CHECK(json::from_bjdata(result) == j);
376 CHECK(json::from_bjdata(result, true, false) == j);
386 // create JSON value with integer number
387 json j = i;
399 const auto result = json::to_bjdata(j);
409 CHECK(json::from_bjdata(result) == j);
410 CHECK(json::from_bjdata(result, true, false) == j);
416 json j = -9263;
420 const auto result = json::to_bjdata(j);
430 CHECK(json::from_bjdata(result) == j);
431 CHECK(json::from_bjdata(result, true, false) == j);
440 // create JSON value with integer number
441 json j = i;
452 const auto result = json::to_bjdata(j);
461 CHECK(json::from_bjdata(result) == j);
462 CHECK(json::from_bjdata(result, true, false) == j);
472 // create JSON value with integer number
473 json j = -1;
474 … j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(i);
485 const auto result = json::to_bjdata(j);
494 CHECK(json::from_bjdata(result) == j);
495 CHECK(json::from_bjdata(result, true, false) == j);
505 // create JSON value with integer number
506 json j = -1;
507 … j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(i);
518 const auto result = json::to_bjdata(j);
527 CHECK(json::from_bjdata(result) == j);
528 CHECK(json::from_bjdata(result, true, false) == j);
538 // create JSON value with integer number
539 json j = -1;
540 … j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(i);
552 const auto result = json::to_bjdata(j);
562 CHECK(json::from_bjdata(result) == j);
563 CHECK(json::from_bjdata(result, true, false) == j);
576 // create JSON value with integer number
577 json j = -1;
578 … j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(i);
590 const auto result = json::to_bjdata(j);
600 CHECK(json::from_bjdata(result) == j);
601 CHECK(json::from_bjdata(result, true, false) == j);
614 // create JSON value with integer number
615 json j = -1;
616 … j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(i);
630 const auto result = json::to_bjdata(j);
643 CHECK(json::from_bjdata(result) == j);
644 CHECK(json::from_bjdata(result, true, false) == j);
657 // create JSON value with integer number
658 json j = -1;
659 … j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(i);
673 const auto result = json::to_bjdata(j);
686 CHECK(json::from_bjdata(result) == j);
687 CHECK(json::from_bjdata(result, true, false) == j);
698 // create JSON value with integer number
699 json j = -1;
700 … j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(i);
718 const auto result = json::to_bjdata(j);
735 CHECK(json::from_bjdata(result) == j);
736 CHECK(json::from_bjdata(result, true, false) == j);
747 // create JSON value with integer number
748 json j = i;
766 const auto result = json::to_bjdata(j);
783 CHECK(json::from_bjdata(result) == j);
784 CHECK(json::from_bjdata(result, true, false) == j);
797 // create JSON value with unsigned integer number
798 json j = i;
809 const auto result = json::to_bjdata(j);
819 CHECK(json::from_bjdata(result) == j);
820 CHECK(json::from_bjdata(result, true, false) == j);
830 // create JSON value with unsigned integer number
831 json j = i;
842 const auto result = json::to_bjdata(j);
852 CHECK(json::from_bjdata(result) == j);
853 CHECK(json::from_bjdata(result, true, false) == j);
863 // create JSON value with unsigned integer number
864 json j = i;
876 const auto result = json::to_bjdata(j);
886 CHECK(json::from_bjdata(result) == j);
887 CHECK(json::from_bjdata(result, true, false) == j);
900 // create JSON value with unsigned integer number
901 json j = i;
913 const auto result = json::to_bjdata(j);
923 CHECK(json::from_bjdata(result) == j);
924 CHECK(json::from_bjdata(result, true, false) == j);
936 // create JSON value with unsigned integer number
937 json j = i;
951 const auto result = json::to_bjdata(j);
964 CHECK(json::from_bjdata(result) == j);
965 CHECK(json::from_bjdata(result, true, false) == j);
978 // create JSON value with unsigned integer number
979 json j = i;
993 const auto result = json::to_bjdata(j);
1006 CHECK(json::from_bjdata(result) == j);
1007 CHECK(json::from_bjdata(result, true, false) == j);
1018 // create JSON value with integer number
1019 json j = i;
1037 const auto result = json::to_bjdata(j);
1054 CHECK(json::from_bjdata(result) == j);
1055 CHECK(json::from_bjdata(result, true, false) == j);
1066 // create JSON value with integer number
1067 json j = i;
1085 const auto result = json::to_bjdata(j);
1102 CHECK(json::from_bjdata(result) == j);
1103 CHECK(json::from_bjdata(result, true, false) == j);
1112 json j = v;
1117 const auto result = json::to_bjdata(j);
1121 CHECK(json::from_bjdata(result) == j);
1122 CHECK(json::from_bjdata(result) == v);
1123 CHECK(json::from_bjdata(result, true, false) == j);
1131 … CHECK(json::parse("0.0") == json::from_bjdata(std::vector<uint8_t>({'h', 0x00, 0x00})));
1132 … CHECK(json::parse("-0.0") == json::from_bjdata(std::vector<uint8_t>({'h', 0x00, 0x80})));
1133 … CHECK(json::parse("1.0") == json::from_bjdata(std::vector<uint8_t>({'h', 0x00, 0x3c})));
1134 … CHECK(json::parse("1.5") == json::from_bjdata(std::vector<uint8_t>({'h', 0x00, 0x3e})));
1135 … CHECK(json::parse("65504.0") == json::from_bjdata(std::vector<uint8_t>({'h', 0xff, 0x7b})));
1142 json _;
1144 …json::from_bjdata(vec0), "[json.exception.parse_error.110] parse error at byte 2: syntax error whi…
1145 CHECK(json::from_bjdata(vec0, true, false).is_discarded());
1150 json _;
1152 …json::from_bjdata(vec1), "[json.exception.parse_error.110] parse error at byte 3: syntax error whi…
1153 CHECK(json::from_bjdata(vec1, true, false).is_discarded());
1164 json j = json::from_bjdata(std::vector<uint8_t>({'h', 0x00, 0x00}));
1165 json::number_float_t d{j};
1171 json j = json::from_bjdata(std::vector<uint8_t>({'h', 0x00, 0x80}));
1172 json::number_float_t d{j};
1178 json j = json::from_bjdata(std::vector<uint8_t>({'h', 0x01, 0x00}));
1179 json::number_float_t d{j};
1188 json j = json::from_bjdata(std::vector<uint8_t>({'h', 0x00, 0x7c}));
1189 json::number_float_t d{j};
1190 CHECK(d == std::numeric_limits<json::number_float_t>::infinity());
1196 json j = json::from_bjdata(std::vector<uint8_t>({'h', 0x00, 0xfc}));
1197 json::number_float_t d{j};
1198 CHECK(d == -std::numeric_limits<json::number_float_t>::infinity());
1207 json j = json::from_bjdata(std::vector<uint8_t>({'h', 0x00, 0x3c}));
1208 json::number_float_t d{j};
1214 json j = json::from_bjdata(std::vector<uint8_t>({'h', 0x00, 0xc0}));
1215 json::number_float_t d{j};
1221 json j = json::from_bjdata(std::vector<uint8_t>({'h', 0xff, 0x7b}));
1222 json::number_float_t d{j};
1229 json j = json::from_bjdata(std::vector<uint8_t>({'h', 0x00, 0x7c}));
1230 json::number_float_t d{j};
1237 json j = json::from_bjdata(std::vector<uint8_t>({'h', 0x00, 0x7e }));
1238 json::number_float_t d{j};
1249 const auto j = json::from_bjdata(vec);
1257 const auto j = json::from_bjdata(vec);
1265 const auto j = json::from_bjdata(vec);
1274 CHECK(json::from_bjdata(vec0, true, false).is_discarded());
1277 CHECK(json::from_bjdata(vec1, true, false).is_discarded());
1279 json _;
1281 …json::from_bjdata(vec2), "[json.exception.parse_error.115] parse error at byte 5: syntax error whi…
1283 …json::from_bjdata(vec3), "[json.exception.parse_error.115] parse error at byte 5: syntax error whi…
1285 …json::from_bjdata(vec4), "[json.exception.parse_error.113] parse error at byte 2: syntax error whi…
1298 // create JSON value with string containing of N * 'x'
1300 json j = s;
1313 const auto result = json::to_bjdata(j);
1323 CHECK(json::from_bjdata(result) == j);
1324 CHECK(json::from_bjdata(result, true, false) == j);
1334 // create JSON value with string containing of N * 'x'
1336 json j = s;
1349 const auto result = json::to_bjdata(j);
1356 CHECK(json::from_bjdata(result) == j);
1357 CHECK(json::from_bjdata(result, true, false) == j);
1370 // create JSON value with string containing of N * 'x'
1372 json j = s;
1383 const auto result = json::to_bjdata(j);
1390 CHECK(json::from_bjdata(result) == j);
1391 CHECK(json::from_bjdata(result, true, false) == j);
1404 // create JSON value with string containing of N * 'x'
1406 json j = s;
1417 const auto result = json::to_bjdata(j);
1424 CHECK(json::from_bjdata(result) == j);
1425 CHECK(json::from_bjdata(result, true, false) == j);
1438 // create JSON value with string containing of N * 'x'
1440 json j = s;
1453 const auto result = json::to_bjdata(j);
1460 CHECK(json::from_bjdata(result) == j);
1461 CHECK(json::from_bjdata(result, true, false) == j);
1475 // create JSON value with byte array containing of N * 'x'
1477 json j = json::binary(s);
1496 const auto result = json::to_bjdata(j, true, true);
1514 json j_out = s;
1515 CHECK(json::from_bjdata(result) == j_out);
1516 CHECK(json::from_bjdata(result, true, false) == j_out);
1526 // create JSON value with byte array containing of N * 'x'
1528 json j = json::binary(s);
1544 const auto result = json::to_bjdata(j, true, true);
1551 json j_out = s;
1552 CHECK(json::from_bjdata(result) == j_out);
1553 CHECK(json::from_bjdata(result, true, false) == j_out);
1566 // create JSON value with byte array containing of N * 'x'
1568 json j = json::binary(s);
1581 const auto result = json::to_bjdata(j, true, true);
1588 json j_out = s;
1589 CHECK(json::from_bjdata(result) == j_out);
1590 CHECK(json::from_bjdata(result, true, false) == j_out);
1603 // create JSON value with byte array containing of N * 'x'
1605 json j = json::binary(s);
1618 const auto result = json::to_bjdata(j, true, true);
1625 json j_out = s;
1626 CHECK(json::from_bjdata(result) == j_out);
1627 CHECK(json::from_bjdata(result, true, false) == j_out);
1640 // create JSON value with byte array containing of N * 'x'
1642 json j = json::binary(s);
1657 const auto result = json::to_bjdata(j, true, true);
1664 json j_out = s;
1665 CHECK(json::from_bjdata(result) == j_out);
1666 CHECK(json::from_bjdata(result, true, false) == j_out);
1674 json j = json::binary(s);
1688 const auto result = json::to_bjdata(j, false, false);
1695 json j_out = s;
1696 CHECK(json::from_bjdata(result) == j_out);
1697 CHECK(json::from_bjdata(result, true, false) == j_out);
1715 const auto result = json::to_bjdata(j, true, false);
1722 json j_out = s;
1723 CHECK(json::from_bjdata(result) == j_out);
1724 CHECK(json::from_bjdata(result, true, false) == j_out);
1734 json j = json::array();
1736 const auto result = json::to_bjdata(j);
1740 CHECK(json::from_bjdata(result) == j);
1741 CHECK(json::from_bjdata(result, true, false) == j);
1746 json j = json::array();
1748 const auto result = json::to_bjdata(j, true);
1752 CHECK(json::from_bjdata(result) == j);
1753 CHECK(json::from_bjdata(result, true, false) == j);
1758 json j = json::array();
1760 const auto result = json::to_bjdata(j, true, true);
1764 CHECK(json::from_bjdata(result) == j);
1765 CHECK(json::from_bjdata(result, true, false) == j);
1773 json j = {nullptr};
1775 const auto result = json::to_bjdata(j);
1779 CHECK(json::from_bjdata(result) == j);
1780 CHECK(json::from_bjdata(result, true, false) == j);
1785 json j = {nullptr};
1787 const auto result = json::to_bjdata(j, true);
1791 CHECK(json::from_bjdata(result) == j);
1792 CHECK(json::from_bjdata(result, true, false) == j);
1797 json j = {nullptr};
1799 const auto result = json::to_bjdata(j, true, true);
1803 CHECK(json::from_bjdata(result) == j);
1804 CHECK(json::from_bjdata(result, true, false) == j);
1812 json j = json::parse("[1,2,3,4,5]");
1814 const auto result = json::to_bjdata(j);
1818 CHECK(json::from_bjdata(result) == j);
1819 CHECK(json::from_bjdata(result, true, false) == j);
1824 json j = json::parse("[1,2,3,4,5]");
1826 const auto result = json::to_bjdata(j, true);
1830 CHECK(json::from_bjdata(result) == j);
1831 CHECK(json::from_bjdata(result, true, false) == j);
1836 json j = json::parse("[1,2,3,4,5]");
1838 const auto result = json::to_bjdata(j, true, true);
1842 CHECK(json::from_bjdata(result) == j);
1843 CHECK(json::from_bjdata(result, true, false) == j);
1851 json j = json::parse("[[[[]]]]");
1853 const auto result = json::to_bjdata(j);
1857 CHECK(json::from_bjdata(result) == j);
1858 CHECK(json::from_bjdata(result, true, false) == j);
1863 json j = json::parse("[[[[]]]]");
1865 const auto result = json::to_bjdata(j, true);
1869 CHECK(json::from_bjdata(result) == j);
1870 CHECK(json::from_bjdata(result, true, false) == j);
1875 json j = json::parse("[[[[]]]]");
1877 const auto result = json::to_bjdata(j, true, true);
1881 CHECK(json::from_bjdata(result) == j);
1882 CHECK(json::from_bjdata(result, true, false) == j);
1890 json j(257, nullptr);
1894 const auto result = json::to_bjdata(j);
1898 CHECK(json::from_bjdata(result) == j);
1899 CHECK(json::from_bjdata(result, true, false) == j);
1904 json j(257, nullptr);
1911 const auto result = json::to_bjdata(j, true);
1915 CHECK(json::from_bjdata(result) == j);
1916 CHECK(json::from_bjdata(result, true, false) == j);
1924 json j(32768, nullptr);
1928 const auto result = json::to_bjdata(j);
1932 CHECK(json::from_bjdata(result) == j);
1933 CHECK(json::from_bjdata(result, true, false) == j);
1938 json j(32768, nullptr);
1945 const auto result = json::to_bjdata(j, true);
1949 CHECK(json::from_bjdata(result) == j);
1950 CHECK(json::from_bjdata(result, true, false) == j);
1958 json j(65793, nullptr);
1962 const auto result = json::to_bjdata(j);
1966 CHECK(json::from_bjdata(result) == j);
1967 CHECK(json::from_bjdata(result, true, false) == j);
1972 json j(65793, nullptr);
1981 const auto result = json::to_bjdata(j, true);
1985 CHECK(json::from_bjdata(result) == j);
1986 CHECK(json::from_bjdata(result, true, false) == j);
1997 json j = json::object();
1999 const auto result = json::to_bjdata(j);
2003 CHECK(json::from_bjdata(result) == j);
2004 CHECK(json::from_bjdata(result, true, false) == j);
2009 json j = json::object();
2011 const auto result = json::to_bjdata(j, true);
2015 CHECK(json::from_bjdata(result) == j);
2016 CHECK(json::from_bjdata(result, true, false) == j);
2021 json j = json::object();
2023 const auto result = json::to_bjdata(j, true, true);
2027 CHECK(json::from_bjdata(result) == j);
2028 CHECK(json::from_bjdata(result, true, false) == j);
2036 json j = {{"", nullptr}};
2038 const auto result = json::to_bjdata(j);
2042 CHECK(json::from_bjdata(result) == j);
2043 CHECK(json::from_bjdata(result, true, false) == j);
2048 json j = {{"", nullptr}};
2050 const auto result = json::to_bjdata(j, true);
2054 CHECK(json::from_bjdata(result) == j);
2055 CHECK(json::from_bjdata(result, true, false) == j);
2063 json j = json::parse(R"({"a": {"b": {"c": {}}}})");
2068 const auto result = json::to_bjdata(j);
2072 CHECK(json::from_bjdata(result) == j);
2073 CHECK(json::from_bjdata(result, true, false) == j);
2078 json j = json::parse(R"({"a": {"b": {"c": {}}}})");
2083 const auto result = json::to_bjdata(j, true);
2087 CHECK(json::from_bjdata(result) == j);
2088 CHECK(json::from_bjdata(result, true, false) == j);
2093 json j = json::parse(R"({"a": {"b": {"c": {}}}})");
2098 const auto result = json::to_bjdata(j, true, true);
2102 CHECK(json::from_bjdata(result) == j);
2103 CHECK(json::from_bjdata(result, true, false) == j);
2116 const auto result = json::from_bjdata(vec, false);
2117 CHECK(result == json());
2122 json _;
2123 CHECK_THROWS_WITH_AS(_ = json::from_bjdata(vec),
2124 …"[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing BJData value: …
2135 CHECK_FALSE(json::sax_parse(v, &scp, json::input_format_t::bjdata));
2142 CHECK_FALSE(json::sax_parse(v, &scp, json::input_format_t::bjdata));
2149 CHECK_FALSE(json::sax_parse(v, &scp, json::input_format_t::bjdata));
2156 CHECK_FALSE(json::sax_parse(v, &scp, json::input_format_t::bjdata));
2163 CHECK_FALSE(json::sax_parse(v, &scp, json::input_format_t::bjdata));
2170 CHECK_FALSE(json::sax_parse(v, &scp, json::input_format_t::bjdata));
2177 CHECK_FALSE(json::sax_parse(v, &scp, json::input_format_t::bjdata));
2184 CHECK_FALSE(json::sax_parse(v, &scp, json::input_format_t::bjdata));
2191 CHECK_FALSE(json::sax_parse(v, &scp, json::input_format_t::bjdata));
2198 CHECK_FALSE(json::sax_parse(v, &scp, json::input_format_t::bjdata));
2205 CHECK_FALSE(json::sax_parse(v, &scp, json::input_format_t::bjdata));
2212 CHECK_FALSE(json::sax_parse(v, &scp, json::input_format_t::bjdata));
2219 CHECK_FALSE(json::sax_parse(v, &scp, json::input_format_t::bjdata));
2226 CHECK_FALSE(json::sax_parse(v, &scp, json::input_format_t::bjdata));
2245 CHECK(json::from_bjdata(s_i) == "a");
2246 CHECK(json::from_bjdata(s_U) == "a");
2247 CHECK(json::from_bjdata(s_I) == "a");
2248 CHECK(json::from_bjdata(s_u) == "a");
2249 CHECK(json::from_bjdata(s_l) == "a");
2250 CHECK(json::from_bjdata(s_m) == "a");
2251 CHECK(json::from_bjdata(s_L) == "a");
2252 CHECK(json::from_bjdata(s_M) == "a");
2255 CHECK(json::to_bjdata(json::from_bjdata(s_i)) == s_i);
2256 CHECK(json::to_bjdata(json::from_bjdata(s_U)) == s_i);
2257 CHECK(json::to_bjdata(json::from_bjdata(s_I)) == s_i);
2258 CHECK(json::to_bjdata(json::from_bjdata(s_u)) == s_i);
2259 CHECK(json::to_bjdata(json::from_bjdata(s_l)) == s_i);
2260 CHECK(json::to_bjdata(json::from_bjdata(s_m)) == s_i);
2261 CHECK(json::to_bjdata(json::from_bjdata(s_L)) == s_i);
2262 CHECK(json::to_bjdata(json::from_bjdata(s_M)) == s_i);
2271 CHECK(json::from_bjdata(v_d) == 3.14159f);
2275 CHECK(json::from_bjdata(v_D) == 3.14159);
2278 CHECK(json::to_bjdata(json::from_bjdata(v_d)) == json::to_bjdata(3.14159f));
2304 CHECK(json::from_bjdata(v_TU) == json({true, true}));
2305 CHECK(json::from_bjdata(v_T) == json({true, true}));
2306 CHECK(json::from_bjdata(v_F) == json({false, false}));
2307 CHECK(json::from_bjdata(v_Z) == json({nullptr, nullptr}));
2308 CHECK(json::from_bjdata(v_i) == json({127, 127}));
2309 CHECK(json::from_bjdata(v_U) == json({255, 255}));
2310 CHECK(json::from_bjdata(v_I) == json({32767, 32767}));
2311 CHECK(json::from_bjdata(v_u) == json({42767, 42767}));
2312 CHECK(json::from_bjdata(v_l) == json({2147483647, 2147483647}));
2313 CHECK(json::from_bjdata(v_m) == json({3147483647, 3147483647}));
2314 CHECK(json::from_bjdata(v_L) == json({9223372036854775807, 9223372036854775807}));
2315 … CHECK(json::from_bjdata(v_M) == json({10223372036854775807ull, 10223372036854775807ull}));
2316 CHECK(json::from_bjdata(v_D) == json({3.1415926, 3.1415926}));
2317 CHECK(json::from_bjdata(v_S) == json({"a", "a"}));
2318 CHECK(json::from_bjdata(v_C) == json({"a", "a"}));
2321 CHECK(json::to_bjdata(json::from_bjdata(v_T), true) == v_T);
2322 CHECK(json::to_bjdata(json::from_bjdata(v_F), true) == v_F);
2323 CHECK(json::to_bjdata(json::from_bjdata(v_Z), true) == v_Z);
2324 CHECK(json::to_bjdata(json::from_bjdata(v_i), true) == v_i);
2325 CHECK(json::to_bjdata(json::from_bjdata(v_U), true) == v_U);
2326 CHECK(json::to_bjdata(json::from_bjdata(v_I), true) == v_I);
2327 CHECK(json::to_bjdata(json::from_bjdata(v_u), true) == v_u);
2328 CHECK(json::to_bjdata(json::from_bjdata(v_l), true) == v_l);
2329 CHECK(json::to_bjdata(json::from_bjdata(v_m), true) == v_m);
2330 CHECK(json::to_bjdata(json::from_bjdata(v_L), true) == v_L);
2331 CHECK(json::to_bjdata(json::from_bjdata(v_M), true) == v_M);
2332 CHECK(json::to_bjdata(json::from_bjdata(v_D), true) == v_D);
2333 CHECK(json::to_bjdata(json::from_bjdata(v_S), true) == v_S);
2334 … CHECK(json::to_bjdata(json::from_bjdata(v_C), true) == v_S); // char is serialized to string
2353 CHECK(json::from_bjdata(v_i) == json({127, 127}));
2354 CHECK(json::from_bjdata(v_U) == json({255, 255}));
2355 CHECK(json::from_bjdata(v_I) == json({32767, 32767}));
2356 CHECK(json::from_bjdata(v_u) == json({42767, 42767}));
2357 CHECK(json::from_bjdata(v_l) == json({2147483647, 2147483647}));
2358 CHECK(json::from_bjdata(v_m) == json({3147483647, 3147483647}));
2359 CHECK(json::from_bjdata(v_L) == json({9223372036854775807, 9223372036854775807}));
2360 … CHECK(json::from_bjdata(v_M) == json({10223372036854775807ull, 10223372036854775807ull}));
2361 CHECK(json::from_bjdata(v_D) == json({3.1415926, 3.1415926}));
2362 CHECK(json::from_bjdata(v_S) == json({"a", "a"}));
2363 CHECK(json::from_bjdata(v_C) == json({"a", "a"}));
2367 CHECK(json::to_bjdata(json::from_bjdata(v_i), true, true) == v_i);
2368 CHECK(json::to_bjdata(json::from_bjdata(v_U), true, true) == v_U);
2369 CHECK(json::to_bjdata(json::from_bjdata(v_I), true, true) == v_I);
2370 CHECK(json::to_bjdata(json::from_bjdata(v_u), true, true) == v_u);
2371 CHECK(json::to_bjdata(json::from_bjdata(v_l), true, true) == v_l);
2372 CHECK(json::to_bjdata(json::from_bjdata(v_m), true, true) == v_m);
2373 CHECK(json::to_bjdata(json::from_bjdata(v_L), true, true) == v_L);
2374 CHECK(json::to_bjdata(json::from_bjdata(v_M), true, true) == v_M);
2375 CHECK(json::to_bjdata(json::from_bjdata(v_D), true, true) == v_D);
2376 CHECK(json::to_bjdata(json::from_bjdata(v_S), true, true) == v_S);
2377 … CHECK(json::to_bjdata(json::from_bjdata(v_C), true, true) == v_S); // char is serialized to string
2398 CHECK(json::from_bjdata(v_0) == json::array());
2399 CHECK(json::from_bjdata(v_1) == json({127, 127}));
2400 CHECK(json::from_bjdata(v_i) == json({127, 127}));
2401 CHECK(json::from_bjdata(v_U) == json({255, 255}));
2402 CHECK(json::from_bjdata(v_I) == json({32767, 32767}));
2403 CHECK(json::from_bjdata(v_u) == json({42767, 42767}));
2404 CHECK(json::from_bjdata(v_l) == json({2147483647, 2147483647}));
2405 CHECK(json::from_bjdata(v_m) == json({3147483647, 3147483647}));
2406 CHECK(json::from_bjdata(v_L) == json({9223372036854775807, 9223372036854775807}));
2407 … CHECK(json::from_bjdata(v_M) == json({10223372036854775807ull, 10223372036854775807ull}));
2408 CHECK(json::from_bjdata(v_D) == json({3.1415926, 3.1415926}));
2409 CHECK(json::from_bjdata(v_S) == json({"a", "a"}));
2410 CHECK(json::from_bjdata(v_C) == json({"a", "a"}));
2430 …CHECK(json::from_bjdata(v_e) == json({{"_ArrayData_", {254, 255}}, {"_ArraySize_", {2, 1}}, {"_Arr…
2431 …CHECK(json::from_bjdata(v_U) == json({{"_ArrayData_", {1, 2, 3, 4, 5, 6}}, {"_ArraySize_", {2, 3}}…
2432 …CHECK(json::from_bjdata(v_i) == json({{"_ArrayData_", {1, 2, 3, 4, 5, 6}}, {"_ArraySize_", {2, 3}}…
2433 …CHECK(json::from_bjdata(v_i) == json({{"_ArrayData_", {1, 2, 3, 4, 5, 6}}, {"_ArraySize_", {2, 3}}…
2434 …CHECK(json::from_bjdata(v_u) == json({{"_ArrayData_", {1, 2, 3, 4, 5, 6}}, {"_ArraySize_", {2, 3}}…
2435 …CHECK(json::from_bjdata(v_I) == json({{"_ArrayData_", {1, 2, 3, 4, 5, 6}}, {"_ArraySize_", {2, 3}}…
2436 …CHECK(json::from_bjdata(v_m) == json({{"_ArrayData_", {1, 2, 3, 4, 5, 6}}, {"_ArraySize_", {2, 3}}…
2437 …CHECK(json::from_bjdata(v_l) == json({{"_ArrayData_", {1, 2, 3, 4, 5, 6}}, {"_ArraySize_", {2, 3}}…
2438 …CHECK(json::from_bjdata(v_M) == json({{"_ArrayData_", {1, 2, 3, 4, 5, 6}}, {"_ArraySize_", {2, 3}}…
2439 …CHECK(json::from_bjdata(v_L) == json({{"_ArrayData_", {1, 2, 3, 4, 5, 6}}, {"_ArraySize_", {2, 3}}…
2440 …CHECK(json::from_bjdata(v_d) == json({{"_ArrayData_", {1.f, 2.f, 3.f, 4.f, 5.f, 6.f}}, {"_ArraySiz…
2441 …CHECK(json::from_bjdata(v_D) == json({{"_ArrayData_", {1., 2., 3., 4., 5., 6.}}, {"_ArraySize_", {…
2442 …CHECK(json::from_bjdata(v_C) == json({{"_ArrayData_", {'a', 'b', 'c', 'd', 'e', 'f'}}, {"_ArraySiz…
2445 CHECK(json::to_bjdata(json::from_bjdata(v_e), true, true) == v_e);
2446 CHECK(json::to_bjdata(json::from_bjdata(v_U), true, true) == v_U);
2447 CHECK(json::to_bjdata(json::from_bjdata(v_i), true, true) == v_i);
2448 CHECK(json::to_bjdata(json::from_bjdata(v_u), true, true) == v_u);
2449 CHECK(json::to_bjdata(json::from_bjdata(v_I), true, true) == v_I);
2450 CHECK(json::to_bjdata(json::from_bjdata(v_m), true, true) == v_m);
2451 CHECK(json::to_bjdata(json::from_bjdata(v_l), true, true) == v_l);
2452 CHECK(json::to_bjdata(json::from_bjdata(v_M), true, true) == v_M);
2453 CHECK(json::to_bjdata(json::from_bjdata(v_L), true, true) == v_L);
2454 CHECK(json::to_bjdata(json::from_bjdata(v_d), true, true) == v_d);
2455 CHECK(json::to_bjdata(json::from_bjdata(v_D), true, true) == v_D);
2456 CHECK(json::to_bjdata(json::from_bjdata(v_C), true, true) == v_C);
2478 CHECK(json::from_bjdata(v_0) == json::array());
2479 CHECK(json::from_bjdata(v_E) == json::array());
2480 CHECK(json::from_bjdata(v_i) == json({127, 127}));
2481 CHECK(json::from_bjdata(v_U) == json({255, 255}));
2482 CHECK(json::from_bjdata(v_I) == json({32767, 32767}));
2483 CHECK(json::from_bjdata(v_u) == json({42767, 42767}));
2484 CHECK(json::from_bjdata(v_l) == json({2147483647, 2147483647}));
2485 CHECK(json::from_bjdata(v_m) == json({3147483647, 3147483647}));
2486 CHECK(json::from_bjdata(v_L) == json({9223372036854775807, 9223372036854775807}));
2487 … CHECK(json::from_bjdata(v_M) == json({10223372036854775807ull, 10223372036854775807ull}));
2488 CHECK(json::from_bjdata(v_D) == json({3.1415926, 3.1415926}));
2489 CHECK(json::from_bjdata(v_S) == json({"a", "a"}));
2490 CHECK(json::from_bjdata(v_C) == json({"a", "a"}));
2491 CHECK(json::from_bjdata(v_R) == json({6, 7}));
2510 CHECK(json::from_bjdata(v_i) == json({127, 127}));
2511 CHECK(json::from_bjdata(v_U) == json({255, 255}));
2512 CHECK(json::from_bjdata(v_I) == json({32767, 32767}));
2513 CHECK(json::from_bjdata(v_u) == json({42767, 42767}));
2514 CHECK(json::from_bjdata(v_l) == json({2147483647, 2147483647}));
2515 CHECK(json::from_bjdata(v_m) == json({3147483647, 3147483647}));
2516 CHECK(json::from_bjdata(v_L) == json({9223372036854775807, 9223372036854775807}));
2517 … CHECK(json::from_bjdata(v_M) == json({10223372036854775807ull, 10223372036854775807ull}));
2518 CHECK(json::from_bjdata(v_D) == json({3.1415926, 3.1415926}));
2519 CHECK(json::from_bjdata(v_S) == json({"a", "a"}));
2520 CHECK(json::from_bjdata(v_C) == json({"a", "a"}));
2526 …json j_type = json({{"_ArrayData_", {1, 2, 3, 4, 5, 6}}, {"_ArraySize_", {2, 3}}, {"_ArrayType_", …
2527 …json j_size = json({{"_ArrayData_", {1, 2, 3, 4, 5}}, {"_ArraySize_", {2, 3}}, {"_ArrayType_", "ui…
2530 CHECK(json::from_bjdata(json::to_bjdata(j_type), true, true) == j_type);
2531 CHECK(json::from_bjdata(json::to_bjdata(j_size), true, true) == j_size);
2540 json _;
2541 CHECK_THROWS_WITH_AS(_ = json::from_bjdata(std::vector<uint8_t>()),
2542 …"[json.exception.parse_error.110] parse error at byte 1: syntax error while parsing BJData value: …
2550 json _;
2551 …= json::from_bjdata(v), "[json.exception.parse_error.110] parse error at byte 2: syntax error whil…
2557 json _;
2558 …CHECK_THROWS_WITH(_ = json::from_bjdata(v), "[json.exception.parse_error.113] parse error at byte …
2567 json _;
2568 … json::from_bjdata(v), "[json.exception.parse_error.110] parse error at byte 2: syntax error while…
2574 json _;
2575 …json::from_bjdata(v), "[json.exception.parse_error.113] parse error at byte 2: syntax error while …
2585 json _;
2587 …json::from_ubjson(s_u), "[json.exception.parse_error.113] parse error at byte 2: syntax error whil…
2588 …json::from_ubjson(s_m), "[json.exception.parse_error.113] parse error at byte 2: syntax error whil…
2589 …json::from_ubjson(s_M), "[json.exception.parse_error.113] parse error at byte 2: syntax error whil…
2598 json _;
2599 …json::from_bjdata(v), "[json.exception.parse_error.112] parse error at byte 4: syntax error while …
2617 json _;
2618 …json::from_bjdata(v1), "[json.exception.parse_error.113] parse error at byte 4: syntax error while…
2619 CHECK(json::from_bjdata(v1, true, false).is_discarded());
2621 …json::from_bjdata(v2), "[json.exception.parse_error.113] parse error at byte 6: syntax error while…
2622 CHECK(json::from_bjdata(v2, true, false).is_discarded());
2624 …json::from_bjdata(v3), "[json.exception.parse_error.113] parse error at byte 7: syntax error while…
2625 CHECK(json::from_bjdata(v3, true, false).is_discarded());
2627 …json::from_bjdata(v4), "[json.exception.parse_error.113] parse error at byte 6: syntax error while…
2628 CHECK(json::from_bjdata(v4, true, false).is_discarded());
2630 …json::from_bjdata(v5), "[json.exception.parse_error.113] parse error at byte 7: syntax error while…
2631 CHECK(json::from_bjdata(v5, true, false).is_discarded());
2633 …json::from_bjdata(v6), "[json.exception.parse_error.113] parse error at byte 5: syntax error while…
2634 CHECK(json::from_bjdata(v6, true, false).is_discarded());
2636 …json::from_bjdata(vI), "[json.exception.parse_error.113] parse error at byte 5: syntax error while…
2637 CHECK(json::from_bjdata(vI, true, false).is_discarded());
2639 …json::from_bjdata(vl), "[json.exception.parse_error.113] parse error at byte 7: syntax error while…
2640 CHECK(json::from_bjdata(vl, true, false).is_discarded());
2642 …json::from_bjdata(vL), "[json.exception.parse_error.113] parse error at byte 11: syntax error whil…
2643 CHECK(json::from_bjdata(vL, true, false).is_discarded());
2646 …(_ = json::from_bjdata(vM), "[json.exception.out_of_range.408] syntax error while parsing BJData s…
2648 …_WITH_AS(_ = json::from_bjdata(vM), "[json.exception.out_of_range.408] syntax error while parsing …
2650 CHECK(json::from_bjdata(vM, true, false).is_discarded());
2653 …_ = json::from_bjdata(vMX), "[json.exception.out_of_range.408] syntax error while parsing BJData s…
2655 …WITH_AS(_ = json::from_bjdata(vMX), "[json.exception.out_of_range.408] syntax error while parsing …
2657 CHECK(json::from_bjdata(vMX, true, false).is_discarded());
2665 json _;
2667 …_WITH_AS(_ = json::from_bjdata(vL), "[json.exception.out_of_range.408] syntax error while parsing …
2668 CHECK(json::from_bjdata(vL, true, false).is_discarded());
2672 …_WITH_AS(_ = json::from_bjdata(vM), "[json.exception.out_of_range.408] syntax error while parsing …
2673 CHECK(json::from_bjdata(vM, true, false).is_discarded());
2679 json _;
2685 …json::from_bjdata(v_N), "[json.exception.parse_error.112] parse error at byte 3: syntax error whil…
2686 CHECK(json::from_bjdata(v_N, true, false).is_discarded());
2688 …json::from_bjdata(v_T), "[json.exception.parse_error.112] parse error at byte 3: syntax error whil…
2689 CHECK(json::from_bjdata(v_T, true, false).is_discarded());
2691 …json::from_bjdata(v_F), "[json.exception.parse_error.112] parse error at byte 3: syntax error whil…
2692 CHECK(json::from_bjdata(v_F, true, false).is_discarded());
2694 …json::from_bjdata(v_Z), "[json.exception.parse_error.112] parse error at byte 3: syntax error whil…
2695 CHECK(json::from_bjdata(v_Z, true, false).is_discarded());
2700 json _;
2706 …json::from_bjdata(v_N), "[json.exception.parse_error.112] parse error at byte 3: syntax error whil…
2707 CHECK(json::from_bjdata(v_N, true, false).is_discarded());
2709 …json::from_bjdata(v_T), "[json.exception.parse_error.112] parse error at byte 3: syntax error whil…
2710 CHECK(json::from_bjdata(v_T, true, false).is_discarded());
2712 …json::from_bjdata(v_F), "[json.exception.parse_error.112] parse error at byte 3: syntax error whil…
2713 CHECK(json::from_bjdata(v_F, true, false).is_discarded());
2715 …json::from_bjdata(v_Z), "[json.exception.parse_error.112] parse error at byte 3: syntax error whil…
2716 CHECK(json::from_bjdata(v_Z, true, false).is_discarded());
2723 json _;
2724 … json::from_bjdata(vS), "[json.exception.parse_error.110] parse error at byte 2: syntax error whil…
2725 CHECK(json::from_bjdata(vS, true, false).is_discarded());
2728 … json::from_bjdata(v), "[json.exception.parse_error.110] parse error at byte 5: syntax error while…
2729 CHECK(json::from_bjdata(v, true, false).is_discarded());
2732 … json::from_bjdata(vC), "[json.exception.parse_error.110] parse error at byte 2: syntax error whil…
2733 CHECK(json::from_bjdata(vC, true, false).is_discarded());
2739 json _;
2740 …json::from_bjdata(vU), "[json.exception.parse_error.110] parse error at byte 4: syntax error while…
2741 CHECK(json::from_bjdata(vU, true, false).is_discarded());
2744 …json::from_bjdata(vi), "[json.exception.parse_error.110] parse error at byte 4: syntax error while…
2745 CHECK(json::from_bjdata(vi, true, false).is_discarded());
2748 …json::from_bjdata(vI), "[json.exception.parse_error.110] parse error at byte 4: syntax error while…
2749 CHECK(json::from_bjdata(vI, true, false).is_discarded());
2752 …json::from_bjdata(vu), "[json.exception.parse_error.110] parse error at byte 4: syntax error while…
2753 CHECK(json::from_bjdata(vu, true, false).is_discarded());
2756 …json::from_bjdata(vl), "[json.exception.parse_error.110] parse error at byte 4: syntax error while…
2757 CHECK(json::from_bjdata(vl, true, false).is_discarded());
2760 …json::from_bjdata(vm), "[json.exception.parse_error.110] parse error at byte 4: syntax error while…
2761 CHECK(json::from_bjdata(vm, true, false).is_discarded());
2764 …json::from_bjdata(vL), "[json.exception.parse_error.110] parse error at byte 4: syntax error while…
2765 CHECK(json::from_bjdata(vL, true, false).is_discarded());
2768 …json::from_bjdata(vM), "[json.exception.parse_error.110] parse error at byte 4: syntax error while…
2769 CHECK(json::from_bjdata(vM, true, false).is_discarded());
2772 …CHECK_THROWS_WITH(_ = json::from_bjdata(v0), "[json.exception.parse_error.113] parse error at byte…
2773 CHECK(json::from_bjdata(v0, true, false).is_discarded());
2778 json _;
2780 …json::from_ubjson(vu), "[json.exception.parse_error.113] parse error at byte 3: syntax error while…
2781 CHECK(json::from_ubjson(vu, true, false).is_discarded());
2784 …json::from_ubjson(vm), "[json.exception.parse_error.113] parse error at byte 3: syntax error while…
2785 CHECK(json::from_ubjson(vm, true, false).is_discarded());
2788 …json::from_ubjson(vM), "[json.exception.parse_error.113] parse error at byte 3: syntax error while…
2789 CHECK(json::from_ubjson(vM, true, false).is_discarded());
2792 …json::from_ubjson(v0), "[json.exception.parse_error.113] parse error at byte 3: syntax error while…
2793 CHECK(json::from_ubjson(v0, true, false).is_discarded());
2799 json _;
2800 … json::from_bjdata(v0), "[json.exception.parse_error.110] parse error at byte 3: syntax error whil…
2801 CHECK(json::from_bjdata(v0, true, false).is_discarded());
2804 … json::from_bjdata(vi), "[json.exception.parse_error.110] parse error at byte 4: syntax error whil…
2805 CHECK(json::from_bjdata(vi, true, false).is_discarded());
2808 … json::from_bjdata(vU), "[json.exception.parse_error.110] parse error at byte 4: syntax error whil…
2809 CHECK(json::from_bjdata(vU, true, false).is_discarded());
2812 …json::from_bjdata(v1), "[json.exception.parse_error.112] parse error at byte 3: syntax error while…
2813 CHECK(json::from_bjdata(v1, true, false).is_discarded());
2819 json _;
2820 …json::from_bjdata(vST), "[json.exception.parse_error.110] parse error at byte 8: syntax error whil…
2821 CHECK(json::from_bjdata(vST, true, false).is_discarded());
2824 … json::from_bjdata(vS), "[json.exception.parse_error.110] parse error at byte 7: syntax error whil…
2825 CHECK(json::from_bjdata(vS, true, false).is_discarded());
2828 … json::from_bjdata(v), "[json.exception.parse_error.110] parse error at byte 6: syntax error while…
2829 CHECK(json::from_bjdata(v, true, false).is_discarded());
2835 json _;
2836 …json::from_bjdata(vST), "[json.exception.parse_error.113] parse error at byte 9: syntax error whil…
2837 CHECK(json::from_bjdata(vST, true, false).is_discarded());
2840 …json::from_bjdata(v), "[json.exception.parse_error.110] parse error at byte 13: syntax error while…
2841 CHECK(json::from_bjdata(v, true, false).is_discarded());
2844 …json::from_bjdata(vS0), "[json.exception.parse_error.110] parse error at byte 12: syntax error whi…
2845 CHECK(json::from_bjdata(vS0, true, false).is_discarded());
2848 …json::from_bjdata(vS), "[json.exception.parse_error.113] parse error at byte 9: syntax error while…
2849 CHECK(json::from_bjdata(vS, true, false).is_discarded());
2852 …json::from_bjdata(vT), "[json.exception.parse_error.110] parse error at byte 9: syntax error while…
2853 CHECK(json::from_bjdata(vT, true, false).is_discarded());
2856 …json::from_bjdata(vT0), "[json.exception.parse_error.110] parse error at byte 7: syntax error whil…
2857 CHECK(json::from_bjdata(vT0, true, false).is_discarded());
2860 …json::from_bjdata(vu), "[json.exception.parse_error.110] parse error at byte 12: syntax error whil…
2861 CHECK(json::from_bjdata(vu, true, false).is_discarded());
2864 …json::from_bjdata(vm), "[json.exception.parse_error.110] parse error at byte 14: syntax error whil…
2865 CHECK(json::from_bjdata(vm, true, false).is_discarded());
2868 …json::from_bjdata(vM), "[json.exception.parse_error.110] parse error at byte 18: syntax error whil…
2869 CHECK(json::from_bjdata(vM, true, false).is_discarded());
2872 …json::from_bjdata(vU), "[json.exception.parse_error.110] parse error at byte 18: syntax error whil…
2873 CHECK(json::from_bjdata(vU, true, false).is_discarded());
2876 CHECK(json::from_bjdata(vT1, true, false).is_discarded());
2879 CHECK(json::from_bjdata(vh, true, false).is_discarded());
2882 …json::from_bjdata(vR), "[json.exception.parse_error.113] parse error at byte 8: syntax error while…
2883 CHECK(json::from_bjdata(vR, true, false).is_discarded());
2886 …json::from_bjdata(vRo), "[json.exception.parse_error.113] parse error at byte 8: syntax error whil…
2887 CHECK(json::from_bjdata(vRo, true, false).is_discarded());
2890 …json::from_bjdata(vR1), "[json.exception.parse_error.113] parse error at byte 6: syntax error whil…
2891 CHECK(json::from_bjdata(vR1, true, false).is_discarded());
2894 …json::from_bjdata(vR2), "[json.exception.parse_error.113] parse error at byte 11: syntax error whi…
2895 CHECK(json::from_bjdata(vR2, true, false).is_discarded());
2898 …json::from_bjdata(vR3), "[json.exception.parse_error.112] parse error at byte 8: syntax error whil…
2899 CHECK(json::from_bjdata(vR3, true, false).is_discarded());
2902 …json::from_bjdata(vR4), "[json.exception.parse_error.110] parse error at byte 14: syntax error whi…
2903 CHECK(json::from_bjdata(vR4, true, false).is_discarded());
2906 …json::from_bjdata(vR5), "[json.exception.parse_error.113] parse error at byte 6: syntax error whil…
2907 CHECK(json::from_bjdata(vR5, true, false).is_discarded());
2910 …json::from_bjdata(vR6), "[json.exception.parse_error.112] parse error at byte 14: syntax error whi…
2911 CHECK(json::from_bjdata(vR6, true, false).is_discarded());
2914 …json::from_bjdata(vH), "[json.exception.parse_error.113] parse error at byte 3: syntax error while…
2915 CHECK(json::from_bjdata(vH, true, false).is_discarded());
2921 json _;
2922 …json::from_bjdata(vST), "[json.exception.parse_error.110] parse error at byte 11: syntax error whi…
2923 CHECK(json::from_bjdata(vST, true, false).is_discarded());
2926 …CHECK_THROWS_WITH(_ = json::from_bjdata(vT), "[json.exception.parse_error.112] parse error at byte…
2927 CHECK(json::from_bjdata(vT, true, false).is_discarded());
2930 …json::from_bjdata(vS), "[json.exception.parse_error.110] parse error at byte 10: syntax error whil…
2931 CHECK(json::from_bjdata(vS, true, false).is_discarded());
2934 … json::from_bjdata(v), "[json.exception.parse_error.110] parse error at byte 7: syntax error while…
2935 CHECK(json::from_bjdata(v, true, false).is_discarded());
2938 …json::from_bjdata(v2), "[json.exception.parse_error.110] parse error at byte 8: syntax error while…
2939 CHECK(json::from_bjdata(v2, true, false).is_discarded());
2942 … json::from_bjdata(v3), "[json.exception.parse_error.110] parse error at byte 5: syntax error whil…
2943 CHECK(json::from_bjdata(v3, true, false).is_discarded());
2946 …json::from_bjdata(vST1), "[json.exception.parse_error.110] parse error at byte 10: syntax error wh…
2947 CHECK(json::from_bjdata(vST1, true, false).is_discarded());
2950 …json::from_bjdata(vST2), "[json.exception.parse_error.110] parse error at byte 8: syntax error whi…
2951 CHECK(json::from_bjdata(vST2, true, false).is_discarded());
2954 …json::from_bjdata(vO), "[json.exception.parse_error.112] parse error at byte 8: syntax error while…
2955 CHECK(json::from_bjdata(vO, true, false).is_discarded());
2958 …json::from_bjdata(vO2), "[json.exception.parse_error.112] parse error at byte 10: syntax error whi…
2959 CHECK(json::from_bjdata(vO2, true, false).is_discarded());
2969 json j = {1, -1};
2971 CHECK(json::to_bjdata(j, true, true) == expected);
2976 json j = {200, 201};
2978 CHECK(json::to_bjdata(j, true, true) == expected);
2983 json j = {30000, -30000};
2985 CHECK(json::to_bjdata(j, true, true) == expected);
2990 json j = {50000, 50001};
2992 CHECK(json::to_bjdata(j, true, true) == expected);
2997 json j = {70000, -70000};
2999 CHECK(json::to_bjdata(j, true, true) == expected);
3004 json j = {3147483647, 3147483648};
3006 CHECK(json::to_bjdata(j, true, true) == expected);
3011 json j = {5000000000, -5000000000};
3013 CHECK(json::to_bjdata(j, true, true) == expected);
3021 json j = {1u, 2u};
3024 CHECK(json::to_bjdata(j, true, true) == expected);
3025 CHECK(json::to_bjdata(j, true) == expected_size);
3030 json j = {200u, 201u};
3033 CHECK(json::to_bjdata(j, true, true) == expected);
3034 CHECK(json::to_bjdata(j, true) == expected_size);
3039 json j = {30000u, 30001u};
3042 CHECK(json::to_bjdata(j, true, true) == expected);
3043 CHECK(json::to_bjdata(j, true) == expected_size);
3048 json j = {50000u, 50001u};
3051 CHECK(json::to_bjdata(j, true, true) == expected);
3052 CHECK(json::to_bjdata(j, true) == expected_size);
3057 json j = {70000u, 70001u};
3060 CHECK(json::to_bjdata(j, true, true) == expected);
3061 CHECK(json::to_bjdata(j, true) == expected_size);
3066 json j = {3147483647u, 3147483648u};
3069 CHECK(json::to_bjdata(j, true, true) == expected);
3070 CHECK(json::to_bjdata(j, true) == expected_size);
3075 json j = {5000000000u, 5000000001u};
3078 CHECK(json::to_bjdata(j, true, true) == expected);
3079 CHECK(json::to_bjdata(j, true) == expected_size);
3084 json j = {10223372036854775807ull, 10223372036854775808ull};
3087 CHECK(json::to_bjdata(j, true, true) == expected);
3088 CHECK(json::to_bjdata(j, true) == expected_size);
3094 TEST_CASE("Universal Binary JSON Specification Examples 1")
3098 json j = {{"passcode", nullptr}};
3100 CHECK(json::to_bjdata(j) == v);
3101 CHECK(json::from_bjdata(v) == j);
3106 json j = {"foo", "bar", "baz"};
3115 CHECK(json::to_bjdata(j) == v);
3116 CHECK(json::from_bjdata(v) == j);
3117 CHECK(json::from_bjdata(v2) == j);
3122 json j = {{"authorized", true}, {"verified", false}};
3126 CHECK(json::to_bjdata(j) == v);
3127 CHECK(json::from_bjdata(v) == j);
3132 json j =
3156 CHECK(json::to_bjdata(j) == v);
3157 CHECK(json::from_bjdata(v) == j);
3162 json j = {{"rolecode", "a"}, {"delim", ";"}};
3164 //CHECK(json::to_bjdata(j) == v);
3165 CHECK(json::from_bjdata(v) == j);
3172 json j = "hello";
3174 CHECK(json::to_bjdata(j) == v);
3175 CHECK(json::from_bjdata(v) == j);
3180 json j = "привет";
3182 CHECK(json::to_bjdata(j) == v);
3183 CHECK(json::from_bjdata(v) == j);
3188 json j = "مرحبا";
3190 CHECK(json::to_bjdata(j) == v);
3191 CHECK(json::from_bjdata(v) == j);
3200 json j = {nullptr, true, false, 4782345193, 153.132, "ham"};
3202 CHECK(json::to_bjdata(j) == v);
3203 CHECK(json::from_bjdata(v) == j);
3209 json j = {nullptr, true, false, 4782345193, 153.132, "ham"};
3211 CHECK(json::to_bjdata(j, true) == v);
3212 CHECK(json::from_bjdata(v) == j);
3218 json j = {nullptr, true, false, 4782345193, 153.132, "ham"};
3220 CHECK(json::to_bjdata(j, true, true) == v);
3221 CHECK(json::from_bjdata(v) == j);
3229 json j =
3247 CHECK(json::to_bjdata(j) == v);
3248 CHECK(json::from_bjdata(v) == j);
3253 json j =
3270 CHECK(json::to_bjdata(j, true) == v);
3271 CHECK(json::from_bjdata(v) == j);
3276 json j =
3293 CHECK(json::to_bjdata(j, true, true) == v);
3294 CHECK(json::from_bjdata(v) == j);
3305 json j = {29.97, 31.13, 67.0, 2.113, 23.888};
3314 CHECK(json::to_bjdata(j) == v);
3315 CHECK(json::from_bjdata(v) == j);
3321 json j = {29.97, 31.13, 67.0, 2.113, 23.888};
3329 CHECK(json::to_bjdata(j, true) == v);
3330 CHECK(json::from_bjdata(v) == j);
3336 json j = {29.97, 31.13, 67.0, 2.113, 23.888};
3344 CHECK(json::to_bjdata(j, true, true) == v);
3345 CHECK(json::from_bjdata(v) == j);
3354 json j = { {"lat", 29.976}, {"long", 31.131}, {"alt", 67.0} };
3361 CHECK(json::to_bjdata(j) == v);
3362 CHECK(json::from_bjdata(v) == j);
3368 json j = { {"lat", 29.976}, {"long", 31.131}, {"alt", 67.0} };
3374 CHECK(json::to_bjdata(j, true) == v);
3375 CHECK(json::from_bjdata(v) == j);
3381 json j = { {"lat", 29.976}, {"long", 31.131}, {"alt", 67.0} };
3387 CHECK(json::to_bjdata(j, true, true) == v);
3388 CHECK(json::from_bjdata(v) == j);
3396 json _;
3398 …json::from_bjdata(v), "[json.exception.parse_error.112] parse error at byte 3: syntax error while …
3399 CHECK(json::from_bjdata(v, true, false).is_discarded());
3404 json _;
3406 …json::from_bjdata(v), "[json.exception.parse_error.112] parse error at byte 3: syntax error while …
3407 CHECK(json::from_bjdata(v, true, false).is_discarded());
3429 auto res = json::from_bjdata(std::vector<uint8_t>(1, byte)); in CAPTURE()
3431 catch (const json::parse_error& e)
3455 TEST_DATA_DIRECTORY "/json_nlohmann_tests/all_unicode.json", in skip()
3456 TEST_DATA_DIRECTORY "/json.org/1.json", in skip()
3457 TEST_DATA_DIRECTORY "/json.org/2.json", in skip()
3458 TEST_DATA_DIRECTORY "/json.org/3.json", in skip()
3459 TEST_DATA_DIRECTORY "/json.org/4.json", in skip()
3460 TEST_DATA_DIRECTORY "/json.org/5.json", in skip()
3461 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip01.json", in skip()
3462 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip02.json", in skip()
3463 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip03.json", in skip()
3464 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip04.json", in skip()
3465 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip05.json", in skip()
3466 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip06.json", in skip()
3467 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip07.json", in skip()
3468 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip08.json", in skip()
3469 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip09.json", in skip()
3470 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip10.json", in skip()
3471 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip11.json", in skip()
3472 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip12.json", in skip()
3473 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip13.json", in skip()
3474 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip14.json", in skip()
3475 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip15.json", in skip()
3476 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip16.json", in skip()
3477 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip17.json", in skip()
3478 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip18.json", in skip()
3479 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip19.json", in skip()
3480 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip20.json", in skip()
3481 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip21.json", in skip()
3482 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip22.json", in skip()
3483 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip23.json", in skip()
3484 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip24.json", in skip()
3485 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip25.json", in skip()
3486 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip26.json", in skip()
3487 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip27.json", in skip()
3488 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip28.json", in skip()
3489 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip29.json", in skip()
3490 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip30.json", in skip()
3491 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip31.json", in skip()
3492 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip32.json", in skip()
3493 TEST_DATA_DIRECTORY "/json_testsuite/sample.json", in skip()
3494 TEST_DATA_DIRECTORY "/json_tests/pass1.json", in skip()
3495 TEST_DATA_DIRECTORY "/json_tests/pass2.json", in skip()
3496 TEST_DATA_DIRECTORY "/json_tests/pass3.json" in skip()
3503 // parse JSON file in skip()
3505 json j1 = json::parse(f_json); in skip()
3509 json j2; in skip()
3510 CHECK_NOTHROW(j2 = json::from_bjdata(packed)); in skip()
3512 // compare parsed JSON values in skip()
3518 // parse JSON file in skip()
3520 json j1 = json::parse(f_json); in skip()
3524 json j2; in skip()
3525 CHECK_NOTHROW(j2 = json::from_bjdata(f_bjdata)); in skip()
3527 // compare parsed JSON values in skip()
3533 // parse JSON file in skip()
3535 json j1 = json::parse(f_json); in skip()
3543 json::to_bjdata(j1, vec); in skip()