vfs: check userland buffers before reading them.
[haiku.git] / src / tools / checkstyle / test.cpp
blob3d3c6593e10a6cffac2e3be3914b18bc7f84b394
1 /* Test-file for coding style checker
2 * Copyright 2010, Haiku, Inc.
3 * Distributed under the terms of the MIT Licence
4 */
7 // DETECTED problems
10 // Line longer than 80 chars
11 int
12 someveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryverylongFunctionName( int aLongParameter)
14 // Identantion with spaces instead of tabs
15 int a;
16 int b;
17 int c;
19 // Missing space after control statement
20 if(condition);
22 //Missing space at comment start
24 // Operator without spaces
25 if (a>b);
27 // Operator at end of line
28 if (a >
30 j =
31 k +
34 // Wrong line breaks around else
35 if (test)
38 else
41 // Less than two lines between functions
44 // Missing space before opening brace
45 int
46 aFunction(char param){
47 // More than two lines between blocks
52 // CORRECT things that should not be detected as violations
53 #include <dir/path.h>
54 // Not matched by 'operator at end of line'
57 // Below this are FALSE POSITIVES (think of it as a TODO list)
58 // Test-file
59 // Matched by 'space around operator' (should not be matched in comments)
62 // NOT DETECTED violations
63 int func()
65 if (a)
67 // The brace should be on the same line as the if
70 // Everything related to naming conventions