Example #1
0
TEST_F(RapidJson, SIMD_SUFFIX(DocumentParse_CrtAllocator)) {
    for (size_t i = 0; i < kTrialCount; i++) {
        memcpy(temp_, json_, length_ + 1);
        GenericDocument<UTF8<>, CrtAllocator> doc;
        doc.Parse(temp_);
        ASSERT_TRUE(doc.IsObject());
    }
}
TEST(IStreamWrapper, wfstream)
{ wfstream fs;
  ASSERT_TRUE(Open(fs, "utf16bebom.json"));
  fs.imbue(std::locale(fs.getloc(),
                       new std::codecvt_utf16<wchar_t, 0x10ffff, std::consume_header>));
  WIStreamWrapper isw(fs);
  GenericDocument<UTF16<> > d;
  d.ParseStream<kParseDefaultFlags, UTF16<>, WIStreamWrapper>(isw);
  EXPECT_TRUE(!d.HasParseError());
  EXPECT_TRUE(d.IsObject());
  EXPECT_EQ(5, d.MemberCount());
}