@@ -2054,16 +2054,16 @@ JSONTEST_FIXTURE(StyledWriterTest, multiLineArray) {
2054
2054
{
2055
2055
// Array member has more than 20 print effect rendering lines
2056
2056
const Json::String expected (" [\n "
2057
- " 0,\n 1,\n 2,\n "
2058
- " 3,\n 4,\n 5,\n "
2059
- " 6,\n 7,\n 8,\n "
2060
- " 9,\n 10,\n 11,\n "
2061
- " 12,\n 13,\n 14,\n "
2062
- " 15,\n 16,\n 17,\n "
2063
- " 18,\n 19,\n 20\n ]\n " );
2057
+ " 0,\n 1,\n 2,\n "
2058
+ " 3,\n 4,\n 5,\n "
2059
+ " 6,\n 7,\n 8,\n "
2060
+ " 9,\n 10,\n 11,\n "
2061
+ " 12,\n 13,\n 14,\n "
2062
+ " 15,\n 16,\n 17,\n "
2063
+ " 18,\n 19,\n 20\n ]\n " );
2064
2064
Json::Value root;
2065
2065
for (int i = 0 ; i < 21 ; i++)
2066
- root[i] = i;
2066
+ root[i] = i;
2067
2067
const Json::String result = writer.write (root);
2068
2068
JSONTEST_ASSERT_STRING_EQUAL (expected, result);
2069
2069
}
@@ -2072,7 +2072,7 @@ JSONTEST_FIXTURE(StyledWriterTest, multiLineArray) {
2072
2072
const Json::String expected (" [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n " );
2073
2073
Json::Value root;
2074
2074
for (int i = 0 ; i < 10 ; i++)
2075
- root[i] = i;
2075
+ root[i] = i;
2076
2076
const Json::String result = writer.write (root);
2077
2077
JSONTEST_ASSERT_STRING_EQUAL (expected, result);
2078
2078
}
@@ -2083,8 +2083,7 @@ JSONTEST_FIXTURE(StyledWriterTest, writeValueWithComment) {
2083
2083
{
2084
2084
const Json::String expected (" \n //commentBeforeValue\n\" hello\"\n " );
2085
2085
Json::Value root = " hello" ;
2086
- root.setComment (Json::String (" //commentBeforeValue" ),
2087
- Json::commentBefore);
2086
+ root.setComment (Json::String (" //commentBeforeValue" ), Json::commentBefore);
2088
2087
const Json::String result = writer.write (root);
2089
2088
JSONTEST_ASSERT_STRING_EQUAL (expected, result);
2090
2089
}
@@ -2099,8 +2098,7 @@ JSONTEST_FIXTURE(StyledWriterTest, writeValueWithComment) {
2099
2098
{
2100
2099
const Json::String expected (" \" hello\"\n //commentAfter\n\n " );
2101
2100
Json::Value root = " hello" ;
2102
- root.setComment (Json::String (" //commentAfter" ),
2103
- Json::commentAfter);
2101
+ root.setComment (Json::String (" //commentAfter" ), Json::commentAfter);
2104
2102
const Json::String result = writer.write (root);
2105
2103
JSONTEST_ASSERT_STRING_EQUAL (expected, result);
2106
2104
}
@@ -2177,44 +2175,42 @@ JSONTEST_FIXTURE(StyledStreamWriterTest, multiLineArray) {
2177
2175
Json::StyledStreamWriter writer;
2178
2176
{
2179
2177
// Array member has more than 20 print effect rendering lines
2180
- const Json::String expected (
2181
- " ["
2182
- " \n\t 0,"
2183
- " \n\t 1,"
2184
- " \n\t 2,"
2185
- " \n\t 3,"
2186
- " \n\t 4,"
2187
- " \n\t 5,"
2188
- " \n\t 6,"
2189
- " \n\t 7,"
2190
- " \n\t 8,"
2191
- " \n\t 9,"
2192
- " \n\t 10,"
2193
- " \n\t 11,"
2194
- " \n\t 12,"
2195
- " \n\t 13,"
2196
- " \n\t 14,"
2197
- " \n\t 15,"
2198
- " \n\t 16,"
2199
- " \n\t 17,"
2200
- " \n\t 18,"
2201
- " \n\t 19,"
2202
- " \n\t 20\n ]\n " );
2178
+ const Json::String expected (" [\n\t 0,"
2179
+ " \n\t 1,"
2180
+ " \n\t 2,"
2181
+ " \n\t 3,"
2182
+ " \n\t 4,"
2183
+ " \n\t 5,"
2184
+ " \n\t 6,"
2185
+ " \n\t 7,"
2186
+ " \n\t 8,"
2187
+ " \n\t 9,"
2188
+ " \n\t 10,"
2189
+ " \n\t 11,"
2190
+ " \n\t 12,"
2191
+ " \n\t 13,"
2192
+ " \n\t 14,"
2193
+ " \n\t 15,"
2194
+ " \n\t 16,"
2195
+ " \n\t 17,"
2196
+ " \n\t 18,"
2197
+ " \n\t 19,"
2198
+ " \n\t 20\n ]\n " );
2203
2199
Json::StyledStreamWriter writer;
2204
2200
Json::Value root;
2205
2201
for (int i = 0 ; i < 21 ; i++)
2206
- root[i] = i;
2202
+ root[i] = i;
2207
2203
Json::OStringStream sout;
2208
2204
writer.write (sout, root);
2209
2205
const Json::String result = sout.str ();
2210
2206
JSONTEST_ASSERT_STRING_EQUAL (expected, result);
2211
2207
}
2212
- {
2208
+ {
2213
2209
// Array members do not exceed 21 print effects to render a single line
2214
2210
const Json::String expected (" [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n " );
2215
2211
Json::Value root;
2216
2212
for (int i = 0 ; i < 10 ; i++)
2217
- root[i] = i;
2213
+ root[i] = i;
2218
2214
Json::OStringStream sout;
2219
2215
writer.write (sout, root);
2220
2216
const Json::String result = sout.str ();
@@ -2228,8 +2224,7 @@ JSONTEST_FIXTURE(StyledStreamWriterTest, writeValueWithComment) {
2228
2224
const Json::String expected (" //commentBeforeValue\n\" hello\"\n " );
2229
2225
Json::Value root = " hello" ;
2230
2226
Json::OStringStream sout;
2231
- root.setComment (Json::String (" //commentBeforeValue" ),
2232
- Json::commentBefore);
2227
+ root.setComment (Json::String (" //commentBeforeValue" ), Json::commentBefore);
2233
2228
writer.write (sout, root);
2234
2229
const Json::String result = sout.str ();
2235
2230
JSONTEST_ASSERT_STRING_EQUAL (expected, result);
@@ -2248,8 +2243,7 @@ JSONTEST_FIXTURE(StyledStreamWriterTest, writeValueWithComment) {
2248
2243
const Json::String expected (" \" hello\"\n //commentAfter\n " );
2249
2244
Json::Value root = " hello" ;
2250
2245
Json::OStringStream sout;
2251
- root.setComment (Json::String (" //commentAfter" ),
2252
- Json::commentAfter);
2246
+ root.setComment (Json::String (" //commentAfter" ), Json::commentAfter);
2253
2247
writer.write (sout, root);
2254
2248
const Json::String result = sout.str ();
2255
2249
JSONTEST_ASSERT_STRING_EQUAL (expected, result);
@@ -2326,42 +2320,41 @@ JSONTEST_FIXTURE(StreamWriterTest, multiLineArray) {
2326
2320
wb.settings_ [" commentStyle" ] = " None" ;
2327
2321
{
2328
2322
// When wb.settings_["commentStyle"] = "None", the effect of
2329
- // printing multiple lines will be displayed when there are
2323
+ // printing multiple lines will be displayed when there are
2330
2324
// more than 20 array members.
2331
- const Json::String expected (
2332
- " [\n\t 0,"
2333
- " \n\t 1,"
2334
- " \n\t 2,"
2335
- " \n\t 3,"
2336
- " \n\t 4,"
2337
- " \n\t 5,"
2338
- " \n\t 6,"
2339
- " \n\t 7,"
2340
- " \n\t 8,"
2341
- " \n\t 9,"
2342
- " \n\t 10,"
2343
- " \n\t 11,"
2344
- " \n\t 12,"
2345
- " \n\t 13,"
2346
- " \n\t 14,"
2347
- " \n\t 15,"
2348
- " \n\t 16,"
2349
- " \n\t 17,"
2350
- " \n\t 18,"
2351
- " \n\t 19,"
2352
- " \n\t 20\n ]" );
2325
+ const Json::String expected (" [\n\t 0,"
2326
+ " \n\t 1,"
2327
+ " \n\t 2,"
2328
+ " \n\t 3,"
2329
+ " \n\t 4,"
2330
+ " \n\t 5,"
2331
+ " \n\t 6,"
2332
+ " \n\t 7,"
2333
+ " \n\t 8,"
2334
+ " \n\t 9,"
2335
+ " \n\t 10,"
2336
+ " \n\t 11,"
2337
+ " \n\t 12,"
2338
+ " \n\t 13,"
2339
+ " \n\t 14,"
2340
+ " \n\t 15,"
2341
+ " \n\t 16,"
2342
+ " \n\t 17,"
2343
+ " \n\t 18,"
2344
+ " \n\t 19,"
2345
+ " \n\t 20\n ]" );
2353
2346
Json::Value root;
2354
2347
for (int i = 0 ; i < 21 ; i++)
2355
- root[i] = i;
2348
+ root[i] = i;
2356
2349
const Json::String result = Json::writeString (wb, root);
2357
2350
JSONTEST_ASSERT_STRING_EQUAL (expected, result);
2358
2351
}
2359
2352
{
2360
- // Array members do not exceed 21 print effects to render a single line
2353
+ // Array members do not exceed 21 print effects to render a single line
2361
2354
const Json::String expected (" [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]" );
2362
2355
Json::Value root;
2363
2356
for (int i = 0 ; i < 10 ; i++)
2364
- root[i] = i;
2357
+ root[i] = i;
2365
2358
const Json::String result = Json::writeString (wb, root);
2366
2359
JSONTEST_ASSERT_STRING_EQUAL (expected, result);
2367
2360
}
@@ -3169,7 +3162,8 @@ int main(int argc, const char* argv[]) {
3169
3162
JSONTEST_REGISTER_FIXTURE (runner, StyledStreamWriterTest, writeArrays);
3170
3163
JSONTEST_REGISTER_FIXTURE (runner, StyledStreamWriterTest, writeNestedObjects);
3171
3164
JSONTEST_REGISTER_FIXTURE (runner, StyledStreamWriterTest, multiLineArray);
3172
- JSONTEST_REGISTER_FIXTURE (runner, StyledStreamWriterTest, writeValueWithComment);
3165
+ JSONTEST_REGISTER_FIXTURE (runner, StyledStreamWriterTest,
3166
+ writeValueWithComment);
3173
3167
JSONTEST_REGISTER_FIXTURE (runner, StreamWriterTest, writeNumericValue);
3174
3168
JSONTEST_REGISTER_FIXTURE (runner, StreamWriterTest, writeArrays);
3175
3169
JSONTEST_REGISTER_FIXTURE (runner, StreamWriterTest, writeNestedObjects);
0 commit comments