26template <
typename StringStreamType>
27static void TestStringStream() {
28 typedef typename StringStreamType::char_type
Ch;
30 Ch s[] = {
'A',
'B',
'C',
'\0' };
31 StringStreamType oss(
s);
33 for (
size_t i = 0; i < 3; i++)
36 for (
size_t i = 0; i < 3; i++)
41 TestStringStream<ostringstream>();
45 TestStringStream<stringstream>();
49 TestStringStream<wostringstream>();
53 TestStringStream<wstringstream>();
58 const char*
s =
"Hello World!\n";
64template <
typename FileStreamType>
65static void TestFileStream() {
66 char filename[L_tmpnam];
70 const char*
s =
"Hello World!\n";
72 FileStreamType ofs(filename, ios::out | ios::binary);
74 for (
const char*
p =
s; *
p;
p++)
79 fp = fopen(filename,
"r");
81 for (
const char*
p =
s; *
p;
p++)
87 TestFileStream<ofstream>();
91 TestFileStream<fstream>();
Wrapper of std::basic_ostream into RapidJSON's Stream concept.
#define EXPECT_EQ(val1, val2)
#define TEST(test_case_name, test_name)
#define ASSERT_TRUE(condition)
FILE * TempFile(char *filename)