Merged MsgPackError and JsonError into DeserializationError.

Return NotSupported if the JSON input contains "\u".
This commit is contained in:
Benoit Blanchon
2018-05-15 18:23:09 +02:00
parent ccb54136a2
commit 4592f23260
38 changed files with 574 additions and 636 deletions

View File

@ -12,10 +12,10 @@ TEST_CASE("deserializeJson(std::istream&)") {
SECTION("array") {
std::istringstream json(" [ 42 /* comment */ ] ");
JsonError err = deserializeJson(doc, json);
DeserializationError err = deserializeJson(doc, json);
JsonArray& arr = doc.as<JsonArray>();
REQUIRE(err == JsonError::Ok);
REQUIRE(err == DeserializationError::Ok);
REQUIRE(1 == arr.size());
REQUIRE(42 == arr[0]);
}
@ -23,10 +23,10 @@ TEST_CASE("deserializeJson(std::istream&)") {
SECTION("object") {
std::istringstream json(" { hello : world // comment\n }");
JsonError err = deserializeJson(doc, json);
DeserializationError err = deserializeJson(doc, json);
JsonObject& obj = doc.as<JsonObject>();
REQUIRE(err == JsonError::Ok);
REQUIRE(err == DeserializationError::Ok);
REQUIRE(1 == obj.size());
REQUIRE(std::string("world") == obj["hello"]);
}