jsoncheckertest: add checks for iterative parser as well
This commit is contained in:
parent
834109557d
commit
d84c051564
@ -65,8 +65,11 @@ TEST(JsonChecker, Reader) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GenericDocument<UTF8<>, CrtAllocator> document; // Use Crt allocator to check exception-safety (no memory leak)
|
GenericDocument<UTF8<>, CrtAllocator> document; // Use Crt allocator to check exception-safety (no memory leak)
|
||||||
if (!document.Parse((const char*)json).HasParseError())
|
document.Parse((const char*)json);
|
||||||
ADD_FAILURE_AT(filename, document.GetErrorOffset());
|
EXPECT_TRUE(document.HasParseError());
|
||||||
|
|
||||||
|
document.Parse<kParseIterativeFlag>((const char*)json);
|
||||||
|
EXPECT_TRUE(document.HasParseError());
|
||||||
|
|
||||||
free(json);
|
free(json);
|
||||||
}
|
}
|
||||||
@ -87,7 +90,11 @@ TEST(JsonChecker, Reader) {
|
|||||||
|
|
||||||
GenericDocument<UTF8<>, CrtAllocator> document; // Use Crt allocator to check exception-safety (no memory leak)
|
GenericDocument<UTF8<>, CrtAllocator> document; // Use Crt allocator to check exception-safety (no memory leak)
|
||||||
document.Parse((const char*)json);
|
document.Parse((const char*)json);
|
||||||
EXPECT_TRUE(!document.HasParseError());
|
EXPECT_FALSE(document.HasParseError());
|
||||||
|
|
||||||
|
document.Parse<kParseIterativeFlag>((const char*)json);
|
||||||
|
EXPECT_FALSE(document.HasParseError());
|
||||||
|
|
||||||
free(json);
|
free(json);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user