MCPcopy Create free account
hub / github.com/Tencent/rapidjson / TestStringStream

Function TestStringStream

test/unittest/ostreamwrappertest.cpp:27–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26template <typename StringStreamType>
27static void TestStringStream() {
28 typedef typename StringStreamType::char_type Ch;
29
30 Ch s[] = { 'A', 'B', 'C', '\0' };
31 StringStreamType oss(s);
32 BasicOStreamWrapper<StringStreamType> os(oss);
33 for (size_t i = 0; i < 3; i++)
34 os.Put(s[i]);
35 os.Flush();
36 for (size_t i = 0; i < 3; i++)
37 EXPECT_EQ(s[i], oss.str()[i]);
38}
39
40TEST(OStreamWrapper, ostringstream) {
41 TestStringStream<ostringstream>();

Callers

nothing calls this directly

Calls 2

PutMethod · 0.45
FlushMethod · 0.45

Tested by

no test coverage detected