Go to the source code of this file.
|
| | TEST (PrettyWriter, Basic) |
| |
| | TEST (PrettyWriter, FormatOptions) |
| |
| | TEST (PrettyWriter, SetIndent) |
| |
| | TEST (PrettyWriter, String) |
| |
| | TEST (PrettyWriter, OStreamWrapper) |
| |
| | TEST (PrettyWriter, FileWriteStream) |
| |
| | TEST (PrettyWriter, RawValue) |
| |
| | TEST (PrettyWriter, InvalidEventSequence) |
| |
| | TEST (PrettyWriter, NaN) |
| |
| | TEST (PrettyWriter, Inf) |
| |
| | TEST (PrettyWriter, Issue_889) |
| |
◆ TEST() [1/11]
Definition at line 60 of file prettywritertest.cpp.
65 reader.
Parse(s, writer);
#define EXPECT_STREQ(s1, s2)
ParseResult Parse(InputStream &is, Handler &handler)
Parse JSON text.
Writer with indentation and spacing.
const Ch * GetString() const
◆ TEST() [2/11]
Definition at line 69 of file prettywritertest.cpp.
75 reader.
Parse(s, writer);
#define EXPECT_STREQ(s1, s2)
ParseResult Parse(InputStream &is, Handler &handler)
Parse JSON text.
Writer with indentation and spacing.
const Ch * GetString() const
Format arrays on a single line.
◆ TEST() [3/11]
Definition at line 79 of file prettywritertest.cpp.
82 writer.SetIndent(
'\t', 1);
85 reader.
Parse(s, writer);
88 "\t\"hello\": \"world\",\n" 100 "\t\"u64\": 1234567890123456789,\n" 101 "\t\"i64\": -1234567890123456789\n"
#define EXPECT_STREQ(s1, s2)
ParseResult Parse(InputStream &is, Handler &handler)
Parse JSON text.
Writer with indentation and spacing.
const Ch * GetString() const
◆ TEST() [4/11]
Definition at line 106 of file prettywritertest.cpp.
#define EXPECT_TRUE(condition)
#define EXPECT_STREQ(s1, s2)
Writer with indentation and spacing.
const Ch * GetString() const
◆ TEST() [5/11]
Definition at line 151 of file prettywritertest.cpp.
154 std::stringstream ss;
160 reader.
Parse(s, writer);
#define EXPECT_STREQ(s1, s2)
ParseResult Parse(InputStream &is, Handler &handler)
Parse JSON text.
Writer with indentation and spacing.
◆ TEST() [6/11]
Definition at line 167 of file prettywritertest.cpp.
168 char filename[L_tmpnam];
176 reader.
Parse(s, writer);
179 fp = fopen(filename,
"rb");
180 fseek(fp, 0, SEEK_END);
181 size_t size =
static_cast<size_t>(ftell(fp));
182 fseek(fp, 0, SEEK_SET);
183 char*
json =
static_cast<char*
>(malloc(size + 1));
184 size_t readLength = fread(
json, 1, size, fp);
185 json[readLength] =
'\0';
#define EXPECT_STREQ(s1, s2)
FILE * TempFile(char *filename)
ParseResult Parse(InputStream &is, Handler &handler)
Parse JSON text.
Writer with indentation and spacing.
#define ASSERT_TRUE(condition)
Wrapper of C file stream for output using fwrite().
◆ TEST() [7/11]
Definition at line 192 of file prettywritertest.cpp.
195 writer.StartObject();
199 const char json[] =
"[\"Hello\\nWorld\", 123.456]";
206 " \"raw\": [\"Hello\\nWorld\", 123.456]\n"
#define EXPECT_TRUE(condition)
#define EXPECT_STREQ(s1, s2)
Writer with indentation and spacing.
const Ch * GetString() const
◆ TEST() [8/11]
Definition at line 211 of file prettywritertest.cpp.
216 writer.StartObject();
234 writer.StartObject();
243 writer.StartObject();
253 writer.StartObject();
#define EXPECT_THROW(statement, expected_exception)
Writer with indentation and spacing.
#define EXPECT_FALSE(condition)
◆ TEST() [9/11]
Definition at line 262 of file prettywritertest.cpp.
263 double nan = std::numeric_limits<double>::quiet_NaN();
#define EXPECT_TRUE(condition)
#define EXPECT_STREQ(s1, s2)
C-runtime library allocator.
Writer with indentation and spacing.
const Ch * GetString() const
#define EXPECT_FALSE(condition)
Allow writing of Infinity, -Infinity and NaN.
◆ TEST() [10/11]
Definition at line 281 of file prettywritertest.cpp.
282 double inf = std::numeric_limits<double>::infinity();
#define EXPECT_TRUE(condition)
#define EXPECT_STREQ(s1, s2)
C-runtime library allocator.
Writer with indentation and spacing.
const Ch * GetString() const
#define EXPECT_FALSE(condition)
Allow writing of Infinity, -Infinity and NaN.
◆ TEST() [11/11]
Definition at line 305 of file prettywritertest.cpp.
306 char buf[100] =
"Hello";
#define EXPECT_TRUE(condition)
#define EXPECT_STREQ(s1, s2)
Writer with indentation and spacing.
const Ch * GetString() const