summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/rapidjson/test/unittest/schematest.cpp
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-03-08 11:39:25 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2016-03-08 12:58:10 +0100
commit1f352c6af853e5cb0dc06ea6596be77db953a9fd (patch)
tree361bae19c8e605572cafc4a656c19c748c27a9d3 /3rdparty/rapidjson/test/unittest/schematest.cpp
parentdfad813239c6c4259040892616f44fbbe260ab73 (diff)
update rapidjson library (nw)
Diffstat (limited to '3rdparty/rapidjson/test/unittest/schematest.cpp')
-rw-r--r--3rdparty/rapidjson/test/unittest/schematest.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/3rdparty/rapidjson/test/unittest/schematest.cpp b/3rdparty/rapidjson/test/unittest/schematest.cpp
index 623c65ac61e..7182ad29426 100644
--- a/3rdparty/rapidjson/test/unittest/schematest.cpp
+++ b/3rdparty/rapidjson/test/unittest/schematest.cpp
@@ -1152,6 +1152,24 @@ TEST(SchemaValidatingWriter, Simple) {
EXPECT_TRUE(validator.GetInvalidDocumentPointer() == SchemaDocument::PointerType(""));
}
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+
+static SchemaDocument ReturnSchemaDocument() {
+ Document sd;
+ sd.Parse("{ \"type\": [\"number\", \"string\"] }");
+ SchemaDocument s(sd);
+ return s;
+}
+
+TEST(Schema, Issue552) {
+ SchemaDocument s = ReturnSchemaDocument();
+ VALIDATE(s, "42", true);
+ VALIDATE(s, "\"Life, the universe, and everything\"", true);
+ INVALIDATE(s, "[\"Life\", \"the universe\", \"and everything\"]", "", "type", "");
+}
+
+#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
+
#ifdef __clang__
RAPIDJSON_DIAG_POP
#endif