mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-10-27 11:06:53 +01:00
Added unittests for invalid ascii control chars
This commit is contained in:
@@ -401,6 +401,16 @@ TEST(Writer, InvalidEncoding) {
|
||||
static const UTF32<>::Ch s[] = { 0x110000, 0 }; // Out of U+0000 to U+10FFFF
|
||||
EXPECT_FALSE(writer.String(s));
|
||||
}
|
||||
|
||||
// Fail in decoding invalid ASCII control bytes
|
||||
{
|
||||
GenericStringBuffer<UTF16<> > buffer;
|
||||
Writer<GenericStringBuffer<UTF16<> >, UTF8<>, UTF16<> > writer(buffer);
|
||||
writer.StartArray();
|
||||
EXPECT_FALSE(writer.String("\x01"));
|
||||
EXPECT_FALSE(writer.String("\x1C"));
|
||||
writer.EndArray();
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Writer, ValidateEncoding) {
|
||||
|
||||
Reference in New Issue
Block a user