Commit 985971a5 authored by miloyip's avatar miloyip

Fix gcc/clang compilation

parent 3bc95ecd
...@@ -32,6 +32,8 @@ template <typename DocumentType> ...@@ -32,6 +32,8 @@ template <typename DocumentType>
void ParseCheck(DocumentType& doc) { void ParseCheck(DocumentType& doc) {
typedef typename DocumentType::ValueType ValueType; typedef typename DocumentType::ValueType ValueType;
EXPECT_FALSE(doc.HasParseError());
EXPECT_TRUE(doc.IsObject()); EXPECT_TRUE(doc.IsObject());
EXPECT_TRUE(doc.HasMember("hello")); EXPECT_TRUE(doc.HasMember("hello"));
...@@ -76,17 +78,17 @@ void ParseTest() { ...@@ -76,17 +78,17 @@ void ParseTest() {
const char* json = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } "; const char* json = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";
EXPECT_FALSE(doc.Parse(json).HasParseError()); doc.Parse(json);
ParseCheck(doc); ParseCheck(doc);
doc.SetNull(); doc.SetNull();
StringStream s(json); StringStream s(json);
EXPECT_FALSE(doc.ParseStream<0>( s).HasParseError()); doc.template ParseStream<0>(s);
ParseCheck(doc); ParseCheck(doc);
doc.SetNull(); doc.SetNull();
char *buffer = strdup(json); char *buffer = strdup(json);
EXPECT_FALSE(doc.ParseInsitu(buffer).HasParseError()); doc.ParseInsitu(buffer);
ParseCheck(doc); ParseCheck(doc);
free(buffer); free(buffer);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment