Home
last modified time | relevance | path

Searched full:json (Results 1 – 25 of 3265) sorted by relevance

12345678910>>...131

/third_party/json/test/src/
Dunit-conversions.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
33 #include <nlohmann/json.hpp>
34 using nlohmann::json;
60 json::object_t o_reference = {{"object", json::object()},
67 json j(o_reference);
69 SECTION("json::object_t")
71 json::object_t o = j.get<json::object_t>();
72 CHECK(json(o) == j);
75 SECTION("std::map<json::string_t, json>")
[all …]
Dunit-testsuites.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
32 #include <nlohmann/json.hpp>
33 using nlohmann::json;
37 TEST_CASE("compliance tests from json.org")
39 // test cases are from http://json.org/JSON_checker/
45 //"test/data/json_tests/fail1.json",
46 "test/data/json_tests/fail2.json",
47 "test/data/json_tests/fail3.json",
48 "test/data/json_tests/fail4.json",
[all …]
Dunit-constructor1.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
34 #include <nlohmann/json.hpp>
35 using nlohmann::json;
53 auto t = json::value_t::null;
54 json j(t);
60 auto t = json::value_t::discarded;
61 json j(t);
67 auto t = json::value_t::object;
68 json j(t);
[all …]
Dunit-element_access1.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
32 #include <nlohmann/json.hpp>
33 using nlohmann::json;
39 json j = {1, 1u, true, nullptr, "string", 42.23, json::object(), {1, 2, 3}};
40 const json j_const = j;
46 CHECK(j.at(0) == json(1));
47 CHECK(j.at(1) == json(1u));
48 CHECK(j.at(2) == json(true));
49 CHECK(j.at(3) == json(nullptr));
[all …]
Dunit-element_access2.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
32 #include <nlohmann/json.hpp>
33 using nlohmann::json;
39json j = {{"integer", 1}, {"unsigned", 1u}, {"floating", 42.23}, {"null", nullptr}, {"string", "he…
40 const json j_const = j;
46 CHECK(j.at("integer") == json(1));
47 CHECK(j.at("unsigned") == json(1u));
48 CHECK(j.at("boolean") == json(true));
49 CHECK(j.at("null") == json(nullptr));
[all …]
Dunit-reference_access.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
33 #include <nlohmann/json.hpp>
34 using nlohmann::json;
38 // create a JSON value with different types
39 json json_types =
55 using test_type = json::object_t;
56 json value = {{"one", 1}, {"two", 2}};
68 CHECK_NOTHROW(value.get_ref<json::object_t&>());
69 CHECK_THROWS_AS(value.get_ref<json::array_t&>(), json::type_error&);
[all …]
Dunit-modifiers.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
32 #include <nlohmann/json.hpp>
33 using nlohmann::json;
41 json j = true;
42 json k = j;
45 CHECK(j == json(json::value_t::boolean));
46 CHECK(j == json(k.type()));
51 json j = "hello world";
52 json k = j;
[all …]
Dunit-cbor.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
33 #include <nlohmann/json.hpp>
34 using nlohmann::json;
59 bool number_integer(json::number_integer_t) in number_integer()
64 bool number_unsigned(json::number_unsigned_t) in number_unsigned()
69 bool number_float(json::number_float_t, const std::string&) in number_float()
104 bool parse_error(std::size_t, const std::string&, const json::exception&) in parse_error()
121 json j = json::value_t::discarded;
122 const auto result = json::to_cbor(j);
[all …]
Dunit-json_patch.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
32 #include <nlohmann/json.hpp>
33 using nlohmann::json;
37 TEST_CASE("JSON patch")
43 // the ordering of members in JSON objects is not significant:
44 json op1 = R"({ "op": "add", "path": "/a/b/c", "value": "foo" })"_json;
45 json op2 = R"({ "path": "/a/b/c", "op": "add", "value": "foo" })"_json;
46 json op3 = R"({ "value": "foo", "path": "/a/b/c", "op": "add" })"_json;
55 json patch = R"([{ "op": "add", "path": "/a/b/c", "value": [ "foo", "bar" ] }])"_json;
[all …]
Dunit-msgpack.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
32 #include <nlohmann/json.hpp>
33 using nlohmann::json;
58 bool number_integer(json::number_integer_t) in number_integer()
63 bool number_unsigned(json::number_unsigned_t) in number_unsigned()
68 bool number_float(json::number_float_t, const std::string&) in number_float()
103 bool parse_error(std::size_t, const std::string&, const json::exception&) in parse_error()
120 json j = json::value_t::discarded;
121 const auto result = json::to_msgpack(j);
[all …]
Dunit-ubjson.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
32 #include <nlohmann/json.hpp>
33 using nlohmann::json;
56 bool number_integer(json::number_integer_t) in number_integer()
61 bool number_unsigned(json::number_unsigned_t) in number_unsigned()
66 bool number_float(json::number_float_t, const std::string&) in number_float()
101 bool parse_error(std::size_t, const std::string&, const json::exception&) in parse_error()
118 json j = json::value_t::discarded;
119 const auto result = json::to_ubjson(j);
[all …]
Dunit-iterators2.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
32 #include <nlohmann/json.hpp>
33 using nlohmann::json;
39json j_values = {nullptr, true, 42, 42u, 23.23, {{"one", 1}, {"two", 2}}, {1, 2, 3, 4, 5}, "Hello,…
41 for (json& j : j_values)
83 if (j.type() == json::value_t::object)
85 CHECK_THROWS_AS(it1 < it1, json::invalid_iterator&);
86 CHECK_THROWS_AS(it1 < it2, json::invalid_iterator&);
87 CHECK_THROWS_AS(it2 < it3, json::invalid_iterator&);
[all …]
Dunit-json_pointer.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
33 #include <nlohmann/json.hpp>
34 using nlohmann::json;
37 TEST_CASE("JSON pointers")
41 CHECK_THROWS_AS(json::json_pointer("foo"), json::parse_error&);
42 CHECK_THROWS_WITH(json::json_pointer("foo"),
43 …"[json.exception.parse_error.107] parse error at byte 1: JSON pointer must be empty or begin with …
45 CHECK_THROWS_AS(json::json_pointer("/~~"), json::parse_error&);
46 CHECK_THROWS_WITH(json::json_pointer("/~~"),
[all …]
Dunit-class_parser.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
33 #include <nlohmann/json.hpp>
34 using nlohmann::json;
56 bool number_integer(json::number_integer_t val) in number_integer()
62 bool number_unsigned(json::number_unsigned_t val) in number_unsigned()
68 bool number_float(json::number_float_t, const std::string& s) in number_float()
124 bool parse_error(std::size_t position, const std::string&, const json::exception&) in parse_error()
135 class SaxCountdown : public nlohmann::json::json_sax_t
151 bool number_integer(json::number_integer_t) override in number_integer()
[all …]
Dunit-deserialization.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
32 #include <nlohmann/json.hpp>
33 using nlohmann::json;
41 struct SaxEventLogger : public nlohmann::json_sax<json>
55 bool number_integer(json::number_integer_t val) override in number_integer()
61 bool number_unsigned(json::number_unsigned_t val) override in number_unsigned()
67 bool number_float(json::number_float_t, const std::string& s) override in number_float()
123 bool parse_error(std::size_t position, const std::string&, const json::exception&) override in parse_error()
184 json j = json::parse(ss1);
[all …]
Dunit-class_lexer.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
33 #include <nlohmann/json.hpp>
34 using nlohmann::json;
40 json::lexer::token_type scan_string(const char* s);
41 json::lexer::token_type scan_string(const char* s) in scan_string()
43 return json::lexer(nlohmann::detail::input_adapter(s)).scan(); in scan_string()
53 CHECK((scan_string("[") == json::lexer::token_type::begin_array));
54 CHECK((scan_string("]") == json::lexer::token_type::end_array));
55 CHECK((scan_string("{") == json::lexer::token_type::begin_object));
[all …]
Dunit-concepts.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
32 #include <nlohmann/json.hpp>
33 using nlohmann::json;
37 SECTION("container requirements for json")
39 // X: container class: json
40 // T: type of objects: json
41 // a, b: values of type X: json
46 CHECK((std::is_same<json::value_type, json>::value));
49 CHECK((std::is_same<json::reference, json&>::value));
[all …]
Dunit-bson.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
32 #include <nlohmann/json.hpp>
33 using nlohmann::json;
44 json j = nullptr;
45 CHECK_THROWS_AS(json::to_bson(j), json::type_error&);
46 …CHECK_THROWS_WITH(json::to_bson(j), "[json.exception.type_error.317] to serialize to BSON, top-lev…
53 json j = true;
54 CHECK_THROWS_AS(json::to_bson(j), json::type_error&);
55 …CHECK_THROWS_WITH(json::to_bson(j), "[json.exception.type_error.317] to serialize to BSON, top-lev…
[all …]
Dunit-class_const_iterator.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
33 #include <nlohmann/json.hpp>
34 using nlohmann::json;
45 json j(json::value_t::null);
46 json::const_iterator it(&j);
51 json j(json::value_t::object);
52 json::const_iterator it(&j);
57 json j(json::value_t::array);
58 json::const_iterator it(&j);
[all …]
Dunit-merge_patch.cpp3 __| | __| | | | JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
32 #include <nlohmann/json.hpp>
33 using nlohmann::json;
35 TEST_CASE("JSON Merge Patch")
41 json document = R"({
49 json patch = R"({
56 json expected = R"({
69 json document = R"({
82 json patch = R"({
[all …]
/third_party/grpc/test/core/json/
Djson_test.cc30 #include "src/core/lib/json/json.h"
36 void ValidateValue(const Json& actual, const Json& expected);
38 void ValidateObject(const Json::Object& actual, const Json::Object& expected) { in ValidateObject()
48 void ValidateArray(const Json::Array& actual, const Json::Array& expected) { in ValidateArray()
55 void ValidateValue(const Json& actual, const Json& expected) { in ValidateValue()
58 case Json::Type::JSON_NULL: in ValidateValue()
59 case Json::Type::JSON_TRUE: in ValidateValue()
60 case Json::Type::JSON_FALSE: in ValidateValue()
62 case Json::Type::STRING: in ValidateValue()
63 case Json::Type::NUMBER: in ValidateValue()
[all …]
/third_party/json/
DChangeLog.md4 ## [v3.7.3](https://github.com/nlohmann/json/releases/tag/v3.7.3) (2019-11-17)
5 [Full Changelog](https://github.com/nlohmann/json/compare/v3.7.2...v3.7.3)
7 - Project branches [\#1839](https://github.com/nlohmann/json/issues/1839)
8 - Quadratic destruction complexity introduced in \#1436 [\#1837](https://github.com/nlohmann/json/i…
9 - Trying to open a file [\#1814](https://github.com/nlohmann/json/issues/1814)
10 …ta type with value\_t::number\_integer fails [\#1783](https://github.com/nlohmann/json/issues/1783)
11 - CMake version config file is architecture-dependent [\#1697](https://github.com/nlohmann/json/iss…
13 - Fix quadratic destruction complexity [\#1838](https://github.com/nlohmann/json/pull/1838) ([nicka…
15 ## [v3.7.2](https://github.com/nlohmann/json/releases/tag/v3.7.2) (2019-11-10)
16 [Full Changelog](https://github.com/nlohmann/json/compare/v3.7.1...v3.7.2)
[all …]
/third_party/jsoncpp/src/test_lib_json/
Dmain.cpp21 #include <json/config.h>
22 #include <json/json.h>
28 typedef Json::CharReader* CharReaderPtr;
32 #define kint32max Json::Value::maxInt
33 #define kint32min Json::Value::minInt
34 #define kuint32max Json::Value::maxUInt
35 #define kint64max Json::Value::maxInt64
36 #define kint64min Json::Value::minInt64
37 #define kuint64max Json::Value::maxUInt64
46 // Json Library test cases
[all …]
/third_party/jsoncpp/src/jsontestrunner/
Dmain.cpp13 /* This executable is used for testing parser/writer using real JSON files.
19 #include <json/json.h>
24 Json::String path;
25 Json::Features features;
28 typedef Json::String (*writeFuncType)(Json::Value const&);
33 static Json::String normalizeFloatingPointStr(double value) { in normalizeFloatingPointStr()
37 Json::String s(buffer); in normalizeFloatingPointStr()
38 Json::String::size_type index = s.find_last_of("eE"); in normalizeFloatingPointStr()
39 if (index != Json::String::npos) { in normalizeFloatingPointStr()
40 Json::String::size_type hasSign = in normalizeFloatingPointStr()
[all …]
/third_party/jerryscript/tests/jerry/
Djson-stringify.js16 assert (JSON.stringify ("") === '""');
19 assert (JSON.stringify (normal_string) == '"asdasd"');
22 assert (JSON.stringify (format_characters) == '"\\ba\\fs\\nd\\ra\\tsd"');
25 assert (JSON.stringify (ctl_string) == '"asd\\u001fasd"');
28 assert (JSON.stringify (escpad_string) == '"\\"asdasd"');
30 assert (JSON.stringify('\u2040') == '"⁀"');
31 assert (JSON.stringify('abc\u2040\u2030cba') == '"abc⁀‰cba"');
34 assert (JSON.stringify (1) === '1');
35 assert (JSON.stringify (true) === 'true');
36 assert (JSON.stringify ("foo") === '"foo"');
[all …]

12345678910>>...131