MCPcopy Create free account
hub / github.com/apache/qpid-proton / test_invalid_json

Function test_invalid_json

cpp/src/connect_config_test.cpp:126–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126void test_invalid_json() {
127 connection_options opts;
128 // ancient versions of jsoncpp use a generic error message for parse errors
129 // in the exception, and print the detailed message to stderr
130 // https://github.com/open-source-parsers/jsoncpp/commit/6b10ce8c0d07ea07861e82f65f17d9fd6abd658d
131 if (std::make_tuple(JSONCPP_VERSION_MAJOR, JSONCPP_VERSION_MINOR) < std::make_tuple(1, 7)) {
132 ASSERT_THROWS_MSG(proton::error, "reader error", configure(opts, "{"));
133 ASSERT_THROWS_MSG(proton::error, "reader error", configure(opts, ""));
134 ASSERT_THROWS_MSG(proton::error, "reader error", configure(opts, R"({ "user" : "x" "host" : "y"})"));
135 } else {
136 ASSERT_THROWS_MSG(proton::error, "Missing '}'", configure(opts, "{"));
137 ASSERT_THROWS_MSG(proton::error, "Syntax error", configure(opts, ""));
138 ASSERT_THROWS_MSG(proton::error, "Missing ','", configure(opts, R"({ "user":"x" "host":"y"})"));
139 }
140}
141
142class test_almost_default_connect : public test_handler {
143 public:

Callers 1

mainFunction · 0.85

Calls 1

configureFunction · 0.85

Tested by

no test coverage detected