summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.78.0/tests/expected/c/09617-Issue_2360.c
blob: 0489b0f9cb99194ced9c40b8fb27b9a70a834034 (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
39
40
41
42
43
44
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
		) {}
}