summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/rapidjson/test/unittest/schematest.cpp
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2016-03-12 12:31:13 +0100
committer ImJezze <jezze@gmx.net>2016-03-12 12:31:13 +0100
commita026a582f1a0ea8c1ede3acaddacef506ef3f3b0 (patch)
treee31573822f2359677de519f9f3b600d98e8764cd /3rdparty/rapidjson/test/unittest/schematest.cpp
parent477d2abd43984f076b7e45f5527591fa8fd0d241 (diff)
parentdcab55bf53b94713a6f72e9633f5101c8dd6c08c (diff)
Merge pull request #15 from mamedev/master
Sync to base master
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