1// RUN: %check_clang_tidy %s google-objc-function-naming %t
2
3typedef _Bool bool;
4
5static bool ispositive(int a) { return a > 0; }
6// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: static function named 'ispositive'
7// must be in Pascal case as required by Google Objective-C style guide
8// CHECK-FIXES: static bool Ispositive(int a) { return a > 0; }
9
10static bool is_positive(int a) { return a > 0; }
11// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: static function named 'is_positive'
12// must be in Pascal case as required by Google Objective-C style guide
13// CHECK-FIXES: static bool IsPositive(int a) { return a > 0; }
14
15static bool isPositive(int a) { return a > 0; }
16// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: static function named 'isPositive'
17// must be in Pascal case as required by Google Objective-C style guide
18// CHECK-FIXES: static bool IsPositive(int a) { return a > 0; }
19
20static bool Is_Positive(int a) { return a > 0; }
21// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: static function named 'Is_Positive'
22// must be in Pascal case as required by Google Objective-C style guide
23// CHECK-FIXES: static bool IsPositive(int a) { return a > 0; }
24
25static bool IsPositive(int a) { return a > 0; }
26
27bool ispalindrome(const char *str);
28// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function in global namespace named
29// 'ispalindrome' must have an appropriate prefix followed by Pascal case as
30// required by Google Objective-C style guide
31
32static const char *md5(const char *str) { return 0; }
33// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: static function named 'md5' must be
34// in Pascal case as required by Google Objective-C style guide
35// CHECK-FIXES: static const char *Md5(const char *str) { return 0; }
36
37static const char *MD5(const char *str) { return 0; }
38
39static const char *URL(void) { return "https://clang.llvm.org/"; }
40
41static const char *DEFURL(void) { return "https://clang.llvm.org/"; }
42
43static const char *DEFFooURL(void) { return "https://clang.llvm.org/"; }
44
45static const char *StringFromNSString(id str) { return ""; }
46
47void ABLog_String(const char *str);
48// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function in global namespace named
49// 'ABLog_String' must have an appropriate prefix followed by Pascal case as
50// required by Google Objective-C style guide
51
52void ABLogString(const char *str);
53
54bool IsPrime(int a);
55// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function in global namespace named
56// 'IsPrime' must have an appropriate prefix followed by Pascal case as required
57// by Google Objective-C style guide
58
59const char *ABURL(void) { return "https://clang.llvm.org/"; }
60
61const char *ABFooURL(void) { return "https://clang.llvm.org/"; }
62
63int main(int argc, const char **argv) { return 0; }
64