Skip to content

Commit 7329223

Browse files
authored
fix clang-format (open-source-parsers#1049)
fix clang-format for open-source-parsers#1039
1 parent 2e33c21 commit 7329223

File tree

1 file changed

+64
-70
lines changed

1 file changed

+64
-70
lines changed

src/test_lib_json/main.cpp

Lines changed: 64 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,16 +2054,16 @@ JSONTEST_FIXTURE(StyledWriterTest, multiLineArray) {
20542054
{
20552055
// Array member has more than 20 print effect rendering lines
20562056
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");
20642064
Json::Value root;
20652065
for (int i = 0; i < 21; i++)
2066-
root[i] = i;
2066+
root[i] = i;
20672067
const Json::String result = writer.write(root);
20682068
JSONTEST_ASSERT_STRING_EQUAL(expected, result);
20692069
}
@@ -2072,7 +2072,7 @@ JSONTEST_FIXTURE(StyledWriterTest, multiLineArray) {
20722072
const Json::String expected("[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n");
20732073
Json::Value root;
20742074
for (int i = 0; i < 10; i++)
2075-
root[i] = i;
2075+
root[i] = i;
20762076
const Json::String result = writer.write(root);
20772077
JSONTEST_ASSERT_STRING_EQUAL(expected, result);
20782078
}
@@ -2083,8 +2083,7 @@ JSONTEST_FIXTURE(StyledWriterTest, writeValueWithComment) {
20832083
{
20842084
const Json::String expected("\n//commentBeforeValue\n\"hello\"\n");
20852085
Json::Value root = "hello";
2086-
root.setComment(Json::String("//commentBeforeValue"),
2087-
Json::commentBefore);
2086+
root.setComment(Json::String("//commentBeforeValue"), Json::commentBefore);
20882087
const Json::String result = writer.write(root);
20892088
JSONTEST_ASSERT_STRING_EQUAL(expected, result);
20902089
}
@@ -2099,8 +2098,7 @@ JSONTEST_FIXTURE(StyledWriterTest, writeValueWithComment) {
20992098
{
21002099
const Json::String expected("\"hello\"\n//commentAfter\n\n");
21012100
Json::Value root = "hello";
2102-
root.setComment(Json::String("//commentAfter"),
2103-
Json::commentAfter);
2101+
root.setComment(Json::String("//commentAfter"), Json::commentAfter);
21042102
const Json::String result = writer.write(root);
21052103
JSONTEST_ASSERT_STRING_EQUAL(expected, result);
21062104
}
@@ -2177,44 +2175,42 @@ JSONTEST_FIXTURE(StyledStreamWriterTest, multiLineArray) {
21772175
Json::StyledStreamWriter writer;
21782176
{
21792177
// Array member has more than 20 print effect rendering lines
2180-
const Json::String expected(
2181-
"["
2182-
"\n\t0,"
2183-
"\n\t1,"
2184-
"\n\t2,"
2185-
"\n\t3,"
2186-
"\n\t4,"
2187-
"\n\t5,"
2188-
"\n\t6,"
2189-
"\n\t7,"
2190-
"\n\t8,"
2191-
"\n\t9,"
2192-
"\n\t10,"
2193-
"\n\t11,"
2194-
"\n\t12,"
2195-
"\n\t13,"
2196-
"\n\t14,"
2197-
"\n\t15,"
2198-
"\n\t16,"
2199-
"\n\t17,"
2200-
"\n\t18,"
2201-
"\n\t19,"
2202-
"\n\t20\n]\n");
2178+
const Json::String expected("[\n\t0,"
2179+
"\n\t1,"
2180+
"\n\t2,"
2181+
"\n\t3,"
2182+
"\n\t4,"
2183+
"\n\t5,"
2184+
"\n\t6,"
2185+
"\n\t7,"
2186+
"\n\t8,"
2187+
"\n\t9,"
2188+
"\n\t10,"
2189+
"\n\t11,"
2190+
"\n\t12,"
2191+
"\n\t13,"
2192+
"\n\t14,"
2193+
"\n\t15,"
2194+
"\n\t16,"
2195+
"\n\t17,"
2196+
"\n\t18,"
2197+
"\n\t19,"
2198+
"\n\t20\n]\n");
22032199
Json::StyledStreamWriter writer;
22042200
Json::Value root;
22052201
for (int i = 0; i < 21; i++)
2206-
root[i] = i;
2202+
root[i] = i;
22072203
Json::OStringStream sout;
22082204
writer.write(sout, root);
22092205
const Json::String result = sout.str();
22102206
JSONTEST_ASSERT_STRING_EQUAL(expected, result);
22112207
}
2212-
{
2208+
{
22132209
// Array members do not exceed 21 print effects to render a single line
22142210
const Json::String expected("[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n");
22152211
Json::Value root;
22162212
for (int i = 0; i < 10; i++)
2217-
root[i] = i;
2213+
root[i] = i;
22182214
Json::OStringStream sout;
22192215
writer.write(sout, root);
22202216
const Json::String result = sout.str();
@@ -2228,8 +2224,7 @@ JSONTEST_FIXTURE(StyledStreamWriterTest, writeValueWithComment) {
22282224
const Json::String expected("//commentBeforeValue\n\"hello\"\n");
22292225
Json::Value root = "hello";
22302226
Json::OStringStream sout;
2231-
root.setComment(Json::String("//commentBeforeValue"),
2232-
Json::commentBefore);
2227+
root.setComment(Json::String("//commentBeforeValue"), Json::commentBefore);
22332228
writer.write(sout, root);
22342229
const Json::String result = sout.str();
22352230
JSONTEST_ASSERT_STRING_EQUAL(expected, result);
@@ -2248,8 +2243,7 @@ JSONTEST_FIXTURE(StyledStreamWriterTest, writeValueWithComment) {
22482243
const Json::String expected("\"hello\"\n//commentAfter\n");
22492244
Json::Value root = "hello";
22502245
Json::OStringStream sout;
2251-
root.setComment(Json::String("//commentAfter"),
2252-
Json::commentAfter);
2246+
root.setComment(Json::String("//commentAfter"), Json::commentAfter);
22532247
writer.write(sout, root);
22542248
const Json::String result = sout.str();
22552249
JSONTEST_ASSERT_STRING_EQUAL(expected, result);
@@ -2326,42 +2320,41 @@ JSONTEST_FIXTURE(StreamWriterTest, multiLineArray) {
23262320
wb.settings_["commentStyle"] = "None";
23272321
{
23282322
// 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
23302324
// more than 20 array members.
2331-
const Json::String expected(
2332-
"[\n\t0,"
2333-
"\n\t1,"
2334-
"\n\t2,"
2335-
"\n\t3,"
2336-
"\n\t4,"
2337-
"\n\t5,"
2338-
"\n\t6,"
2339-
"\n\t7,"
2340-
"\n\t8,"
2341-
"\n\t9,"
2342-
"\n\t10,"
2343-
"\n\t11,"
2344-
"\n\t12,"
2345-
"\n\t13,"
2346-
"\n\t14,"
2347-
"\n\t15,"
2348-
"\n\t16,"
2349-
"\n\t17,"
2350-
"\n\t18,"
2351-
"\n\t19,"
2352-
"\n\t20\n]");
2325+
const Json::String expected("[\n\t0,"
2326+
"\n\t1,"
2327+
"\n\t2,"
2328+
"\n\t3,"
2329+
"\n\t4,"
2330+
"\n\t5,"
2331+
"\n\t6,"
2332+
"\n\t7,"
2333+
"\n\t8,"
2334+
"\n\t9,"
2335+
"\n\t10,"
2336+
"\n\t11,"
2337+
"\n\t12,"
2338+
"\n\t13,"
2339+
"\n\t14,"
2340+
"\n\t15,"
2341+
"\n\t16,"
2342+
"\n\t17,"
2343+
"\n\t18,"
2344+
"\n\t19,"
2345+
"\n\t20\n]");
23532346
Json::Value root;
23542347
for (int i = 0; i < 21; i++)
2355-
root[i] = i;
2348+
root[i] = i;
23562349
const Json::String result = Json::writeString(wb, root);
23572350
JSONTEST_ASSERT_STRING_EQUAL(expected, result);
23582351
}
23592352
{
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
23612354
const Json::String expected("[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]");
23622355
Json::Value root;
23632356
for (int i = 0; i < 10; i++)
2364-
root[i] = i;
2357+
root[i] = i;
23652358
const Json::String result = Json::writeString(wb, root);
23662359
JSONTEST_ASSERT_STRING_EQUAL(expected, result);
23672360
}
@@ -3169,7 +3162,8 @@ int main(int argc, const char* argv[]) {
31693162
JSONTEST_REGISTER_FIXTURE(runner, StyledStreamWriterTest, writeArrays);
31703163
JSONTEST_REGISTER_FIXTURE(runner, StyledStreamWriterTest, writeNestedObjects);
31713164
JSONTEST_REGISTER_FIXTURE(runner, StyledStreamWriterTest, multiLineArray);
3172-
JSONTEST_REGISTER_FIXTURE(runner, StyledStreamWriterTest, writeValueWithComment);
3165+
JSONTEST_REGISTER_FIXTURE(runner, StyledStreamWriterTest,
3166+
writeValueWithComment);
31733167
JSONTEST_REGISTER_FIXTURE(runner, StreamWriterTest, writeNumericValue);
31743168
JSONTEST_REGISTER_FIXTURE(runner, StreamWriterTest, writeArrays);
31753169
JSONTEST_REGISTER_FIXTURE(runner, StreamWriterTest, writeNestedObjects);

0 commit comments

Comments
 (0)