1// RUN: %check_clang_tidy %s readability-identifier-naming %t -- \
2// RUN: --config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy -- -I %S
3
4#include "identifier-naming-standard-types.h"
5
6// clang-format off
7//===----------------------------------------------------------------------===//
8// Cases to CheckOptions
9//===----------------------------------------------------------------------===//
10const int GlobalConstantCase = 0;
11// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for global constant 'GlobalConstantCase' [readability-identifier-naming]
12// CHECK-FIXES: {{^}}const int iGlobalConstantCase = 0;
13
14const int* GlobalConstantPointerCase = NULL;
15// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: invalid case style for global pointer 'GlobalConstantPointerCase' [readability-identifier-naming]
16// CHECK-FIXES: {{^}}const int* piGlobalConstantPointerCase = NULL;
17
18int* GlobalPointerCase = NULL;
19// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global pointer 'GlobalPointerCase' [readability-identifier-naming]
20// CHECK-FIXES: {{^}}int* piGlobalPointerCase = NULL;
21
22int GlobalVariableCase = 0;
23// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'GlobalVariableCase' [readability-identifier-naming]
24// CHECK-FIXES: {{^}}int iGlobalVariableCase = 0;
25
26void Func1(){
27 int const LocalConstantCase = 3;
28 // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: invalid case style for local constant 'LocalConstantCase' [readability-identifier-naming]
29 // CHECK-FIXES: {{^}} int const iLocalConstantCase = 3;
30
31 unsigned const ConstantCase = 1;
32 // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for local constant 'ConstantCase' [readability-identifier-naming]
33 // CHECK-FIXES: {{^}} unsigned const uConstantCase = 1;
34
35 int* const LocalConstantPointerCase = NULL;
36 // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for local constant pointer 'LocalConstantPointerCase' [readability-identifier-naming]
37 // CHECK-FIXES: {{^}} int* const piLocalConstantPointerCase = NULL;
38
39 int *LocalPointerCase = NULL;
40 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for local pointer 'LocalPointerCase' [readability-identifier-naming]
41 // CHECK-FIXES: {{^}} int *piLocalPointerCase = NULL;
42
43 int LocalVariableCase = 0;
44 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for local variable 'LocalVariableCase' [readability-identifier-naming]
45 // CHECK-FIXES: {{^}} int iLocalVariableCase = 0;
46}
47
48struct CMyClass2 {
49 char MemberCase;
50 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for public member 'MemberCase' [readability-identifier-naming]
51 // CHECK-FIXES: {{^}} char cMemberCase;
52};
53
54static const int StaticConstantCase = 3;
55// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for global constant 'StaticConstantCase' [readability-identifier-naming]
56// CHECK-FIXES: {{^}}static const int iStaticConstantCase = 3;
57
58static int StaticVariableCase = 3;
59// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: invalid case style for global variable 'StaticVariableCase' [readability-identifier-naming]
60// CHECK-FIXES: {{^}}static int iStaticVariableCase = 3;
61
62struct MyStruct { int StructCase; };
63// CHECK-MESSAGES: :[[@LINE-1]]:23: warning: invalid case style for public member 'StructCase' [readability-identifier-naming]
64// CHECK-FIXES: {{^}}struct MyStruct { int iStructCase; };
65
66struct shouldBeCamelCaseStruct { int iField; };
67// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for struct 'shouldBeCamelCaseStruct' [readability-identifier-naming]
68// CHECK-FIXES: {{^}}struct ShouldBeCamelCaseStruct { int iField; };
69
70union MyUnion { int UnionCase; long lUnionCase; };
71// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for union 'MyUnion' [readability-identifier-naming]
72// CHECK-MESSAGES: :[[@LINE-2]]:21: warning: invalid case style for public member 'UnionCase' [readability-identifier-naming]
73// CHECK-FIXES: {{^}}union myUnion { int iUnionCase; long lUnionCase; };
74
75//===----------------------------------------------------------------------===//
76// C string
77//===----------------------------------------------------------------------===//
78const char *NamePtr = "Name";
79// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: invalid case style for global pointer 'NamePtr' [readability-identifier-naming]
80// CHECK-FIXES: {{^}}const char *szNamePtr = "Name";
81
82const char NameArray[] = "Name";
83// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: invalid case style for global constant 'NameArray' [readability-identifier-naming]
84// CHECK-FIXES: {{^}}const char szNameArray[] = "Name";
85
86const char *NamePtrArray[] = {"AA", "BB"};
87// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: invalid case style for global variable 'NamePtrArray' [readability-identifier-naming]
88// CHECK-FIXES: {{^}}const char *pszNamePtrArray[] = {"AA", "BB"};
89
90const wchar_t *WideNamePtr = L"Name";
91// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: invalid case style for global pointer 'WideNamePtr' [readability-identifier-naming]
92// CHECK-FIXES: {{^}}const wchar_t *wszWideNamePtr = L"Name";
93
94const wchar_t WideNameArray[] = L"Name";
95// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: invalid case style for global constant 'WideNameArray' [readability-identifier-naming]
96// CHECK-FIXES: {{^}}const wchar_t wszWideNameArray[] = L"Name";
97
98const wchar_t *WideNamePtrArray[] = {L"AA", L"BB"};
99// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: invalid case style for global variable 'WideNamePtrArray' [readability-identifier-naming]
100// CHECK-FIXES: {{^}}const wchar_t *pwszWideNamePtrArray[] = {L"AA", L"BB"};
101
102
103//===----------------------------------------------------------------------===//
104// Microsoft Windows data types
105//===----------------------------------------------------------------------===//
106DWORD MsDword = 0;
107// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for global variable 'MsDword' [readability-identifier-naming]
108// CHECK-FIXES: {{^}}DWORD dwMsDword = 0;
109
110BYTE MsByte = 0;
111// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global variable 'MsByte' [readability-identifier-naming]
112// CHECK-FIXES: {{^}}BYTE byMsByte = 0;
113
114WORD MsWord = 0;
115// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global variable 'MsWord' [readability-identifier-naming]
116// CHECK-FIXES: {{^}}WORD wMsWord = 0;
117
118BOOL MsBool = 0;
119// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global variable 'MsBool' [readability-identifier-naming]
120// CHECK-FIXES: {{^}}BOOL bMsBool = 0;
121
122BOOLEAN MsBoolean = 0;
123// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for global variable 'MsBoolean' [readability-identifier-naming]
124// CHECK-FIXES: {{^}}BOOLEAN bMsBoolean = 0;
125
126CHAR MsValueChar = 0;
127// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global variable 'MsValueChar' [readability-identifier-naming]
128// CHECK-FIXES: {{^}}CHAR cMsValueChar = 0;
129
130UCHAR MsValueUchar = 0;
131// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for global variable 'MsValueUchar' [readability-identifier-naming]
132// CHECK-FIXES: {{^}}UCHAR ucMsValueUchar = 0;
133
134SHORT MsValueShort = 0;
135// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for global variable 'MsValueShort' [readability-identifier-naming]
136// CHECK-FIXES: {{^}}SHORT sMsValueShort = 0;
137
138USHORT MsValueUshort = 0;
139// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for global variable 'MsValueUshort' [readability-identifier-naming]
140// CHECK-FIXES: {{^}}USHORT usMsValueUshort = 0;
141
142WORD MsValueWord = 0;
143// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global variable 'MsValueWord' [readability-identifier-naming]
144// CHECK-FIXES: {{^}}WORD wMsValueWord = 0;
145
146DWORD MsValueDword = 0;
147// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for global variable 'MsValueDword' [readability-identifier-naming]
148// CHECK-FIXES: {{^}}DWORD dwMsValueDword = 0;
149
150DWORD32 MsValueDword32 = 0;
151// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for global variable 'MsValueDword32' [readability-identifier-naming]
152// CHECK-FIXES: {{^}}DWORD32 dw32MsValueDword32 = 0;
153
154DWORD64 MsValueDword64 = 0;
155// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for global variable 'MsValueDword64' [readability-identifier-naming]
156// CHECK-FIXES: {{^}}DWORD64 dw64MsValueDword64 = 0;
157
158LONG MsValueLong = 0;
159// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global variable 'MsValueLong' [readability-identifier-naming]
160// CHECK-FIXES: {{^}}LONG lMsValueLong = 0;
161
162ULONG MsValueUlong = 0;
163// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for global variable 'MsValueUlong' [readability-identifier-naming]
164// CHECK-FIXES: {{^}}ULONG ulMsValueUlong = 0;
165
166ULONG32 MsValueUlong32 = 0;
167// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for global variable 'MsValueUlong32' [readability-identifier-naming]
168// CHECK-FIXES: {{^}}ULONG32 ul32MsValueUlong32 = 0;
169
170ULONG64 MsValueUlong64 = 0;
171// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for global variable 'MsValueUlong64' [readability-identifier-naming]
172// CHECK-FIXES: {{^}}ULONG64 ul64MsValueUlong64 = 0;
173
174ULONGLONG MsValueUlongLong = 0;
175// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for global variable 'MsValueUlongLong' [readability-identifier-naming]
176// CHECK-FIXES: {{^}}ULONGLONG ullMsValueUlongLong = 0;
177
178HANDLE MsValueHandle = 0;
179// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for global pointer 'MsValueHandle' [readability-identifier-naming]
180// CHECK-FIXES: {{^}}HANDLE hMsValueHandle = 0;
181
182INT MsValueInt = 0;
183// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'MsValueInt' [readability-identifier-naming]
184// CHECK-FIXES: {{^}}INT iMsValueInt = 0;
185
186INT8 MsValueInt8 = 0;
187// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global variable 'MsValueInt8' [readability-identifier-naming]
188// CHECK-FIXES: {{^}}INT8 i8MsValueInt8 = 0;
189
190INT16 MsValueInt16 = 0;
191// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for global variable 'MsValueInt16' [readability-identifier-naming]
192// CHECK-FIXES: {{^}}INT16 i16MsValueInt16 = 0;
193
194INT32 MsValueInt32 = 0;
195// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for global variable 'MsValueInt32' [readability-identifier-naming]
196// CHECK-FIXES: {{^}}INT32 i32MsValueInt32 = 0;
197
198INT64 MsValueINt64 = 0;
199// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for global variable 'MsValueINt64' [readability-identifier-naming]
200// CHECK-FIXES: {{^}}INT64 i64MsValueINt64 = 0;
201
202UINT MsValueUint = 0;
203// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global variable 'MsValueUint' [readability-identifier-naming]
204// CHECK-FIXES: {{^}}UINT uiMsValueUint = 0;
205
206UINT8 MsValueUint8 = 0;
207// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for global variable 'MsValueUint8' [readability-identifier-naming]
208// CHECK-FIXES: {{^}}UINT8 u8MsValueUint8 = 0;
209
210UINT16 MsValueUint16 = 0;
211// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for global variable 'MsValueUint16' [readability-identifier-naming]
212// CHECK-FIXES: {{^}}UINT16 u16MsValueUint16 = 0;
213
214UINT32 MsValueUint32 = 0;
215// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for global variable 'MsValueUint32' [readability-identifier-naming]
216// CHECK-FIXES: {{^}}UINT32 u32MsValueUint32 = 0;
217
218UINT64 MsValueUint64 = 0;
219// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for global variable 'MsValueUint64' [readability-identifier-naming]
220// CHECK-FIXES: {{^}}UINT64 u64MsValueUint64 = 0;
221
222PVOID MsValuePvoid = NULL;
223// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for global pointer 'MsValuePvoid' [readability-identifier-naming]
224// CHECK-FIXES: {{^}}PVOID pMsValuePvoid = NULL;
225
226
227//===----------------------------------------------------------------------===//
228// Array
229//===----------------------------------------------------------------------===//
230unsigned GlobalUnsignedArray[] = {1, 2, 3};
231// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: invalid case style for global variable 'GlobalUnsignedArray' [readability-identifier-naming]
232// CHECK-FIXES: {{^}}unsigned aGlobalUnsignedArray[] = {1, 2, 3};
233
234int GlobalIntArray[] = {1, 2, 3};
235// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'GlobalIntArray' [readability-identifier-naming]
236// CHECK-FIXES: {{^}}int aGlobalIntArray[] = {1, 2, 3};
237
238int DataInt[1] = {0};
239// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'DataInt' [readability-identifier-naming]
240// CHECK-FIXES: {{^}}int aDataInt[1] = {0};
241
242int DataArray[2] = {0};
243// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'DataArray' [readability-identifier-naming]
244// CHECK-FIXES: {{^}}int aDataArray[2] = {0};
245
246
247//===----------------------------------------------------------------------===//
248// Pointer
249//===----------------------------------------------------------------------===//
250int *DataIntPtr[1] = {0};
251// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global variable 'DataIntPtr' [readability-identifier-naming]
252// CHECK-FIXES: {{^}}int *paDataIntPtr[1] = {0};
253
254void *BufferPtr1;
255// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for global pointer 'BufferPtr1' [readability-identifier-naming]
256// CHECK-FIXES: {{^}}void *pBufferPtr1;
257
258void **BufferPtr2;
259// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for global pointer 'BufferPtr2' [readability-identifier-naming]
260// CHECK-FIXES: {{^}}void **ppBufferPtr2;
261
262void **pBufferPtr3;
263// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for global pointer 'pBufferPtr3' [readability-identifier-naming]
264// CHECK-FIXES: {{^}}void **ppBufferPtr3;
265
266int *pBufferPtr4;
267// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global pointer 'pBufferPtr4' [readability-identifier-naming]
268// CHECK-FIXES: {{^}}int *piBufferPtr4;
269
270typedef void (*FUNC_PTR_HELLO)();
271FUNC_PTR_HELLO Hello = NULL;
272// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: invalid case style for global pointer 'Hello' [readability-identifier-naming]
273// CHECK-FIXES: {{^}}FUNC_PTR_HELLO fnHello = NULL;
274
275void *ValueVoidPtr = NULL;
276// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for global pointer 'ValueVoidPtr' [readability-identifier-naming]
277// CHECK-FIXES: {{^}}void *pValueVoidPtr = NULL;
278
279ptrdiff_t PtrDiff = NULL;
280// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for global variable 'PtrDiff' [readability-identifier-naming]
281// CHECK-FIXES: {{^}}ptrdiff_t pPtrDiff = NULL;
282
283int8_t *ValueI8Ptr;
284// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for global pointer 'ValueI8Ptr' [readability-identifier-naming]
285// CHECK-FIXES: {{^}}int8_t *pi8ValueI8Ptr;
286
287uint8_t *ValueU8Ptr;
288// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: invalid case style for global pointer 'ValueU8Ptr' [readability-identifier-naming]
289// CHECK-FIXES: {{^}}uint8_t *pu8ValueU8Ptr;
290
291unsigned char *ValueUcPtr;
292// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: invalid case style for global pointer 'ValueUcPtr' [readability-identifier-naming]
293// CHECK-FIXES: {{^}}unsigned char *pucValueUcPtr;
294
295unsigned char **ValueUcPtr2;
296// CHECK-MESSAGES: :[[@LINE-1]]:17: warning: invalid case style for global pointer 'ValueUcPtr2' [readability-identifier-naming]
297// CHECK-FIXES: {{^}}unsigned char **ppucValueUcPtr2;
298
299void MyFunc2(void* Val){}
300// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: invalid case style for pointer parameter 'Val' [readability-identifier-naming]
301// CHECK-FIXES: {{^}}void MyFunc2(void* pVal){}
302
303
304//===----------------------------------------------------------------------===//
305// Various types
306//===----------------------------------------------------------------------===//
307int8_t ValueI8;
308// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for global variable 'ValueI8' [readability-identifier-naming]
309// CHECK-FIXES: {{^}}int8_t i8ValueI8;
310
311int16_t ValueI16 = 0;
312// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for global variable 'ValueI16' [readability-identifier-naming]
313// CHECK-FIXES: {{^}}int16_t i16ValueI16 = 0;
314
315int32_t ValueI32 = 0;
316// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for global variable 'ValueI32' [readability-identifier-naming]
317// CHECK-FIXES: {{^}}int32_t i32ValueI32 = 0;
318
319int64_t ValueI64 = 0;
320// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for global variable 'ValueI64' [readability-identifier-naming]
321// CHECK-FIXES: {{^}}int64_t i64ValueI64 = 0;
322
323uint8_t ValueU8 = 0;
324// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for global variable 'ValueU8' [readability-identifier-naming]
325// CHECK-FIXES: {{^}}uint8_t u8ValueU8 = 0;
326
327uint16_t ValueU16 = 0;
328// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: invalid case style for global variable 'ValueU16' [readability-identifier-naming]
329// CHECK-FIXES: {{^}}uint16_t u16ValueU16 = 0;
330
331uint32_t ValueU32 = 0;
332// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: invalid case style for global variable 'ValueU32' [readability-identifier-naming]
333// CHECK-FIXES: {{^}}uint32_t u32ValueU32 = 0;
334
335uint64_t ValueU64 = 0;
336// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: invalid case style for global variable 'ValueU64' [readability-identifier-naming]
337// CHECK-FIXES: {{^}}uint64_t u64ValueU64 = 0;
338
339float ValueFloat = 0;
340// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for global variable 'ValueFloat' [readability-identifier-naming]
341// CHECK-FIXES: {{^}}float fValueFloat = 0;
342
343double ValueDouble = 0;
344// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for global variable 'ValueDouble' [readability-identifier-naming]
345// CHECK-FIXES: {{^}}double dValueDouble = 0;
346
347char ValueChar = 'c';
348// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global variable 'ValueChar' [readability-identifier-naming]
349// CHECK-FIXES: {{^}}char cValueChar = 'c';
350
351bool ValueBool = true;
352// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global variable 'ValueBool' [readability-identifier-naming]
353// CHECK-FIXES: {{^}}bool bValueBool = true;
354
355int ValueInt = 0;
356// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'ValueInt' [readability-identifier-naming]
357// CHECK-FIXES: {{^}}int iValueInt = 0;
358
359size_t ValueSize = 0;
360// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for global variable 'ValueSize' [readability-identifier-naming]
361// CHECK-FIXES: {{^}}size_t nValueSize = 0;
362
363wchar_t ValueWchar = 'w';
364// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for global variable 'ValueWchar' [readability-identifier-naming]
365// CHECK-FIXES: {{^}}wchar_t wcValueWchar = 'w';
366
367short ValueShort = 0;
368// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for global variable 'ValueShort' [readability-identifier-naming]
369// CHECK-FIXES: {{^}}short sValueShort = 0;
370
371unsigned ValueUnsigned = 0;
372// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: invalid case style for global variable 'ValueUnsigned' [readability-identifier-naming]
373// CHECK-FIXES: {{^}}unsigned uValueUnsigned = 0;
374
375signed ValueSigned = 0;
376// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for global variable 'ValueSigned' [readability-identifier-naming]
377// CHECK-FIXES: {{^}}signed sValueSigned = 0;
378
379long ValueLong = 0;
380// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global variable 'ValueLong' [readability-identifier-naming]
381// CHECK-FIXES: {{^}}long lValueLong = 0;
382
383long long ValueLongLong = 0;
384// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for global variable 'ValueLongLong' [readability-identifier-naming]
385// CHECK-FIXES: {{^}}long long llValueLongLong = 0;
386
387long long int ValueLongLongInt = 0;
388// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: invalid case style for global variable 'ValueLongLongInt' [readability-identifier-naming]
389// CHECK-FIXES: {{^}}long long int lliValueLongLongInt = 0;
390
391long double ValueLongDouble = 0;
392// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: invalid case style for global variable 'ValueLongDouble' [readability-identifier-naming]
393// CHECK-FIXES: {{^}}long double ldValueLongDouble = 0;
394
395signed int ValueSignedInt = 0;
396// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: invalid case style for global variable 'ValueSignedInt' [readability-identifier-naming]
397// CHECK-FIXES: {{^}}signed int siValueSignedInt = 0;
398
399signed short ValueSignedShort = 0;
400// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for global variable 'ValueSignedShort' [readability-identifier-naming]
401// CHECK-FIXES: {{^}}signed short ssValueSignedShort = 0;
402
403signed short int ValueSignedShortInt = 0;
404// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for global variable 'ValueSignedShortInt' [readability-identifier-naming]
405// CHECK-FIXES: {{^}}signed short int ssiValueSignedShortInt = 0;
406
407signed long long ValueSignedLongLong = 0;
408// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for global variable 'ValueSignedLongLong' [readability-identifier-naming]
409// CHECK-FIXES: {{^}}signed long long sllValueSignedLongLong = 0;
410
411signed long int ValueSignedLongInt = 0;
412// CHECK-MESSAGES: :[[@LINE-1]]:17: warning: invalid case style for global variable 'ValueSignedLongInt' [readability-identifier-naming]
413// CHECK-FIXES: {{^}}signed long int sliValueSignedLongInt = 0;
414
415signed long ValueSignedLong = 0;
416// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: invalid case style for global variable 'ValueSignedLong' [readability-identifier-naming]
417// CHECK-FIXES: {{^}}signed long slValueSignedLong = 0;
418
419unsigned long long int ValueUnsignedLongLongInt = 0;
420// CHECK-MESSAGES: :[[@LINE-1]]:24: warning: invalid case style for global variable 'ValueUnsignedLongLongInt' [readability-identifier-naming]
421// CHECK-FIXES: {{^}}unsigned long long int ulliValueUnsignedLongLongInt = 0;
422
423unsigned long long ValueUnsignedLongLong = 0;
424// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: invalid case style for global variable 'ValueUnsignedLongLong' [readability-identifier-naming]
425// CHECK-FIXES: {{^}}unsigned long long ullValueUnsignedLongLong = 0;
426
427unsigned long int ValueUnsignedLongInt = 0;
428// CHECK-MESSAGES: :[[@LINE-1]]:19: warning: invalid case style for global variable 'ValueUnsignedLongInt' [readability-identifier-naming]
429// CHECK-FIXES: {{^}}unsigned long int uliValueUnsignedLongInt = 0;
430
431unsigned long ValueUnsignedLong = 0;
432// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: invalid case style for global variable 'ValueUnsignedLong' [readability-identifier-naming]
433// CHECK-FIXES: {{^}}unsigned long ulValueUnsignedLong = 0;
434
435unsigned short int ValueUnsignedShortInt = 0;
436// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: invalid case style for global variable 'ValueUnsignedShortInt' [readability-identifier-naming]
437// CHECK-FIXES: {{^}}unsigned short int usiValueUnsignedShortInt = 0;
438
439unsigned short ValueUnsignedShort = 0;
440// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: invalid case style for global variable 'ValueUnsignedShort' [readability-identifier-naming]
441// CHECK-FIXES: {{^}}unsigned short usValueUnsignedShort = 0;
442
443unsigned int ValueUnsignedInt = 0;
444// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for global variable 'ValueUnsignedInt' [readability-identifier-naming]
445// CHECK-FIXES: {{^}}unsigned int uiValueUnsignedInt = 0;
446
447unsigned char ValueUnsignedChar = 0;
448// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: invalid case style for global variable 'ValueUnsignedChar' [readability-identifier-naming]
449// CHECK-FIXES: {{^}}unsigned char ucValueUnsignedChar = 0;
450
451long int ValueLongInt = 0;
452// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: invalid case style for global variable 'ValueLongInt' [readability-identifier-naming]
453// CHECK-FIXES: {{^}}long int liValueLongInt = 0;
454
455
456//===----------------------------------------------------------------------===//
457// Specifier, Qualifier, Other keywords
458//===----------------------------------------------------------------------===//
459volatile int VolatileInt = 0;
460// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for global variable 'VolatileInt' [readability-identifier-naming]
461// CHECK-FIXES: {{^}}volatile int iVolatileInt = 0;
462
463extern int ExternValueInt;
464// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: invalid case style for global variable 'ExternValueInt' [readability-identifier-naming]
465// CHECK-FIXES: {{^}}extern int iExternValueInt;
466
467//===----------------------------------------------------------------------===//
468// Redefined types
469//===----------------------------------------------------------------------===//
470typedef int INDEX;
471INDEX iIndex = 0;
472// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for global variable 'iIndex' [readability-identifier-naming]
473// CHECK-FIXES: {{^}}INDEX Index = 0;
474
475
476//===----------------------------------------------------------------------===//
477// Other Cases
478//===----------------------------------------------------------------------===//
479int lower_case = 0;
480// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'lower_case' [readability-identifier-naming]
481// CHECK-FIXES: {{^}}int iLowerCase = 0;
482
483int lower_case1 = 0;
484// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'lower_case1' [readability-identifier-naming]
485// CHECK-FIXES: {{^}}int iLowerCase1 = 0;
486
487int lower_case_2 = 0;
488// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'lower_case_2' [readability-identifier-naming]
489// CHECK-FIXES: {{^}}int iLowerCase2 = 0;
490
491int UPPER_CASE = 0;
492// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'UPPER_CASE' [readability-identifier-naming]
493// CHECK-FIXES: {{^}}int iUpperCase = 0;
494
495int UPPER_CASE_1 = 0;
496// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'UPPER_CASE_1' [readability-identifier-naming]
497// CHECK-FIXES: {{^}}int iUpperCase1 = 0;
498
499int camelBack = 0;
500// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'camelBack' [readability-identifier-naming]
501// CHECK-FIXES: {{^}}int iCamelBack = 0;
502
503int camelBack_1 = 0;
504// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'camelBack_1' [readability-identifier-naming]
505// CHECK-FIXES: {{^}}int iCamelBack1 = 0;
506
507int camelBack2 = 0;
508// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'camelBack2' [readability-identifier-naming]
509// CHECK-FIXES: {{^}}int iCamelBack2 = 0;
510
511int CamelCase = 0;
512// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'CamelCase' [readability-identifier-naming]
513// CHECK-FIXES: {{^}}int iCamelCase = 0;
514
515int CamelCase_1 = 0;
516// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'CamelCase_1' [readability-identifier-naming]
517// CHECK-FIXES: {{^}}int iCamelCase1 = 0;
518
519int CamelCase2 = 0;
520// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'CamelCase2' [readability-identifier-naming]
521// CHECK-FIXES: {{^}}int iCamelCase2 = 0;
522
523int camel_Snake_Back = 0;
524// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'camel_Snake_Back' [readability-identifier-naming]
525// CHECK-FIXES: {{^}}int iCamelSnakeBack = 0;
526
527int camel_Snake_Back_1 = 0;
528// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'camel_Snake_Back_1' [readability-identifier-naming]
529// CHECK-FIXES: {{^}}int iCamelSnakeBack1 = 0;
530
531int Camel_Snake_Case = 0;
532// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'Camel_Snake_Case' [readability-identifier-naming]
533// CHECK-FIXES: {{^}}int iCamelSnakeCase = 0;
534
535int Camel_Snake_Case_1 = 0;
536// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'Camel_Snake_Case_1' [readability-identifier-naming]
537// CHECK-FIXES: {{^}}int iCamelSnakeCase1 = 0;
538
539//===----------------------------------------------------------------------===//
540// Enum
541//===----------------------------------------------------------------------===//
542enum REV_TYPE { RevValid };
543// CHECK-MESSAGES: :[[@LINE-1]]:17: warning: invalid case style for enum constant 'RevValid' [readability-identifier-naming]
544// CHECK-FIXES: {{^}}enum REV_TYPE { rtRevValid };
545
546enum EnumConstantCase { OneByte, TwoByte };
547// CHECK-MESSAGES: :[[@LINE-1]]:25: warning: invalid case style for enum constant 'OneByte' [readability-identifier-naming]
548// CHECK-MESSAGES: :[[@LINE-2]]:34: warning: invalid case style for enum constant 'TwoByte' [readability-identifier-naming]
549// CHECK-FIXES: {{^}}enum EnumConstantCase { eccOneByte, eccTwoByte };
550

source code of clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-c-language.c