Commit 4bcedab5 authored by miloyip's avatar miloyip

Try to improve coverage of encodings

parent 04011cda
...@@ -487,6 +487,17 @@ TEST(Reader, ParseString_Transcoding) { ...@@ -487,6 +487,17 @@ TEST(Reader, ParseString_Transcoding) {
EXPECT_EQ(StrLen(e), h.length_); EXPECT_EQ(StrLen(e), h.length_);
} }
TEST(Reader, ParseString_TranscodingWithValidation) {
const char* x = "\"Hello\"";
const wchar_t* e = L"Hello";
GenericStringStream<UTF8<> > is(x);
GenericReader<UTF8<>, UTF16<> > reader;
ParseStringHandler<UTF16<> > h;
reader.Parse<kParseValidateEncodingFlag>(is, h);
EXPECT_EQ(0, StrCmp<UTF16<>::Ch>(e, h.str_));
EXPECT_EQ(StrLen(e), h.length_);
}
TEST(Reader, ParseString_NonDestructive) { TEST(Reader, ParseString_NonDestructive) {
StringStream s("\"Hello\\nWorld\""); StringStream s("\"Hello\\nWorld\"");
ParseStringHandler<UTF8<> > h; ParseStringHandler<UTF8<> > h;
......
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