mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-10-27 19:10:24 +01:00
Improved reporting
Add “filename” to the error message when JsonChecker reports an error.
This commit is contained in:
@@ -69,10 +69,10 @@ 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(json);
|
document.Parse(json);
|
||||||
EXPECT_TRUE(document.HasParseError());
|
EXPECT_TRUE(document.HasParseError()) << filename;
|
||||||
|
|
||||||
document.Parse<kParseIterativeFlag>(json);
|
document.Parse<kParseIterativeFlag>(json);
|
||||||
EXPECT_TRUE(document.HasParseError());
|
EXPECT_TRUE(document.HasParseError()) << filename;
|
||||||
|
|
||||||
free(json);
|
free(json);
|
||||||
}
|
}
|
||||||
@@ -89,10 +89,10 @@ 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(json);
|
document.Parse(json);
|
||||||
EXPECT_FALSE(document.HasParseError());
|
EXPECT_FALSE(document.HasParseError()) << filename;
|
||||||
|
|
||||||
document.Parse<kParseIterativeFlag>(json);
|
document.Parse<kParseIterativeFlag>(json);
|
||||||
EXPECT_FALSE(document.HasParseError());
|
EXPECT_FALSE(document.HasParseError()) << filename;
|
||||||
|
|
||||||
free(json);
|
free(json);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user