Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: f1032773097531cd56e186f462f1b09139e0a621 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
/*******************************************************************************
 * Copyright (c) 2007, 2011 Wind River Systems, Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Anton Leherbauer (Wind River Systems) - initial API and implementation
 *     Andrew Ferguson (Symbian)
 *     Sergey Prigogin (Google)
 *******************************************************************************/
package org.eclipse.cdt.ui.tests.text;

import java.util.HashMap;
import java.util.Map;

import junit.framework.TestSuite;

import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.TextUtilities;
import org.eclipse.text.edits.TextEdit;

import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.gnu.c.GCCLanguage;
import org.eclipse.cdt.core.formatter.CodeFormatter;
import org.eclipse.cdt.core.formatter.DefaultCodeFormatterConstants;
import org.eclipse.cdt.core.formatter.DefaultCodeFormatterOptions;
import org.eclipse.cdt.ui.tests.BaseUITestCase;

import org.eclipse.cdt.internal.corext.util.CodeFormatterUtil;
import org.eclipse.cdt.internal.formatter.align.Alignment;

/**
 * Tests for the CodeFormatter.
 *
 * @since 4.0
 */
public class CodeFormatterTest extends BaseUITestCase {
	private Map<String, Object> fOptions;
	private Map<String, String> fDefaultOptions;

	public static TestSuite suite() {
		return suite(CodeFormatterTest.class, "_");
	}

	@Override
	protected void setUp() throws Exception {
		super.setUp();
		fDefaultOptions= DefaultCodeFormatterOptions.getDefaultSettings().getMap();
		fOptions= new HashMap<String, Object>(fDefaultOptions);
	}

	@Override
	protected void tearDown() throws Exception {
		super.tearDown();
	}

	protected void assertFormatterResult() throws Exception {
		CharSequence[] contents= getContentsForTest(2);
		String before= contents[0].toString();
		String expected= contents[1].toString();
		assertFormatterResult(before, expected);
	}

	private void assertFormatterResult(String original, String expected) throws BadLocationException {
		IDocument document= new Document(original);
		TextEdit edit= CodeFormatterUtil.format(CodeFormatter.K_TRANSLATION_UNIT, original, 0,
				TextUtilities.getDefaultLineDelimiter(document), fOptions);
		assertNotNull(edit);
		edit.apply(document);
		assertEquals(expected, document.get());
	}

	//void foo(int arg);
	//void foo(int arg){}

	//void foo (int arg);
	//void foo (int arg) {
	//}
	public void testInsertSpaceBeforeOpeningParen_Bug190184() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION,
				CCorePlugin.INSERT);
		assertFormatterResult();
	}

	//void FailSwitchFormatting(void)
	//{
	//        switch (confusefomatter)
	//        {
	//
	//        case START_CONFUSION:
	//                SomeFunctionCallWithTypecast(( castConfusion_t)myvar1,
	//                (castNoAdditionalConfusion_t) myvar2);
	//                break;
	//
	//                case REVEAL_CONFUSION:
	//                if (myBlockIndentIsOk)
	//                {
	//                        myBlockstuff();
	//                }
	//                break;
	//
	//                case CONTINUE_CONFUSION:
	//                {
	//                        //the indentation problem continues...
	//                }
	//                default://....still not right
	//        }
	//}

	//void FailSwitchFormatting(void) {
	//	switch (confusefomatter) {
	//
	//	case START_CONFUSION:
	//		SomeFunctionCallWithTypecast((castConfusion_t) myvar1,
	//				(castNoAdditionalConfusion_t) myvar2);
	//		break;
	//
	//	case REVEAL_CONFUSION:
	//		if (myBlockIndentIsOk) {
	//			myBlockstuff();
	//		}
	//		break;
	//
	//	case CONTINUE_CONFUSION: {
	//		//the indentation problem continues...
	//	}
	//	default: //....still not right
	//	}
	//}
	public void testIndentConfusionByCastExpression_Bug191021() throws Exception {
		assertFormatterResult();
	}

	//int
	//var;
	//int*
	//pvar;

	//int var;
	//int* pvar;
	public void testSpaceBetweenTypeAndIdentifier_Bug194603() throws Exception {
		assertFormatterResult();
	}

	//int a = sizeof(     int)    ;

	//int a = sizeof(int);
	public void testSizeofExpression_Bug195246() throws Exception {
		assertFormatterResult();
	}

	//int x;
	//int a = sizeof     x    ;

	//int x;
	//int a = sizeof x;
	public void testSizeofExpression_Bug201330() throws Exception {
		assertFormatterResult();
	}

	//void foo(){
	//for(;;){
	//int a=0;
	//switch(a){
	//case 0:
	//++a;
	//break;
	//case 1:
	//--a;
	//break;
	//}
	//}
	//}
	//int main(void){
	//foo();
	//return 1;
	//}

	//void foo() {
	//	for (;;) {
	//		int a = 0;
	//		switch (a) {
	//		case 0:
	//			++a;
	//			break;
	//		case 1:
	//			--a;
	//			break;
	//		}
	//	}
	//}
	//int main(void) {
	//	foo();
	//	return 1;
	//}
	public void testForWithEmptyExpression_Bug195942() throws Exception {
		assertFormatterResult();
	}

	//class ClassWithALongName {
	//public:
	//class Iterator {
	//bool isDone();
	//void next();
	//};
	//
	//Iterator getIterator();
	//};
	//
	//void test() {
	//ClassWithALongName* variable_with_a_long_name;
	//for (ClassWithALongName::Iterator iter_for_class_with_a_long_name = variable_with_a_long_name->getIterator(); !iter_for_class_with_a_long_name.isDone(); iter_for_class_with_a_long_name.next()) {
	//}
	//}

	//class ClassWithALongName {
	//public:
	//    class Iterator {
	//        bool isDone();
	//        void next();
	//    };
	//
	//    Iterator getIterator();
	//};
	//
	//void test() {
	//    ClassWithALongName* variable_with_a_long_name;
	//    for (ClassWithALongName::Iterator iter_for_class_with_a_long_name =
	//            variable_with_a_long_name->getIterator();
	//            !iter_for_class_with_a_long_name.isDone();
	//            iter_for_class_with_a_long_name.next()) {
	//    }
	//}
	public void testForWithEmptyExpression_Bug280989() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}
	
	//void test() {
	//if (1000000 + 2000000 < 3000000 + 4000000 && 5000000 + 6000000 <= 7000000) {
	// // comment
	//}
	//if (1000000 + 2000000 < 3000000 + 4000000 && 5000000 + 6000000 <= 70000000) {
	// // comment
	//}
	//}

	//void test() {
	//    if (1000000 + 2000000 < 3000000 + 4000000 && 5000000 + 6000000 <= 7000000) {
	//        // comment
	//    }
	//    if (1000000 + 2000000 < 3000000 + 4000000
	//            && 5000000 + 6000000 <= 70000000) {
	//        // comment
	//    }
	//}
	public void testIfStatement() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//#define MY private:
	//
	//class ClassA
	//{
	//MY ClassA() {}
	//};

	//#define MY private:
	//
	//class ClassA {
	//MY
	//	ClassA() {
	//	}
	//};
	public void testAccessSpecifierAsMacro_Bug197494() throws Exception {
		assertFormatterResult();
	}

	//int verylooooooooooooooooooooooooooooooooooongname = 0000000000000000000000000000000;

	//int verylooooooooooooooooooooooooooooooooooongname =
	//		0000000000000000000000000000000;
	public void testLineWrappingOfInitializerExpression_Bug200961() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT,
				Integer.toString(Alignment.M_COMPACT_SPLIT));
		assertFormatterResult();
	}

	//void functionWithLooooooooooooooooooooooooooooooooooooooooooooooooongName() throw(float);

	//void functionWithLooooooooooooooooooooooooooooooooooooooooooooooooongName()
	//		throw (float);
	public void testLineWrappingOfThrowSpecification_Bug200959() throws Exception {
		assertFormatterResult();
	}

	//class A {
	//public:
	//A();
	//};

	//class A
	//    {
	//public:
	//    A();
	//    };
	public void testWhiteSmithsAccessSpecifierIndentation1_Bug204575() throws Exception {
		fOptions.putAll(DefaultCodeFormatterOptions.getWhitesmithsSettings().getMap());
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_ACCESS_SPECIFIER_COMPARE_TO_TYPE_HEADER,
				DefaultCodeFormatterConstants.FALSE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ACCESS_SPECIFIER,
				DefaultCodeFormatterConstants.TRUE);
		assertFormatterResult();
	}

	//class A {
	//public:
	//A();
	//};

	//class A
	//    {
	//    public:
	//    A();
	//    };
	public void testWhiteSmithsAccessSpecifierIndentation2_Bug204575() throws Exception {
		fOptions.putAll(DefaultCodeFormatterOptions.getWhitesmithsSettings().getMap());
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_ACCESS_SPECIFIER_COMPARE_TO_TYPE_HEADER,
				DefaultCodeFormatterConstants.TRUE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ACCESS_SPECIFIER,
				DefaultCodeFormatterConstants.FALSE);
		assertFormatterResult();
	}

	//class A {
	//public:
	//A();
	//};

	//class A
	//    {
	//    public:
	//	A();
	//    };
	public void testWhiteSmithsAccessSpecifierIndentation3_Bug204575() throws Exception {
		fOptions.putAll(DefaultCodeFormatterOptions.getWhitesmithsSettings().getMap());
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_ACCESS_SPECIFIER_COMPARE_TO_TYPE_HEADER,
				DefaultCodeFormatterConstants.TRUE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ACCESS_SPECIFIER,
				DefaultCodeFormatterConstants.TRUE);
		assertFormatterResult();
	}

	//template<typename T> class B {};
	//template<typename T1,typename T2=B<T1> > class A {};

	//template<typename T> class B {
	//};
	//template<typename T1, typename T2 = B<T1> > class A {
	//};
	public void testNestedTemplateParameters_Bug206801() throws Exception {
		assertFormatterResult();
	}

	//int main
	//(
	//    int           argc,
	//    char const int*  argv[]
	//)
	//try
	//{
	//    for ( int i = 1 ; i < argc ; ++i )
	//    {
	//    }
	//    return 0;
	//}
	//catch ( float e )
	//{
	//    return 1;
	//}
	//catch ( ... )
	//{
	//	return 2;
	//}

	//int main(int argc, char const int* argv[])
	//try {
	//	for (int i = 1; i < argc; ++i) {
	//	}
	//	return 0;
	//}
	//catch (float e) {
	//	return 1;
	//}
	//catch (...) {
	//	return 2;
	//}
	public void testFunctionTryCatchBlock() throws Exception {
		assertFormatterResult();
	}

	//int main(int argc, char const int * argv[]) { try { for (int i = 1; i < argc; ++i) { } return 0; } catch (float e) { return 1; } catch (...) { return 2; } }

	//int main(int argc, char const int * argv[]) {
	//	try {
	//		for (int i = 1; i < argc; ++i) {
	//		}
	//		return 0;
	//	} catch (float e) {
	//		return 1;
	//	} catch (...) {
	//		return 2;
	//	}
	//}
	public void testTryCatchBlock() throws Exception {
		assertFormatterResult();
	}

	//void f() {
	//#define I 0
	//    int i = I;
	//}

	//void f() {
	//#define I 0
	//	int i = I;
	//}
	public void testMacroAsInitializer_Bug214354() throws Exception {
		assertFormatterResult();
	}

	//#define break_start(); { int foo;
	//#define break_end(); foo = 0; }
	//
	//void break_indenter(int a, int b) {
	//    break_start(); // This semicolon moves to its own line.
	//    if(a > b) {
	//        indentation_remains();
	//    }
	//
	//    if(b>a)
	//        indentation_vanishes();
	//
	//    break_end();
	//
	//    if(b == a)
	//      indentation_remains();
	//}

	//#define break_start(); { int foo;
	//#define break_end(); foo = 0; }
	//
	//void break_indenter(int a, int b) {
	//	break_start(); // This semicolon moves to its own line.
	//	if (a > b) {
	//		indentation_remains();
	//	}
	//
	//	if (b > a)
	//		indentation_vanishes();
	//
	//	break_end();
	//
	//	if (b == a)
	//		indentation_remains();
	//}
	public void testBracesInMacros_Bug217435() throws Exception {
		assertFormatterResult();
	}

	//struct SimpleStruct {
	//int num;
	//char name[];
	//float floatNum;
	//};
	//
	//#define SIZEOF(A, B) sizeof(A.B)
	//
	//const SimpleStruct array[] = { { SIZEOF(simpleStruct, num),
	//#if FOO
	//"foo"
	//#else
	//"bar"
	//#endif
	//, 0.5 }, { SIZEOF(simpleStruct, floatNum), "name", 1.1 } };

	//struct SimpleStruct {
	//	int num;
	//	char name[];
	//	float floatNum;
	//};
	//
	//#define SIZEOF(A, B) sizeof(A.B)
	//
	//const SimpleStruct array[] = { { SIZEOF(simpleStruct, num),
	//#if FOO
	//		"foo"
	//#else
	//		"bar"
	//#endif
	//		, 0.5 }, { SIZEOF(simpleStruct, floatNum), "name", 1.1 } };
	public void testArrayInitializer() throws Exception {
		assertFormatterResult();
	}

	//int a=1+2;
	//int b= - a;
	//int c =b ++/-- b;

	//int a = 1 + 2;
	//int b = -a;
	//int c = b++ / --b;
	public void testWhitespaceSurroundingOperators() throws Exception {
		assertFormatterResult();
	}

	//void f() {
	//int *px= :: new int(  0 );
	//int* py [] =  new   int [5 ] (0, 1,2,3, 4);
	//int  *pz[ ] =new ( px)int(0);
	//delete  []  py;
	//:: delete px;}

	//void f() {
	//	int *px = ::new int(0);
	//	int* py[] = new int[5](0, 1, 2, 3, 4);
	//	int *pz[] = new (px) int(0);
	//	delete[] py;
	//	::delete px;
	//}
	public void testNewAndDeleteExpressions() throws Exception {
		assertFormatterResult();
	}

	//namespace   X=
	//   Y ::
	// 	    Z ;

	//namespace X = Y::Z;
	public void testNamespaceAlias() throws Exception {
		assertFormatterResult();
	}

	//using
	//   typename:: T
	//;
	//using X::
	// T ;

	//using typename ::T;
	//using X::T;
	public void testUsingDeclaration() throws Exception {
		assertFormatterResult();
	}

	//using
	//  namespace
	//    X ;

	//using namespace X;
	public void testUsingDirective() throws Exception {
		assertFormatterResult();
	}

	//static void *f(){}
	//static void * g();
	//static void* h();
	//int* (*a) [2];

	//static void *f() {
	//}
	//static void * g();
	//static void* h();
	//int* (*a)[2];
	public void testSpaceBetweenDeclSpecAndDeclarator() throws Exception {
		assertFormatterResult();
	}

	//typedef signed int TInt;
	//extern void Bar();  // should not have space between parens
	//
	//void Foo()    // should not have space between parens
	//{
	//  TInt a(3);  // should become TInt a( 3 );
	//  Bar();   // should not have space between parens
	//}

	//typedef signed int TInt;
	//extern void Bar();  // should not have space between parens
	//
	//void Foo()    // should not have space between parens
	//	{
	//	TInt a( 3 );  // should become TInt a( 3 );
	//	Bar();   // should not have space between parens
	//	}
	public void testSpaceBetweenParen_Bug217918() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION,
				DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY,
				DefaultCodeFormatterConstants.FALSE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION,
				CCorePlugin.INSERT);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION,
				CCorePlugin.INSERT);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION,
				CCorePlugin.DO_NOT_INSERT);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION,
				CCorePlugin.INSERT);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION,
				CCorePlugin.INSERT);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION,
				CCorePlugin.DO_NOT_INSERT);
		assertFormatterResult();
	}

	//class Example: public FooClass, public virtual BarClass {};

	//class Example:
	//		public FooClass,
	//		public virtual BarClass {
	//};
	public void testAlignmentOfClassDefinitionBaseClause1_Bug192656() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BASE_CLAUSE_IN_TYPE_DECLARATION,
				Integer.toString(Alignment.M_ONE_PER_LINE_SPLIT | Alignment.M_FORCE));
		assertFormatterResult();
	}

	//class Example: public FooClass, public virtual BarClass {};

	//class Example:	public FooClass,
	//				public virtual BarClass {
	//};
	public void testAlignmentOfClassDefinitionBaseClause2_Bug192656() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BASE_CLAUSE_IN_TYPE_DECLARATION,
				Integer.toString(Alignment.M_NEXT_PER_LINE_SPLIT | Alignment.M_FORCE | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}

	//class Example { void foo() throw(int); };
	//void Example::foo()throw(int){}

	//class Example {
	//	void foo()
	//		throw (int);
	//};
	//void Example::foo()
	//	throw (int) {
	//}
	public void testAlignmentOfExceptionSpecificationInMethodDeclaration_Bug191980() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION,
				Integer.toString(Alignment.M_ONE_PER_LINE_SPLIT | Alignment.M_FORCE | Alignment.M_INDENT_BY_ONE));
		assertFormatterResult();
	}

	//class ClassWithALongName {
	//public:
	//ClassWithALongName* methodWithAQuiteLongName();
	//};
	//
	//void test() {
	//ClassWithALongName* variable_with_a_long_name = variable_with_a_long_name->methodWithAQuiteLongName();
	//variable_with_a_long_name = variable_with_a_long_name->methodWithAQuiteLongName();
	//}

	//class ClassWithALongName {
	//public:
	//    ClassWithALongName* methodWithAQuiteLongName();
	//};
	//
	//void test() {
	//    ClassWithALongName* variable_with_a_long_name =
	//            variable_with_a_long_name->methodWithAQuiteLongName();
	//    variable_with_a_long_name =
	//            variable_with_a_long_name->methodWithAQuiteLongName();
	//}
	public void testAssignment() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT,
				Integer.toString(Alignment.M_COMPACT_SPLIT));
		assertFormatterResult();
	}

	//class ClassWithALongName {
	//public:
	//ClassWithALongName* methodWithALongName();
	//ClassWithALongName* anotherMethodWithALongName();
	//};
	//
	//void test() {
	//ClassWithALongName* variable_with_a_long_name;
	//ClassWithALongName* another_variable = variable_with_a_long_name->methodWithALongName()->anotherMethodWithALongName();
	//}

	//class ClassWithALongName {
	//public:
	//    ClassWithALongName* methodWithALongName();
	//    ClassWithALongName* anotherMethodWithALongName();
	//};
	//
	//void test() {
	//    ClassWithALongName* variable_with_a_long_name;
	//    ClassWithALongName* another_variable = variable_with_a_long_name
	//            ->methodWithALongName()->anotherMethodWithALongName();
	//}
	public void testMemberAccess() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT,
				Integer.toString(Alignment.M_COMPACT_SPLIT));
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_MEMBER_ACCESS,
				Integer.toString(Alignment.M_COMPACT_SPLIT));
		assertFormatterResult();
	}

	//int foo(){try{}catch(...){}}
	//float* bar();
	//template<typename _CharT, typename _Traits>class basic_ios : public ios_base{public:
	//  // Types:
	//};

	//int
	//foo()
	//{
	//  try
	//    {
	//    }
	//  catch (...)
	//    {
	//    }
	//}
	//float*
	//bar();
	//template<typename _CharT, typename _Traits>
	//  class basic_ios : public ios_base
	//  {
	//  public:
	//    // Types:
	//  };
	public void testGNUCodingStyleConformance_Bug192764() throws Exception {
		fOptions.putAll(DefaultCodeFormatterOptions.getGNUSettings().getMap());
		assertFormatterResult();
	}

	//NOT_DEFINED void foo(){
	//	}
	//
	//enum T1
	//    {
	//    E1 = 1
	//    };

	//NOT_DEFINED void foo() {
	//}
	//
	//enum T1 {
	//	E1 = 1
	//};
	public void testPreserveWhitespace_Bug225326() throws Exception {
		assertFormatterResult();
	}

	//NOT_DEFINED void foo()
	//	{
	//	}
	//
	//enum T1
	//    {
	//    E1 = 1
	//    };

	//NOT_DEFINED void foo()
	//    {
	//    }
	//
	//enum T1
	//    {
	//    E1 = 1
	//    };
	public void testPreserveWhitespace2_Bug225326() throws Exception {
		fOptions.putAll(DefaultCodeFormatterOptions.getWhitesmithsSettings().getMap());
		assertFormatterResult();
	}

	//enum Tthe3rdtestIds
	//{
	//ECommand1 = 0x6001,
	//ECommand2,
	//EHelp,
	//EAbout
	//};
	//
	//CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();

	//enum Tthe3rdtestIds
	//    {
	//    ECommand1 = 0x6001,
	//    ECommand2,
	//    EHelp,
	//    EAbout
	//    };
	//
	//CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
	public void testFormatterRegressions_Bug225858() throws Exception {
		fOptions.putAll(DefaultCodeFormatterOptions.getWhitesmithsSettings().getMap());
		assertFormatterResult();
	}

	//typedef int int_;
	//int_ const f(int_ const i);

	//typedef int int_;
	//int_ const f(int_ const i);
	public void testPreserveWhitespaceInParameterDecl_Bug228997() throws Exception {
		assertFormatterResult();
	}

	//void f() { throw 42; }

	//void f() {
	//	throw 42;
	//}
	public void testSpaceAfterThrowKeyword_Bug229774() throws Exception {
		assertFormatterResult();
	}

	//struct { int l; } s;
	//void f() {
	//  int x = (s.l -5);
	//  // Comment
	//  for(;;);
	//}

	//struct {
	//	int l;
	//} s;
	//void f() {
	//	int x = (s.l - 5);
	//	// Comment
	//	for (;;)
	//		;
	//}
	public void testIndentAfterDotL_Bug232739() throws Exception {
		assertFormatterResult();
	}

	//struct { int e; } s;
	//void f() {
	//  int x = (s.e -5);
	//  // Comment
	//  for(;;);
	//}

	//struct {
	//	int e;
	//} s;
	//void f() {
	//	int x = (s.e - 5);
	//	// Comment
	//	for (;;)
	//		;
	//}
	public void testIndentAfterDotE_Bug232739() throws Exception {
		assertFormatterResult();
	}

	//struct { int f; } s;
	//void f() {
	//  int x = (s.f -5);
	//  // Comment
	//  for(;;);
	//}

	//struct {
	//	int f;
	//} s;
	//void f() {
	//	int x = (s.f - 5);
	//	// Comment
	//	for (;;)
	//		;
	//}
	public void testIndentAfterDotF_Bug232739() throws Exception {
		assertFormatterResult();
	}

	//int a = 0, b = 1, c = 2, d = 3;

	//int a = 0,b = 1,c = 2,d = 3;
	public void testSpaceAfterCommaInDeclaratorList_Bug234915() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_DECLARATOR_LIST,
				CCorePlugin.DO_NOT_INSERT);
		assertFormatterResult();
	}

	//int a = 0,b = 1,c = 2,d = 3;

	//int a = 0, b = 1, c = 2, d = 3;
	public void testSpaceAfterCommaInDeclaratorList2_Bug234915() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_DECLARATOR_LIST,
				CCorePlugin.INSERT);
		assertFormatterResult();
	}

	//void foo() {
	//    int x;        // comment
	//    int y;        // will be shifted to the left to avoid exceeding max line length
	//    		        // continuation of the previous comment
	////  int z;  <- comments starting from the beginning of line are not indented
	//}

	//void foo() {
	//    int x;        // comment
	//    int y;     // will be shifted to the left to avoid exceeding max line length
	//               // continuation of the previous comment
	////  int z;  <- comments starting from the beginning of line are not indented
	//}
	public void testLineCommentPreserveWhiteSpaceBefore() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT,
				DefaultCodeFormatterConstants.TRUE);
		assertFormatterResult();
	}

    //namespace ns1 {
	//namespace ns2 {
	//void foo() {
	//    int x;// comment
	//    int y;// comment
	//    		// continuation of the previous comment
	////  int z;  <- comments starting from the beginning of line are not indented
	//}
	//}// namespace ns2
	//}// namespace ns1

    //namespace ns1 {
	//namespace ns2 {
	//void foo() {
	//    int x;  // comment
	//    int y;  // comment
	//            // continuation of the previous comment
	////  int z;  <- comments starting from the beginning of line are not indented
	//}
	//}  // namespace ns2
	//}  // namespace ns1
	public void testLineCommentMinDistanceFromCode() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_MIN_DISTANCE_BETWEEN_CODE_AND_LINE_COMMENT, "2");
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT, DefaultCodeFormatterConstants.FALSE);
		assertFormatterResult();
	}

	//void f() {
	// 	class Object;
	//	int aVeryLongParameterThatShouldBeInOneLine1;
	//	int aVeryLongParameterThatShouldBeInOneLine2;
	//
	//	myNewFunctionCall1(Object(aVeryLongParameterThatShouldBeInOneLine1, aVeryLongParameterThatShouldBeInOneLine2));
	//
	//	myNewFunctionCall2(new Object(aVeryLongParameterThatShouldBeInOneLine1, aVeryLongParameterThatShouldBeInOneLine2));
	//}

	//void f() {
	//	class Object;
	//	int aVeryLongParameterThatShouldBeInOneLine1;
	//	int aVeryLongParameterThatShouldBeInOneLine2;
	//
	//	myNewFunctionCall1(
	//			Object(aVeryLongParameterThatShouldBeInOneLine1,
	//					aVeryLongParameterThatShouldBeInOneLine2));
	//
	//	myNewFunctionCall2(
	//			new Object(aVeryLongParameterThatShouldBeInOneLine1,
	//					aVeryLongParameterThatShouldBeInOneLine2));
	//}
	public void testLineWrappingOfConstructorCall_Bug237097() throws Exception {
		assertFormatterResult();
	}

	//bool test(bool x)
	//{
	//   return x or x and not (not x);
	//}

	//bool test(bool x) {
	//	return x or x and not (not x);
	//}
	public void testSpaceBeforeAndAfterAlternativeLogicalOperator_Bug239461() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR,
				CCorePlugin.DO_NOT_INSERT);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR,
				CCorePlugin.DO_NOT_INSERT);
		assertFormatterResult();
	}

	//void A::a(C e) { if (D::iterator it = m.find (e)) m.erase(it);}
	//T* A::b(T* t) { S::iterator it = m.find(t); if (!it) return NULL; else return *it; }
	//M* A::c(M* tm) { N::iterator it = myN.find(tm); if (!it) return NULL; else return *it; }

	//void A::a(C e) {
	//	if (D::iterator it = m.find(e))
	//		m.erase(it);
	//}
	//T* A::b(T* t) {
	//	S::iterator it = m.find(t);
	//	if (!it)
	//		return NULL;
	//	else
	//		return *it;
	//}
	//M* A::c(M* tm) {
	//	N::iterator it = myN.find(tm);
	//	if (!it)
	//		return NULL;
	//	else
	//		return *it;
	//}
	public void testHandleParsingProblemsInIfCondition_Bug240564() throws Exception {
		assertFormatterResult();
	}

	//TestType1<TESTNS::TestType2<3> > test_variable;

	//TestType1<TESTNS::TestType2<3> > test_variable;
	public void testNestedTemplatedArgument_Bug241058() throws Exception {
		assertFormatterResult();
	}

	//#define TP_SMALLINT int32_t
	//void foo(const TP_SMALLINT &intVal) { }
	//void bar(const TP_SMALLINT intVal) { }

	//#define TP_SMALLINT int32_t
	//void foo(const TP_SMALLINT &intVal) {
	//}
	//void bar(const TP_SMALLINT intVal) {
	//}
	public void testPreserveSpaceInParameterDecl_Bug241967() throws Exception {
		assertFormatterResult();
	}

	//void f1(const char* long_parameter_name, int very_looooooooooong_parameter_name, int another_parameter_name );
	//void f2(const char* long_parameter_name,int very_loooooooooooong_parameter_name, int another_parameter_name )  ;
	//void f3(const char* long_parameter_name,int very_loooooooooooong_parameter_name,int very_loong_parameter_name)  ;
	//void f4(const char* long_parameter_name, int very_loooooooooooong_parameter_name,int very_looong_parameter_name)  ;

	//void f1(const char* long_parameter_name, int very_looooooooooong_parameter_name,
	//        int another_parameter_name);
	//void f2(const char* long_parameter_name,
	//        int very_loooooooooooong_parameter_name, int another_parameter_name);
	//void f3(const char* long_parameter_name,
	//        int very_loooooooooooong_parameter_name, int very_loong_parameter_name);
	//void f4(const char* long_parameter_name,
	//        int very_loooooooooooong_parameter_name,
	//        int very_looong_parameter_name);
	public void testFunctionDeclaration() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}

	//const char* function_name1(const char* parameter_name, const char* another_parameter_name,
	//int very_loooooooooooooooooooooooong_parameter_name);
	//const char* function_name2(const char* parameter_name, const char* another_parameter_name,
	//int very_looooooooooooooooooooooooong_parameter_name);

	//const char* function_name1(const char* parameter_name,
	//                           const char* another_parameter_name,
	//                           int very_loooooooooooooooooooooooong_parameter_name);
	//const char* function_name2(
	//        const char* parameter_name, const char* another_parameter_name,
	//        int very_looooooooooooooooooooooooong_parameter_name);
	public void testFunctionDeclarationFallbackFormat() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}

	//#define ABSTRACT = 0
	//
	//class A {
	//    virtual bool function_with_a_loooooong_name(const char* parameter) ABSTRACT;
	//    virtual bool function_with_a_looooooong_name(const char* parameter) ABSTRACT;
	//};

	//#define ABSTRACT = 0
	//
	//class A {
	//    virtual bool function_with_a_loooooong_name(const char* parameter) ABSTRACT;
	//    virtual bool function_with_a_looooooong_name(const char* parameter)
	//            ABSTRACT;
	//};
	public void testFunctionDeclarationTrailingMacro_1() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}

	//#define MACRO_WITH_ONE_PARAMETER(p)
	//
	//class A {
	//void method1(int arguuuuuuuuuuuuuuuuuuuuument) MACRO_WITH_ONE_PARAMETER(p) {}
	//void method2(int arguuuuuuuuuuuuuuuuuuuuuument) MACRO_WITH_ONE_PARAMETER(p) {}
	//};

	//#define MACRO_WITH_ONE_PARAMETER(p)
	//
	//class A {
	//    void method1(int arguuuuuuuuuuuuuuuuuuuuument) MACRO_WITH_ONE_PARAMETER(p) {
	//    }
	//    void method2(int arguuuuuuuuuuuuuuuuuuuuuument)
	//            MACRO_WITH_ONE_PARAMETER(p) {
	//    }
	//};
	public void testFunctionDeclarationTrailingMacro_2() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}

	//void f1(const char* long_parameter_name,int very_looooooooong_parameter_name){}
	//void f2(const char* long_parameter_name,int very_loooooooooong_parameter_name){}

	//void f1(const char* long_parameter_name, int very_looooooooong_parameter_name) {
	//}
	//void f2(const char* long_parameter_name,
	//        int very_loooooooooong_parameter_name) {
	//}
	public void testFunctionDefinition() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}

	//struct moveonly {
	//moveonly()=default;
	//moveonly(const moveonly&)=delete;
	//moveonly(moveonly&&)=default;
	//moveonly& operator=(const moveonly&)=delete;
	//moveonly& operator=(moveonly&&)=default;
	//~moveonly()=default;
	//};

	//struct moveonly {
	//    moveonly() = default;
	//    moveonly(const moveonly&) = delete;
	//    moveonly(moveonly&&) = default;
	//    moveonly& operator=(const moveonly&) = delete;
	//    moveonly& operator=(moveonly&&) = default;
	//    ~moveonly() = default;
	//};
	public void testFunctionDefinitionWithoutBody() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//int f1(int a, int b, int c, int d, int e, int f, int g);
	//int f2(int a, int b, int c, int d, int e, int f, int g);
	//
	//void test() {
	//f1(100000000,200000000,300000000,400000000,500000000,600000000,70000);
	//f1(100000000,200000000,300000000,400000000,500000000,600000000,700000);
	//f1(100000,200000,300000,400000,500000,600000,f2(1,2,3,4,5,6,7));
	//f1(100000,200000,300000,400000,500000,600000,f2(1,2,3,4,5,6,70));
	//f1(100000,200000,300000,400000,500000,f2(10,20,30,40,50,60,7000),700000);
	//f1(100000,200000,300000,400000,500000,f2(10,20,30,40,50,60,70000),700000);
	//}

	//int f1(int a, int b, int c, int d, int e, int f, int g);
	//int f2(int a, int b, int c, int d, int e, int f, int g);
	//
	//void test() {
	//    f1(100000000, 200000000, 300000000, 400000000, 500000000, 600000000, 70000);
	//    f1(100000000, 200000000, 300000000, 400000000, 500000000, 600000000,
	//            700000);
	//    f1(100000, 200000, 300000, 400000, 500000, 600000, f2(1, 2, 3, 4, 5, 6, 7));
	//    f1(100000, 200000, 300000, 400000, 500000, 600000,
	//            f2(1, 2, 3, 4, 5, 6, 70));
	//    f1(100000, 200000, 300000, 400000, 500000, f2(10, 20, 30, 40, 50, 60, 7000),
	//            700000);
	//    f1(100000, 200000, 300000, 400000, 500000,
	//            f2(10, 20, 30, 40, 50, 60, 70000), 700000);
	//}
	public void testFunctionCall_1() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//int function(int, int, int, int, int);
	//int function_with_a_long_name(int, int);
	//
	//void test() {
	//function_with_a_long_name(function(1000000, 2000000, 3000000, 4000000, 5000000), 6000000);
	//}

	//int function(int, int, int, int, int);
	//int function_with_a_long_name(int, int);
	//
	//void test() {
	//    function_with_a_long_name(
	//            function(1000000, 2000000, 3000000, 4000000, 5000000), 6000000);
	//}
	public void testFunctionCall_2() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}

	//void function(int);
	//int function_with_a_looooooooooooooooooooooooooooooooong_name(int);
	//
	//void test() {
	//function(function_with_a_looooooooooooooooooooooooooooooooong_name(1000000));
	//}

	//void function(int);
	//int function_with_a_looooooooooooooooooooooooooooooooong_name(int);
	//
	//void test() {
	//    function(
	//            function_with_a_looooooooooooooooooooooooooooooooong_name(1000000));
	//}
	public void testFunctionCall_3() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}

	//int function_with_a_long_name(int, int);
	//int function_with_an_even_looooooooooooooooonger_name(int, int);
	//
	//void test() {
	//function_with_a_long_name(function_with_an_even_looooooooooooooooonger_name(1000000,2000000),3000000);
	//function_with_a_long_name(function_with_an_even_looooooooooooooooonger_name(1000000,20000000),3000000);
	//}

	//int function_with_a_long_name(int, int);
	//int function_with_an_even_looooooooooooooooonger_name(int, int);
	//
	//void test() {
	//    function_with_a_long_name(
	//            function_with_an_even_looooooooooooooooonger_name(1000000, 2000000),
	//            3000000);
	//    function_with_a_long_name(
	//            function_with_an_even_looooooooooooooooonger_name(1000000,
	//                    20000000), 3000000);
	//}
	public void testFunctionCall_4() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//template<typename T, typename U>
	//struct type_with_multiple_template_parameters {};
	//
	//void wrap_when_necessary(type_with_multiple_template_parameters<char, float> p1, int p2, int p3) {}
	//void wrap_when_necessary(type_with_multiple_template_parameters<float, float> p1, int p2, int p3) {}

	//template<typename T, typename U>
	//struct type_with_multiple_template_parameters {
	//};
	//
	//void wrap_when_necessary(type_with_multiple_template_parameters<char, float> p1,
	//        int p2, int p3) {
	//}
	//void wrap_when_necessary(
	//        type_with_multiple_template_parameters<float, float> p1, int p2,
	//        int p3) {
	//}
	public void testFunctionCallWithTemplates_Bug357300() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//void function(const char* s);
	//
	//void test() {
	//function("string literal"
	//"continuation of the string literal");
	//}

	//void function(const char* s);
	//
	//void test() {
	//    function("string literal"
	//             "continuation of the string literal");
	//}
	public void testFunctionCallWithMultilineStringLiteral() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}

	//int x=static_cast < int > ( 0 ) ;

	//int x = static_cast<int>(0);
	public void testCppCast_1() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//int x=static_cast < int >( 0 ) ;

	//int x = static_cast<int> (0);
	public void testCppCast_2() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION,
				CCorePlugin.INSERT);
		assertFormatterResult();
	}

	//template < typename T >
	//void foo ( T t ) ;
	//
	//void test() {
	//foo < const char* > ( "" ) ;
	//}

	//template<typename T>
	//void foo(T t);
	//
	//void test() {
	//    foo<const char*>("");
	//}
	public void testTemplateFunctionCall_1() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//template < typename T >
	//void foo ( T t ) ;
	//
	//void test() {
	//foo < const char* >( "" ) ;
	//}

	//template<typename T>
	//void foo(T t);
	//
	//void test() {
	//    foo<const char*> ("");
	//}
	public void testTemplateFunctionCall_2() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION,
				CCorePlugin.INSERT);
		assertFormatterResult();
	}

	//template<typename T>
	//class A {
	//};
	//
	//A<int> a = new A <int> ();
	//A<int> b = A <int> ();

	//template<typename T>
	//class A {
	//};
	//
	//A<int> a = new A<int>();
	//A<int> b = A<int>();
	public void testTemplateConstructorCall() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//#define MY_MACRO int a; \
	//    int b; \
	//    int c();
	//
	//class asdf {
	//		MY_MACRO
	//
	//public:
	//		asdf();
	//~asdf();
	//};

	//#define MY_MACRO int a; \
	//    int b; \
	//    int c();
	//
	//class asdf {
	//	MY_MACRO
	//
	//public:
	//	asdf();
	//	~asdf();
	//};
	public void testMacroWithMultipleDeclarations_Bug242053() throws Exception {
		assertFormatterResult();
	}

	//#define STREAM GetStream()
	//class Stream {
	//Stream& operator <<(const char*);
	//};
	//Stream GetStream();
	//
	//void test() {
	// // comment
	//STREAM << "text " << "text " << "text " << "text " << "text " << "text " << "text " << "text ";
	//}

	//#define STREAM GetStream()
	//class Stream {
	//    Stream& operator <<(const char*);
	//};
	//Stream GetStream();
	//
	//void test() {
	//    // comment
	//    STREAM << "text " << "text " << "text " << "text " << "text " << "text "
	//            << "text " << "text ";
	//}
	public void testMacroAfterComment() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//#define MY_MACRO(a, b, c)
	//
	//MY_MACRO(abcdefghijklmnopqrstuvwxyz,25,"very very very very very very very very very very long text");
	//namespace ns {
	//MY_MACRO(abcdefghijklmnopqrstuvwxyz,25,"very very very very very very very very very very long text");
    //}

	//#define MY_MACRO(a, b, c)
	//
	//MY_MACRO(abcdefghijklmnopqrstuvwxyz, 25,
	//        "very very very very very very very very very very long text");
	//namespace ns {
	//MY_MACRO(abcdefghijklmnopqrstuvwxyz, 25,
	//        "very very very very very very very very very very long text");
    //}
	public void testFunctionStyleMacro_1() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//#define MY_MACRO(a, b, c) \
	//int a = b; \
	//const char s[] = c
	//
	//MY_MACRO(abcdefghijklmnopqrstuvwxyz,(25 + 3),"very very very very very very very very very very long text");

	//#define MY_MACRO(a, b, c) \
	//int a = b; \
	//const char s[] = c
	//
	//MY_MACRO( abcdefghijklmnopqrstuvwxyz,
	//          (25 + 3),
	//          "very very very very very very very very very very long text" );
	public void testFunctionStyleMacro_2() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
				Integer.toString(Alignment.M_NEXT_PER_LINE_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION,
				CCorePlugin.INSERT);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION,
				CCorePlugin.INSERT);
		assertFormatterResult();
	}

	//#define MY_MACRO(x, b) switch (0) default: if (false)
	//
	//void func() {
	//MY_MACRO(1000000 + 2000000 + 3000000 + 4000000 + 5000000, 6000000 + 700000);
	//MY_MACRO(1000000 + 2000000 + 3000000 + 4000000 + 5000000, 6000000 + 7000000);
	//}

	//#define MY_MACRO(x, b) switch (0) default: if (false)
	//
	//void func() {
	//    MY_MACRO(1000000 + 2000000 + 3000000 + 4000000 + 5000000, 6000000 + 700000);
	//    MY_MACRO(1000000 + 2000000 + 3000000 + 4000000 + 5000000,
	//             6000000 + 7000000);
	//}
	public void testFunctionStyleMacro_3() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
				Integer.toString(Alignment.M_NEXT_PER_LINE_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}

	//void foo() {
	//for(int i=0;i<50;++i){}
	//}

	//void foo() {
	//	for (int i = 0 ; i < 50 ; ++i) {
	//	}
	//}
	public void testSpaceBeforeSemicolonInFor_Bug242232() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR,
				CCorePlugin.INSERT);
		assertFormatterResult();
	}

	//char *b, * const a;

	//char *b, * const a;
	public void testPreserveSpaceBetweenPointerModifierAndIdentifier_Bug243056() throws Exception {
		assertFormatterResult();
	}

	//#define FUNCTION_NAME myFunc
	//#define VARIABLE_NAME myVar
	//
	//void FUNCTION_NAME( void );
	//void FUNCTION_NAME( void )
	//{
	//int VARIABLE_NAME;
	//}

	//#define FUNCTION_NAME myFunc
	//#define VARIABLE_NAME myVar
	//
	//void FUNCTION_NAME(void);
	//void FUNCTION_NAME(void) {
	//	int VARIABLE_NAME;
	//}
	public void testPreserveNecessarySpace_Bug250969() throws Exception {
		assertFormatterResult();
	}

	//#define FOREVER1 for(;;)
	//#define FOREVER2 while(1)
	//
	//int main(int argc, char **argv) {
	//	FOREVER1 {
	//		doSomething();
	//	}
	//	FOREVER2 {
	//		doSomething();
	//	}
	//}

	//#define FOREVER1 for(;;)
	//#define FOREVER2 while(1)
	//
	//int main(int argc, char **argv) {
	//	FOREVER1 {
	//		doSomething();
	//	}
	//	FOREVER2 {
	//		doSomething();
	//	}
	//}
	public void testFormatterProblemsWithForeverMacro() throws Exception {
		assertFormatterResult();
	}

	//#define BLOCK { }
	//#define DOIT1() { }
	//#define DOIT2() do { } while(false)
	//#define ALWAYS if(true)
	//#define NEVER if(false)
	//#define FOREVER for(;;)
	//
	//void foo() {
	//	int i=0;
	//  if (true) DOIT1();
	//  if (true) DOIT2();
	//	for (;;) BLOCK
	//	ALWAYS BLOCK
	//	NEVER FOREVER BLOCK
	//	switch(i) {
	//	case 0: BLOCK
	//	}
	//}

	//#define BLOCK { }
	//#define DOIT1() { }
	//#define DOIT2() do { } while(false)
	//#define ALWAYS if(true)
	//#define NEVER if(false)
	//#define FOREVER for(;;)
	//
	//void foo() {
	//	int i = 0;
	//	if (true)
	//		DOIT1();
	//	if (true)
	//		DOIT2();
	//	for (;;)
	//		BLOCK
	//	ALWAYS
	//		BLOCK
	//	NEVER
	//		FOREVER
	//			BLOCK
	//	switch (i) {
	//	case 0:
	//		BLOCK
	//	}
	//}
	public void testCompoundStatementAsMacro_Bug244928() throws Exception {
		assertFormatterResult();
	}

	//#define BLOCK { }
	//#define ALWAYS if(true)
	//
	//void foo() {
	//ALWAYS BLOCK
	//}

	//#define BLOCK { }
	//#define ALWAYS if(true)
	//
	//void foo() {
	//	ALWAYS
	//		BLOCK
	//}
	public void testCompoundStatementAsMacro_Temp() throws Exception {
		assertFormatterResult();
	}

	//#define BLOCK { }
	//#define DOIT1() { }
	//#define DOIT2() do { } while(false)
	//#define ALWAYS if(true)
	//#define NEVER if(false)
	//#define FOREVER for(;;)
	//
	//void foo() {
	//	int i=0;
	//  if (true) DOIT1();
	//  if (true) DOIT2();
	//	for (;;) BLOCK
	//	ALWAYS BLOCK
	//	NEVER FOREVER BLOCK
	//	switch(i) {
	//	case 0: BLOCK
	//	}
	//}

	//#define BLOCK { }
	//#define DOIT1() { }
	//#define DOIT2() do { } while(false)
	//#define ALWAYS if(true)
	//#define NEVER if(false)
	//#define FOREVER for(;;)
	//
	//void
	//foo()
	//{
	//  int i = 0;
	//  if (true)
	//    DOIT1();
	//  if (true)
	//    DOIT2();
	//  for (;;)
	//    BLOCK
	//  ALWAYS
	//    BLOCK
	//  NEVER
	//    FOREVER
	//      BLOCK
	//  switch (i)
	//    {
	//  case 0:
	//    BLOCK
	//    }
	//}
	public void testCompoundStatementAsMacroGNU_Bug244928() throws Exception {
		fOptions.putAll(DefaultCodeFormatterOptions.getGNUSettings().getMap());
		assertFormatterResult();
	}

	//class Point {
	//public:
	//Point(int x, int y) : x(x), y(y) {}
	//
	//private:
	//int x;
	//int y;
	//};

	//class Point {
	//public:
	//    Point(int x, int y) :
	//            x(x), y(y) {
	//    }
	//
	//private:
	//    int x;
	//    int y;
	//};
	public void testConstructorInitializer_1() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//class Point {
	//public:
	//Point(int x, int y) : x(x), y(y) {}
	//
	//private:
	//int x;
	//int y;
	//};

	//class Point {
	//public:
	//    Point(int x, int y)
	//            : x(x),
	//              y(y) {
	//    }
	//
	//private:
	//    int x;
	//    int y;
	//};
	public void testConstructorInitializer_2() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_COLON_IN_CONSTRUCTOR_INITIALIZER_LIST,
				CCorePlugin.INSERT);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONSTRUCTOR_INITIALIZER_LIST,
				Integer.toString(Alignment.M_NEXT_PER_LINE_SPLIT | Alignment.M_INDENT_ON_COLUMN | Alignment.M_FORCE));
		assertFormatterResult();
	}

	//#define A (0)
	//#define B (1)
	//#define ARGS (A, B)
	//#define CALL foo ARGS
	//void zoo(void) {
	//        foo(A,B);
	//foo ARGS;
	//CALL;
	//#if X
	//                        if (1)
	//                        {
	//                                t = 1;
	//                        }
	//#endif
	//                }

	//#define A (0)
	//#define B (1)
	//#define ARGS (A, B)
	//#define CALL foo ARGS
	//void zoo(void) {
	//	foo(A, B);
	//	foo ARGS;
	//	CALL;
	//#if X
	//	if (1)
	//	{
	//		t = 1;
	//	}
	//#endif
	//}
	public void testMacroAsFunctionArguments_Bug253039() throws Exception {
		assertFormatterResult();
	}

	//#define assign1(uc1, uc2, uc3, uc4, val) \
	//      uc1##uc2##uc3##uc4 = val;
	//
	//#define assign2(ucn, val) ucn = val;
	//
	//void foo1(void)
	//{
	//int \U00010401\U00010401\U00010401\U00010402;
	//assign1(\U00010401, \U00010401, \U00010401, \U00010402, 4);
	//}
	//
	//void foo2(void)
	//{
	//int \U00010401\U00010401\U00010401\U00010402;
	//assign2(\U00010401\U00010401\U00010401\U00010402, 4);
	//}

	//#define assign1(uc1, uc2, uc3, uc4, val) \
	//      uc1##uc2##uc3##uc4 = val;
	//
	//#define assign2(ucn, val) ucn = val;
	//
	//void foo1(void) {
	//	int \U00010401\U00010401\U00010401\U00010402;
	//	assign1(\U00010401, \U00010401, \U00010401, \U00010402, 4);
	//}
	//
	//void foo2(void) {
	//	int \U00010401\U00010401\U00010401\U00010402;
	//	assign2(\U00010401\U00010401\U00010401\U00010402, 4);
	//}
	public void testUniversalCharacters_Bug255949() throws Exception {
		assertFormatterResult();
	}

	//void foo() throw(E1,E2);

	//void foo() throw ( E1, E2 );
	public void testWhitespaceOptionsForExceptionSpecification_Bug243567() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_EXCEPTION_SPECIFICATION,
				CCorePlugin.INSERT);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_EXCEPTION_SPECIFICATION,
				CCorePlugin.INSERT);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_EXCEPTION_SPECIFICATION,
				CCorePlugin.INSERT);
		assertFormatterResult();
	}

	//void Foo::bar() {
	//*this.*FncPointer () ;  this->*FncPointer( ); }

	//void Foo::bar() {
	//	*this.*FncPointer();
	//	this->*FncPointer();
	//}
	public void testDotStarAndArrowStarOperators_Bug257700() throws Exception {
		assertFormatterResult();
	}

	//void zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz1(unsigned char __attribute__((unused)) x, unsigned char __attribute__((unused)) y){;}

	//void zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz1(
	//		unsigned char __attribute__((unused)) x,
	//		unsigned char __attribute__((unused)) y) {
	//	;
	//}
	public void test__attribute__InParameterDecl_Bug206271() throws Exception {
		assertFormatterResult();
	}

	//#define assert(e) if(!(e)) printf("Failed assertion")
	//void test(){assert(1 > 0);}

	//#define assert(e) if(!(e)) printf("Failed assertion")
	//void test() {
	//	assert(1 > 0);
	//}

	public void testMacroFormatting1_Bug241819() throws Exception {
		assertFormatterResult();
	}

	//#define PRINT if(printswitch) printf
	//void test(){int i=0;PRINT("Watch the format");if(i>0){i=1;}}

	//#define PRINT if(printswitch) printf
	//void test() {
	//	int i = 0;
	//	PRINT("Watch the format");
	//	if (i > 0) {
	//		i = 1;
	//	}
	//}
	public void testMacroFormatting2_Bug241819() throws Exception {
		assertFormatterResult();
	}

	//#define MACRO(a, b) while (a) b
	//bool f();
	//void g();
	//void test() {
	//MACRO(f(), g());
	//int i = 0;
	//}

	//#define MACRO(a, b) while (a) b
	//bool f();
	//void g();
	//void test() {
	//    MACRO(f(), g());
	//    int i = 0;
	//}
	public void testMacroStatement() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//#define MACRO(a) a(const a&); void operator=(const a&)
	//
	//class Test{MACRO(Test);};

	//#define MACRO(a) a(const a&); void operator=(const a&)
	//
	//class Test {
	//    MACRO(Test);
	//};
	public void testMacroDeclaration() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//#define MACRO(a,b) f(a,b)
	//void f(bool b, int i);
	//int function_with_loooooooooooooooong_name();
	//int another_function_with_loooooong_name();
	//
	//void test(){
	//    MACRO("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"=="bbbbbbbbbbbbbbbbbbbbbbbbbbb",function_with_loooooooooooooooong_name()+another_function_with_loooooong_name());
	//}

	//#define MACRO(a,b) f(a,b)
	//void f(bool b, int i);
	//int function_with_loooooooooooooooong_name();
	//int another_function_with_loooooong_name();
	//
	//void test() {
	//    MACRO("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
	//                  == "bbbbbbbbbbbbbbbbbbbbbbbbbbb",
	//          function_with_loooooooooooooooong_name()
	//                  + another_function_with_loooooong_name());
	//}
	public void testMacroArguments() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}

	//bool member __attribute__ ((__unused__)) = false;

	//bool member __attribute__ ((__unused__)) = false;
	public void testPreserveSpaceBetweenNameAnd__attribute__Bug261967() throws Exception {
		assertFormatterResult();
	}

	//extern "C" void f(int i, char c, float x);

	//extern "C" void f(int i, char c, float x);
	public void testPreserveSpaceInExternCDeclaration() throws Exception {
		assertFormatterResult();
	}

	//#define X
	//
	//typedef X struct {
	//};

	//#define X
	//
	//typedef X struct {
	//};
	public void testPreserveNecessarySpace_Bug268962() throws Exception {
		assertFormatterResult();
	}

	//inline   typename A foo();
	//void   bar(const typename A x)  ;
	//static   typename A x  ;

	//inline typename A foo();
	//void bar(const typename A x);
	//static typename A x;
	public void testFormatterProblemsWithTypename_Bug269590() throws Exception {
		assertFormatterResult();
	}

	//void
	//foo();
	//int*
	//bar();

	//void
	//foo();
	//int*
	//bar();
	public void testPreserveNewlineBetweenTypeAndFunctionDeclarator() throws Exception {
		assertFormatterResult();
	}

	public void testFormatGeneratedClass_Bug272006() throws Exception {
		String original = 
			"class \u5927\u5927\u5927\u5927\n" + 
			"{\n" + 
			"public:\n" + 
			"	\u5927\u5927\u5927\u5927();\n" + 
			"	virtual ~\u5927\u5927\u5927\u5927();\n" + 
			"};\n";
		String expected = 
			"class \u5927\u5927\u5927\u5927 {\n" + 
			"public:\n" + 
			"	\u5927\u5927\u5927\u5927();\n" + 
			"	virtual ~\u5927\u5927\u5927\u5927();\n" + 
			"};\n";
		assertFormatterResult(original, expected);
	}

	//void f() {
	//  Canvas1->MoveTo((50 + (24* 20 ) +xoff) *Scale,(200+yoff)*ScaleY);
	//  Canvas1->LineTo((67+(24*20) +xoff)*Scale,(200+yoff)*ScaleY);
	//  Canvas1->MoveTo((50+(24*20) +xoff)*Scale,((200+yoff)*ScaleY)-1);
	//  Canvas1->LineTo((67+(24*20) +xoff)*Scale,((200+yoff)*ScaleY)-1);
	//  Canvas1->MoveTo((50+(24*20) +xoff)*Scale,((200+yoff)*ScaleY)+1);
	//  Canvas1->LineTo((67+(24*20) +xoff)*Scale,((200+yoff)*ScaleY)+1);
	//}

	//void f() {
	//	Canvas1->MoveTo((50 + (24 * 20) + xoff) * Scale, (200 + yoff) * ScaleY);
	//	Canvas1->LineTo((67 + (24 * 20) + xoff) * Scale, (200 + yoff) * ScaleY);
	//	Canvas1->MoveTo((50 + (24 * 20) + xoff) * Scale,
	//			((200 + yoff) * ScaleY) - 1);
	//	Canvas1->LineTo((67 + (24 * 20) + xoff) * Scale,
	//			((200 + yoff) * ScaleY) - 1);
	//	Canvas1->MoveTo((50 + (24 * 20) + xoff) * Scale,
	//			((200 + yoff) * ScaleY) + 1);
	//	Canvas1->LineTo((67 + (24 * 20) + xoff) * Scale,
	//			((200 + yoff) * ScaleY) + 1);
	//}
	public void testScannerErrorWithIntegerFollowedByStar_Bug278118() throws Exception {
		assertFormatterResult();
	}

	//#define If  if (1 == 1){
	//#define Else } else {
	//#define EndElse }
	//
	//#define Try  try{
	//#define Catch } catch(...) {
	//#define EndCatch }
	//
	//int main() {
	//	Try
	//		cout << "OK2" << endl;
	//	Catch
	//		cout << "Exception" << endl;
	//	EndCatch
	//	Try
	//		cout << "OK2" << endl;
	//	Catch
	//		cout << "Exception" << endl;
	//	EndCatch
	//
	//	If
	//		cout << "OK" << endl;
	//	Else
	//		cout << "Strange" << endl;
	//	EndElse
	//
	//	Try
	//		cout << "OK2" << endl;
	//	Catch
	//		cout << "Exception" << endl;
	//	EndCatch
	//	Try
	//		cout << "OK2" << endl;
	//	Catch
	//		cout << "Exception" << endl;
	//	EndCatch
	//
	//	return 0;
	//}

	//#define If  if (1 == 1){
	//#define Else } else {
	//#define EndElse }
	//
	//#define Try  try{
	//#define Catch } catch(...) {
	//#define EndCatch }
	//
	//int main() {
	//	Try
	//		cout << "OK2" << endl;
	//	Catch
	//		cout << "Exception" << endl;
	//	EndCatch
	//	Try
	//		cout << "OK2" << endl;
	//	Catch
	//		cout << "Exception" << endl;
	//	EndCatch
	//
	//	If
	//		cout << "OK" << endl;
	//	Else
	//		cout << "Strange" << endl;
	//	EndElse
	//
	//	Try
	//		cout << "OK2" << endl;
	//	Catch
	//		cout << "Exception" << endl;
	//	EndCatch
	//	Try
	//		cout << "OK2" << endl;
	//	Catch
	//		cout << "Exception" << endl;
	//	EndCatch
	//
	//	return 0;
	//}
	public void testControlStatementsAsMacro_Bug290630() throws Exception {
		assertFormatterResult();
	}

	//#define new new(__FILE__, __LINE__)
	//void func() {char* a = new    char[10];}

	//#define new new(__FILE__, __LINE__)
	//void func() {
	//	char* a = new char[10];
	//}
	public void testPlacementNewAsMacro_Bug298593() throws Exception {
		assertFormatterResult();
	}

	//#define MACRO(a) class b : public a
	//MACRO(aClass){ int a;};

	//#define MACRO(a) class b : public a
	//MACRO(aClass) {
	//	int a;
	//};
	public void testCompositeTypeSpecAsMacro_Bug298592() throws Exception {
		assertFormatterResult();
	}

	//void f() {
	//w_char* p   =  L"wide string literal";
	//int x = 0;
	//if (x == 0) x = 5;}

	//void f() {
	//	w_char* p = L"wide string literal";
	//	int x = 0;
	//	if (x == 0)
	//		x = 5;
	//}
	public void testWideStringLiteral_Bug292626() throws Exception {
		assertFormatterResult();
	}

	//#define INT (int)
	//int i = INT 1;

	//#define INT (int)
	//int i = INT 1;
	public void testCastAsMacro_Bug285901() throws Exception {
		assertFormatterResult();
	}

	//PARENT_T sample={.a=1,.b={a[2]=1,.b.c=2}};

	//PARENT_T sample = { .a = 1, .b = { a[2] = 1, .b.c = 2 } };
	public void testDesignatedInitializer_Bug314958() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_LANGUAGE, GCCLanguage.getDefault());
		assertFormatterResult();
	}

	//void extend_terminal_bond_to_label(vector<atom_t> &atom, const vector<letters_t> &letters, int n_letters, const vector<bond_t> &bond, int n_bond, const vector<label_t> &label, int n_label, double avg, double maxh, double max_dist_double_bond);

	//void extend_terminal_bond_to_label(vector<atom_t> &atom, const vector<letters_t> &letters, int n_letters,
	//                                   const vector<bond_t> &bond, int n_bond, const vector<label_t> &label, int n_label,
	//                                   double avg, double maxh, double max_dist_double_bond);
	public void testWrappingOfTemplateIdAsParameterType_Bug325783() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "120");
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	////#define throws /* */
	//struct Foo {
	//    void foo() const throws {
	//    }
	//    void bar() const throws {
	//    }
	//};

	////#define throws /* */
	//struct Foo {
	//	void foo() const throws {
	//	}
	//	void bar() const throws {
	//	}
	//};
	public void testCodeCorruptionWithIllegalKeyword_Bug329165() throws Exception {
		assertFormatterResult();
	}

	//void extend_terminal_bond_to_label(vector<atom_t> &atom, const vector<letters_t> &letters, int n_letters, const vector<bond_t> &bond, int n_bond, const vector<label_t> &label, int n_label, double avg, double maxh, double max_dist_double_bond);

	//void extend_terminal_bond_to_label(vector<atom_t> &atom,
	//                                   const vector<letters_t> &letters,
	//                                   int n_letters, const vector<bond_t> &bond,
	//                                   int n_bond, const vector<label_t> &label,
	//                                   int n_label, double avg, double maxh,
	//                                   double max_dist_double_bond);
	public void testWrappingOfTemplateIdAsParameterType_Bug325783_2() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "80");
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//void f() {int array[5] = { 1, 2, 3, 4, 5 };for (int& x:array) x *= 2;}

	//void f() {
	//	int array[5] = { 1, 2, 3, 4, 5 };
	//	for (int& x : array)
	//		x *= 2;
	//}
	public void testRangeBasedFor_Bug328472() throws Exception {
		assertFormatterResult();
	}

	//int table[][] = {
	//   {1,2,3,4},
	//        			{ 1,   2, 3 ,  4},
	//{ 1,2,     3,4 },
	//        {1, 2,3, 4}
	//	};

	//int table[][] = {
	//		{ 1, 2, 3, 4 },
	//		{ 1, 2, 3, 4 },
	//		{ 1, 2, 3, 4 },
	//		{ 1, 2, 3, 4 }
	//};
	public void testKeepWrappedLines_Bug322776() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_JOIN_WRAPPED_LINES,
				DefaultCodeFormatterConstants.FALSE);
		assertFormatterResult();
	}

	//#define X() {  }
	//void g() {
	//	X();
	//		if (1) {
	//		x();
	//	}
	//	z();
	//}

	//#define X() {  }
	//void g() {
	//	X();
	//	if (1) {
	//		x();
	//	}
	//	z();
	//}
	public void testKeepWrappedLines_Bug322776_2() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_JOIN_WRAPPED_LINES,
				DefaultCodeFormatterConstants.FALSE);
		assertFormatterResult();
	}

	//void f() {
	//double confidence = 0.316030 //
	//- 0.016315 * C_Count //
	//+ 0.034336 * N_Count //
	//+ 0.066810 * O_Count //
	//+ 0.035674 * F_Count;
	//}

	//void f() {
	//	double confidence = 0.316030 //
	//						- 0.016315 * C_Count //
	//						+ 0.034336 * N_Count //
	//						+ 0.066810 * O_Count //
	//						+ 0.035674 * F_Count;
	//}
	public void testAlignmentOfBinaryExpression_Bug325787() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}

	//void test() {
	//int variable1 = 1000000 < 2000000 ? 3000000 + 40000000 : 8000000 + 90000000;
	//int variable2 = 1000000 < 2000000 ? 3000000 + 40000000 : 8000000 + 900000000;
	//int variable3 = 1000000 < 2000000 ? 3000000 + 4000000 + 5000000 + 6000000 + 7000000 : 8000000 + 9000000;
	//int variable4 = 1000000 < 2000000 ? 3000000 + 4000000 + 5000000 + 6000000 + 7000000 : 8000000 + 90000000;
	//int variable5;
	//variable5 = 10000000 < 2000000 ? 3000000 + 4000000 + 5000000 + 6000000 : 700000;
	//variable5 = 10000000 < 2000000 ? 3000000 + 4000000 + 5000000 + 6000000 : 7000000;
	//}

	//void test() {
	//    int variable1 = 1000000 < 2000000 ? 3000000 + 40000000 : 8000000 + 90000000;
	//    int variable2 =
	//            1000000 < 2000000 ? 3000000 + 40000000 : 8000000 + 900000000;
	//    int variable3 =
	//            1000000 < 2000000 ?
	//                    3000000 + 4000000 + 5000000 + 6000000 + 7000000 :
	//                    8000000 + 9000000;
	//    int variable4 =
	//            1000000 < 2000000 ?
	//                    3000000 + 4000000 + 5000000 + 6000000 + 7000000 :
	//                    8000000 + 90000000;
	//    int variable5;
	//    variable5 =
	//            10000000 < 2000000 ? 3000000 + 4000000 + 5000000 + 6000000 : 700000;
	//    variable5 =
	//            10000000 < 2000000 ?
	//                    3000000 + 4000000 + 5000000 + 6000000 : 7000000;
    //}
	public void testConditionalExpression() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//int variable_with_a_long_name, another_variable_with_a_long_name;
	//
	//int variable = variable_with_a_long_name < another_variable_with_a_long_name ?
	//variable_with_a_long_name + another_variable_with_a_long_name :
	//variable_with_a_long_name * 2 > another_variable_with_a_long_name ?
	//variable_with_a_long_name + another_variable_with_a_long_name :
	//variable_with_a_long_name - another_variable_with_a_long_name;

	//int variable_with_a_long_name, another_variable_with_a_long_name;
	//
	//int variable =
	//        variable_with_a_long_name < another_variable_with_a_long_name ?
	//                variable_with_a_long_name + another_variable_with_a_long_name :
	//        variable_with_a_long_name * 2 > another_variable_with_a_long_name ?
	//                variable_with_a_long_name + another_variable_with_a_long_name :
	//                variable_with_a_long_name - another_variable_with_a_long_name;
	public void testConditionalExpressionChain() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}
	
	//// Breaking at '<=' is preferred to breaking at '+'.
	//bool x = 1000000 + 2000000 + 3000000 + 4000000 <= 5000000 + 6000000 + 7000000 + 8000000;

	//// Breaking at '<=' is preferred to breaking at '+'.
	//bool x = 1000000 + 2000000 + 3000000 + 4000000
	//        <= 5000000 + 6000000 + 7000000 + 8000000;
	public void testBreakingPrecedence() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//#define m() f()
	//void f() {
	//if (1) f();
	//else m();
	//}

	//#define m() f()
	//void f() {
	//	if (1)
	//		f();
	//	else
	//		m();
	//}
	public void testMacroAfterElse() throws Exception {
		assertFormatterResult();
	}

	//#define M union { double u; void *s; long l; }
	//typedef M m_t;

	//#define M union { double u; void *s; long l; }
	//typedef M m_t;
	public void testMacroWithinTypedef() throws Exception {
		assertFormatterResult();
	}

	//#define B() { if (1+2) b(); }
	//void g() {
	//if (1) {
	//B();
	//} else {
	//x();
	//}
	//z();
	//}

	//#define B() { if (1+2) b(); }
	//void g() {
	//    if (1) {
	//        B();
	//    } else {
	//        x();
	//    }
	//    z();
	//}
	public void testBinaryExpressionInMacro() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//class Stream {
	//Stream& operator<<(const char* s);
	//};
	//
	//class Voidifier {
	//public:
	//void operator&(Stream&);
	//};
	//
	//Stream stream;
	//#define STREAM Voidifier() & stream
	//
	//void test() {
	//STREAM << "text text test text " << "text text " << "text text text text te";
	//}

	//class Stream {
	//    Stream& operator<<(const char* s);
	//};
	//
	//class Voidifier {
	//public:
	//    void operator&(Stream&);
	//};
	//
	//Stream stream;
	//#define STREAM Voidifier() & stream
	//
	//void test() {
	//    STREAM << "text text test text " << "text text "
	//            << "text text text text te";
	//}
	public void testOverloadedLeftShiftChain_1() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//class Stream {
	//Stream& operator<<(const char* s);
	//};
	//
	//class Voidifier {
	//public:
	//void operator&(Stream&);
	//};
	//
	//Stream stream;
	//#define STREAM Voidifier() & stream
	//
	//void test() {
	//STREAM << "text text test text " << "text text text text text " << "text" <<
	//"text text text text " << "text text text text text " << "text te";
	//}

	//class Stream {
	//    Stream& operator<<(const char* s);
	//};
	//
	//class Voidifier {
	//public:
	//    void operator&(Stream&);
	//};
	//
	//Stream stream;
	//#define STREAM Voidifier() & stream
	//
	//void test() {
	//    STREAM << "text text test text " << "text text text text text " << "text"
	//           << "text text text text " << "text text text text text "
	//           << "text te";
	//}
	public void testOverloadedLeftShiftChain_2() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_OVERLOADED_LEFT_SHIFT_CHAIN,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}

	//class Stream {
	//Stream& operator<<(const char* s);
	//};
	//const char* function();
	//
	//void text() {
	//Stream() << "0123456789012345678" << function() << "0123456789012345678" << "0123";
	//int i;
	//}

	//class Stream {
	//    Stream& operator<<(const char* s);
	//};
	//const char* function();
	//
	//void text() {
	//    Stream() << "0123456789012345678" << function() << "0123456789012345678"
	//             << "0123";
	//    int i;
	//}
	public void testOverloadedLeftShiftChain_3() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_OVERLOADED_LEFT_SHIFT_CHAIN,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}

	//class Stream {
	//Stream& operator<<(const char* s);
	//Stream& operator<<(int i);
	//};
	//
	//Stream stream;
	//int variable_with_a_long_name, another_variable_with_a_long_name;
	//
	//void test() {
    //stream << (variable_with_a_long_name + another_variable_with_a_long_name) * variable_with_a_long_name <<
	//"01234567890123456789";
	//}

	//class Stream {
	//    Stream& operator<<(const char* s);
	//    Stream& operator<<(int i);
	//};
	//
	//Stream stream;
	//int variable_with_a_long_name, another_variable_with_a_long_name;
	//
	//void test() {
	//    stream << (variable_with_a_long_name + another_variable_with_a_long_name)
	//                   * variable_with_a_long_name
	//           << "01234567890123456789";
	//}
	public void testOverloadedLeftShiftChain_4() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_OVERLOADED_LEFT_SHIFT_CHAIN,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}

	//struct Stream {
	//Stream& operator <<(const char*);
	//};
	//Stream GetStream();
	//
	//#define MY_MACRO switch (0) case 0: default: GetStream()
	//
	//void test() {
	//MY_MACRO << "Loooooooooooooooooooong string literal" << " another literal.";
	//MY_MACRO << "Looooooooooooooooooooong string literal" << " another literal.";
	//}

	//struct Stream {
	//    Stream& operator <<(const char*);
	//};
	//Stream GetStream();
	//
	//#define MY_MACRO switch (0) case 0: default: GetStream()
	//
	//void test() {
	//    MY_MACRO << "Loooooooooooooooooooong string literal" << " another literal.";
	//    MY_MACRO << "Looooooooooooooooooooong string literal"
	//             << " another literal.";
	//}
	public void testOverloadedLeftShiftChain_5() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_OVERLOADED_LEFT_SHIFT_CHAIN,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}

	//struct Stream {
	//Stream& operator <<(const char*);
	//};
	//Stream GetStream();
	//
	//#define MY_MACRO switch (0) case 0: default: if (bool x = false) ; else GetStream()
	//
	//void test() {
	//MY_MACRO
	//<< "Loooooooooooooooooooong string literal" << " another literal.";
	//MY_MACRO
	//<< "Looooooooooooooooooooong string literal" << " another literal.";
	//}

	//struct Stream {
	//    Stream& operator <<(const char*);
	//};
	//Stream GetStream();
	//
	//#define MY_MACRO switch (0) case 0: default: if (bool x = false) ; else GetStream()
	//
	//void test() {
	//    MY_MACRO << "Loooooooooooooooooooong string literal" << " another literal.";
	//    MY_MACRO << "Looooooooooooooooooooong string literal"
	//             << " another literal.";
	//}
	public void testOverloadedLeftShiftChain_6() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_OVERLOADED_LEFT_SHIFT_CHAIN,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}

	//bool loooooooooooong_name(int, int);
	//int loooong_name;
	//int very_loooooooooooooooooooooooong_name;
	//
	//struct Stream {
	//Stream& operator <<(const char*);
	//};
	//Stream GetStream();
	//
	//struct Voidifier {
	//void operator&(Stream&);
	//};
	//
	//#define MY_MACRO(a) (a) ? (void) 0 : Voidifier() & GetStream() << " "
	//
	//void test(const char* variable_with_a_loooong_name) {
	//  MY_MACRO(loooooooooooong_name(loooong_name,
	//                                very_loooooooooooooooooooooooong_name))
	//      << variable_with_a_loooong_name;
	//}

	//bool loooooooooooong_name(int, int);
	//int loooong_name;
	//int very_loooooooooooooooooooooooong_name;
	//
	//struct Stream {
	//  Stream& operator <<(const char*);
	//};
	//Stream GetStream();
	//
	//struct Voidifier {
	//  void operator&(Stream&);
	//};
	//
	//#define MY_MACRO(a) (a) ? (void) 0 : Voidifier() & GetStream() << " "
	//
	//void test(const char* variable_with_a_loooong_name) {
	//  MY_MACRO(loooooooooooong_name(loooong_name,
	//          very_loooooooooooooooooooooooong_name))
	//      << variable_with_a_loooong_name;
	//}
	public void testOverloadedLeftShiftChain_7() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "2");
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_OVERLOADED_LEFT_SHIFT_CHAIN,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}

	//struct Stream {
	//Stream& operator <<(const char*);
	//};
	//Stream GetStream();
	//
	//struct Voidifier {
	//void operator&(Stream&);
	//};
	//
	//#define MY_MACRO(a) (a) ? (void) 0 : Voidifier() & GetStream() << " "
	//
	//void test() {
	//MY_MACRO(false)
	//<< "Loooooooooooooooooooooooooooooooooooooooong string literal";
	//}

	//struct Stream {
	//    Stream& operator <<(const char*);
	//};
	//Stream GetStream();
	//
	//struct Voidifier {
	//    void operator&(Stream&);
	//};
	//
	//#define MY_MACRO(a) (a) ? (void) 0 : Voidifier() & GetStream() << " "
	//
	//void test() {
	//    MY_MACRO(false)
	//            << "Loooooooooooooooooooooooooooooooooooooooong string literal";
	//}
	public void testOverloadedLeftShiftChain_Bug373034() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_OVERLOADED_LEFT_SHIFT_CHAIN,
				Integer.toString(Alignment.M_COMPACT_SPLIT | Alignment.M_INDENT_ON_COLUMN));
		assertFormatterResult();
	}
	//int main() {
	//	std::vector<std::vector<int>> test;
	//	// some comment
	//	return 0;
	//}

	//int main() {
	//	std::vector<std::vector<int>> test;
	//	// some comment
	//	return 0;
	//}
	public void testDoubleClosingAngleBrackets_Bug333816() throws Exception {
		assertFormatterResult();
	}

	//void foo() {
	//	int i;
	//	for (iiiiiiiiiiiiiiiiii = 0; iiiiiiiiiiiiiiiiii < 10; iiiiiiiiiiiiiiiiii++) {
	//	}
	//	foo();
	//}

	//void foo() {
	//	int i;
	//	for (iiiiiiiiiiiiiiiiii = 0; iiiiiiiiiiiiiiiiii < 10;
	//			iiiiiiiiiiiiiiiiii++) {
	//	}
	//	foo();
	//}
	public void testForLoopWrappingAtOpeningBrace() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "80");
		assertFormatterResult();
	}
	
	//void foo() {
	//	int i;
	//	for (i = 0; i < 10; i++) {
	//	}
	//	foo();
	//}

	//void foo() {
	//	int i;
	//	for (i = 0; i < 10; i++) {
	//	}
	//	foo();
	//}
	public void testForLoopKnR_Bug351399() throws Exception {
		assertFormatterResult();
	}
	
	//void foo() {
	//	int i;
	//	for (i = 0; i < 10; i++) {
	//	}
	//	foo();
	//}

	//void foo()
	//    {
	//    int i;
	//    for (i = 0; i < 10; i++)
	//	{
	//	}
	//    foo();
	//    }
	public void testForLoopWhitesmiths_Bug351399() throws Exception {
		fOptions.putAll(DefaultCodeFormatterOptions.getWhitesmithsSettings().getMap());
		assertFormatterResult();
	}

	//void foo() {
	//	int i;
	//	for (i = 0; i < 10; i++) {
	//	}
	//	foo();
	//}

	//void
	//foo()
	//{
	//  int i;
	//  for (i = 0; i < 10; i++)
	//    {
	//    }
	//  foo();
	//}
	public void testForLoopGNU_Bug351399() throws Exception {
		fOptions.putAll(DefaultCodeFormatterOptions.getGNUSettings().getMap());
		assertFormatterResult();
	}

	//void foo() {
	//	int i;
	//	for (i = 0; i < 10; i++) {
	//	}
	//	foo();
	//}

	//void foo()
	//{
	//	int i;
	//	for (i = 0; i < 10; i++)
	//	{
	//	}
	//	foo();
	//}
	public void testForLoopAllman_Bug351399() throws Exception {
		fOptions.putAll(DefaultCodeFormatterOptions.getAllmanSettings().getMap());
		assertFormatterResult();
	}

	//void f() {
	//	int i = static_cast<int>(5+1);
	//	int j;
	//}

	//void f() {
	//	int i = static_cast<int>(5 + 1);
	//	int j;
	//}
	public void testStaticCastInInitializer_Bug353974() throws Exception {
		assertFormatterResult();
	}

	//#define A 1
	//#define B 2
	//#define C 4
	//void f(int x, int y) {
	//	f(A|B|C,5);
	//	return;
	//}

	//#define A 1
	//#define B 2
	//#define C 4
	//void f(int x, int y) {
	//	f(A | B | C, 5);
	//	return;
	//}
	public void testMacroInBinaryExpression_Bug344379() throws Exception {
		assertFormatterResult();
	}

	public void testBackslashUInPreprocessorDirective_Bug350433() throws Exception {
		String before= "#include \"test\\udp.h\"\n";
		String expected= before;
		assertFormatterResult(before, expected);
	}

	//#define SIZE 5
	//char s0[5];
	//char s1[1+1];
	//char s2[SIZE];
	//char s3[SIZE+1];
	//char s4[SIZE+SIZE];
	//char s5[1+SIZE];

	//#define SIZE 5
	//char s0[5];
	//char s1[1 + 1];
	//char s2[SIZE];
	//char s3[SIZE + 1];
	//char s4[SIZE + SIZE];
	//char s5[1 + SIZE];
	public void testExpressionInArrayDeclarator_Bug350816() throws Exception {
		assertFormatterResult();
	}

	//void f(int p0 ,... ){}
	
	//void f(int p0, ...) {
	//}
	public void testEllipsisInFunctionDefinition_Bug350689() throws Exception {
		assertFormatterResult();
	}

	//struct{int n;}* l;
	//void f(int p0, int p1) { f((p0 + 2), l->n); }

	//struct {
	//	int n;
	//}* l;
	//void f(int p0, int p1) {
	//	f((p0 + 2), l->n);
	//}
	public void testParenthesizedExpressionInArgumentList_Bug350689() throws Exception {
		assertFormatterResult();
	}

	//#define m(x) { x=1; }
	//void f() {
	//	int i;
	//	if (1) i=1;
	//	else m(i);
	//}

	//#define m(x) { x=1; }
	//void f() {
	//	int i;
	//	if (1)
	//		i = 1;
	//	else
	//		m(i);
	//}
	public void testMacroInElseBranch_Bug350689() throws Exception {
		assertFormatterResult();
	}

	//#define EXPR(a) a
	//void f(){
	//switch(EXPR(1)){default:break;}
	//}

	//#define EXPR(a) a
	//void f() {
	//    switch (EXPR(1)) {
	//    default:
	//        break;
	//    }
	//}
	public void testMacroInSwitch() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		assertFormatterResult();
	}

	//#define IF(cond) if(cond){}
	//void f() { if(1){}IF(1>0);}

	//#define IF(cond) if(cond){}
	//void f() {
	//	if (1) {
	//	}
	//	IF(1 > 0);
	//}
	public void testMacroAfterCompoundStatement_Bug356690() throws Exception {
		assertFormatterResult();
	}

	//enum SomeEnum {
	//FirstValue,// first value comment
	//SecondValue// second value comment
	//};
	//enum OtherEnum {
	//First,// first value comment
	//Second,// second value comment
	//};

	//enum SomeEnum {
	//    FirstValue,  // first value comment
	//    SecondValue  // second value comment
	//};
	//enum OtherEnum {
	//    First,  // first value comment
	//    Second,  // second value comment
	//};
	public void testEnum() throws Exception {
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
		fOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_MIN_DISTANCE_BETWEEN_CODE_AND_LINE_COMMENT, "2");
		assertFormatterResult();
	}

	//#define TESTING(m) ;do{}while(0)
	//void f() {
	//	TESTING(1);
	//	if(Test(a) != 1) {
	//		status = ERROR;
	//	}
	//}

	//#define TESTING(m) ;do{}while(0)
	//void f() {
	//	TESTING(1);
	//	if (Test(a) != 1) {
	//		status = ERROR;
	//	}
	//}
	public void testDoWhileInMacro_Bug359658() throws Exception {
		assertFormatterResult();
	}
}

Back to the top