diff options
Diffstat (limited to '3rdparty/rapidjson/test/unittest/schematest.cpp')
-rw-r--r-- | 3rdparty/rapidjson/test/unittest/schematest.cpp | 18 |
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 |