summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.78.0/tests/expected/c/09618-Issue_2360.c
blob: 898c64e6e805667be39f4503efa563e68deff342 (plain)
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
int short_function();
int some_very_very_very_very_very_very_very_very_long_function();
int main() {
	// short condition, no existing newlines
	if (short_function()
	    ) {}

	// short condition, existing newlines
	if (
		short_function()
		) {}

	// long condition, no newlines
	if (some_very_very_very_very_very_very_very_very_long_function() &&
	    some_very_very_very_very_very_very_very_very_long_function()) {}

	// long condition, newlines
	else if (some_very_very_very_very_very_very_very_very_long_function() &&
	         some_very_very_very_very_very_very_very_very_long_function()) {}

	// switch condition
	switch (some_very_very_very_very_very_very_very_very_long_function() &&
	        some_very_very_very_very_very_very_very_very_long_function()) {
	case default: break;
	}

	// while condition, line comments
	while (
		// comment 1
		short_function()
		// comment 2
		) {}

	// for condition, inline comments
	for ( /* a */ int i=0; some_very_very_very_very_very_very_very_very_long_function()
	      && some_very_very_very_very_very_very_very_very_long_function() && i < 10; i++ // trailing comment
	      ) {}
}