Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / third_party / nlfaultinjection / repo / third_party / cstyle / repo / tests / missing-space-after-comma.cpp
1 #include <inttypes.h>
2 #include <stdint.h>
3
4 // Comments should not generate violations
5
6 // This comment,a single line comment,is missing a space after its commas.
7
8 // Single-quoted commas should not generate a violation
9
10 static char comma_char_1 = ',';
11
12 // Double-quoted commas should not generate a violation
13
14 static const char * const comma_string_1 = ",";
15 static const char * const comma_string_2 = "tag,value";
16 static const char * const comma_string_3 = "\"tag\",\"value\"";
17 static const char * const comma_string_4 = "'tag','value'";
18 static const char * const comma_string_5 = "size=\"17,11\"";
19
20 // Single-quoted escaped single quotes with commas should not generate a violation
21
22 static wchar_t charsets[] =
23     {
24         L'\'', L'<', L'>', L'?', L',', L'.',  L'/',  L'`', L'Ä', L'Ö', L'Ü', L'Ç', L'Ñ', L'É', L'À', L'Å', L'Æ', L'~'
25     };
26
27 /*
28  * This comment,a multi- line comment,
29  * is missing a space after its commas.
30  * However, only the one that is not at the
31  * end of the line should be flagged.
32  */
33
34 static int array_1[] = {0,1,2,3,4,5};   // These should generate a violation
35 static int array_2[] = {0,              // End of line, these should not 
36                         1,              // generate a violation.
37                         2,
38                         3,
39                         4,
40                         5};
41
42 extern void foo(void);
43
44 void test_1(int m, int n)
45 {
46     for (int i = 0,j = 0; i < m && j < n; i++,j++) {
47         foo();
48     }
49 }
50
51 class test_2
52 {
53 public:
54     test_2(void) : m_a(0),m_b(0) { return; }
55     test_2(int a, int b) :
56         m_a(a),
57         m_b(b)
58     {
59         return;
60     }
61
62 private:
63     int m_a;
64     int m_b;
65 };