| 1 |
// RUN: %check_clang_tidy %s readability-identifier-naming %t -- \ |
| 2 |
// RUN: -config="{CheckOptions: { \ |
| 3 |
// RUN: readability-identifier-naming.ParameterCase: CamelCase, \ |
| 4 |
// RUN: readability-identifier-naming.ParameterIgnoredRegexp: '^[a-z]{1,2}$', \ |
| 5 |
// RUN: readability-identifier-naming.ClassCase: CamelCase, \ |
| 6 |
// RUN: readability-identifier-naming.ClassIgnoredRegexp: '^fo$|^fooo$', \ |
| 7 |
// RUN: readability-identifier-naming.StructCase: CamelCase, \ |
| 8 |
// RUN: readability-identifier-naming.StructIgnoredRegexp: 'sooo|so|soo|$invalidregex[' \ |
| 9 |
// RUN: }}" |
| 10 |
|
| 11 |
int testFunc(int a, char **b); |
| 12 |
int testFunc(int ab, char **ba); |
| 13 |
int testFunc(int abc, char **cba); |
| 14 |
// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for parameter 'abc' |
| 15 |
// CHECK-MESSAGES: :[[@LINE-2]]:30: warning: invalid case style for parameter 'cba' |
| 16 |
// CHECK-FIXES: {{^}}int testFunc(int Abc, char **Cba);{{$}} |
| 17 |
int testFunc(int dE, char **eD); |
| 18 |
// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for parameter 'dE' |
| 19 |
// CHECK-MESSAGES: :[[@LINE-2]]:29: warning: invalid case style for parameter 'eD' |
| 20 |
// CHECK-FIXES: {{^}}int testFunc(int DE, char **ED);{{$}} |
| 21 |
int testFunc(int Abc, char **Cba); |
| 22 |
|
| 23 |
class fo { |
| 24 |
}; |
| 25 |
|
| 26 |
class fofo { |
| 27 |
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for class 'fofo' |
| 28 |
// CHECK-FIXES: {{^}}class Fofo {{{$}} |
| 29 |
}; |
| 30 |
|
| 31 |
class foo { |
| 32 |
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for class 'foo' |
| 33 |
// CHECK-FIXES: {{^}}class Foo {{{$}} |
| 34 |
}; |
| 35 |
|
| 36 |
class fooo { |
| 37 |
}; |
| 38 |
|
| 39 |
class afooo { |
| 40 |
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for class 'afooo' |
| 41 |
// CHECK-FIXES: {{^}}class Afooo {{{$}} |
| 42 |
}; |
| 43 |
|
| 44 |
struct soo { |
| 45 |
// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for struct 'soo' |
| 46 |
// CHECK-FIXES: {{^}}struct Soo {{{$}} |
| 47 |
}; |