Skip to content

Commit 4a98c70

Browse files
Fix XID_Continue tests that weren't NFC form
1 parent 787d33a commit 4a98c70

File tree

2 files changed

+56
-54
lines changed

2 files changed

+56
-54
lines changed

cpp/misra/test/rules/RULE-5-10-1/PoorlyFormedIdentifier.expected

Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,50 @@
22
| test.cpp:9:7:9:14 | \\u203finvalid | Identifier '\u203finvalid' has non-UAX44 codepoint at index 0: '8255'. |
33
| test.cpp:10:7:10:12 | \\u2070start | Identifier '\u2070start' has non-UAX44 codepoint at index 0: '8304'. |
44
| test.cpp:23:7:23:17 | var\\u207ainvalid | Identifier 'var\u207ainvalid' has non-UAX44 codepoint at index 3: '8314'. |
5-
| test.cpp:24:7:24:10 | var\\u0303 | Identifier 'var\u0303' has non-NFC normalized codepoint at index 3 with NFC_QC value 'M'. |
6-
| test.cpp:40:7:40:12 | cafe\\u03012 | Identifier 'cafe\u03012' has non-NFC normalized codepoint at index 4 with NFC_QC value 'M'. |
7-
| test.cpp:42:7:42:13 | nai\\u0308ve2 | Identifier 'nai\u0308ve2' has non-NFC normalized codepoint at index 3 with NFC_QC value 'M'. |
8-
| test.cpp:44:7:44:15 | re\\u0301sume\\u03012 | Identifier 're\u0301sume\u03012' has non-NFC normalized codepoint at index 2 with NFC_QC value 'M'. |
9-
| test.cpp:44:7:44:15 | re\\u0301sume\\u03012 | Identifier 're\u0301sume\u03012' has non-NFC normalized codepoint at index 7 with NFC_QC value 'M'. |
10-
| test.cpp:50:7:50:15 | __invalid | Identifier '__invalid' contains double underscores. |
11-
| test.cpp:50:7:50:15 | __invalid | Identifier '__invalid' starts with underscore. |
12-
| test.cpp:51:7:51:13 | val__id | Identifier 'val__id' contains double underscores. |
13-
| test.cpp:52:7:52:13 | __end__ | Identifier '__end__' contains double underscores. |
14-
| test.cpp:52:7:52:13 | __end__ | Identifier '__end__' starts with underscore. |
15-
| test.cpp:57:7:57:12 | _local | Identifier '_local' starts with underscore. |
16-
| test.cpp:68:15:68:28 | mil | User-defined literal suffix 'mil' does not start with underscore. |
17-
| test.cpp:80:15:80:37 | _micrometer | User-defined literal suffix '_micrometer' is reserved due to leading underscore and space. |
18-
| test.cpp:84:15:84:36 | _picometer | User-defined literal suffix '_picometer' is reserved due to leading underscore and space. |
19-
| test.cpp:87:15:87:34 | angstrom | User-defined literal suffix 'angstrom' does not start with underscore. |
20-
| test.cpp:109:1:109:24 | invalid_macro | Identifier 'invalid_macro' contains lowercase characters. |
21-
| test.cpp:110:1:110:21 | Mixed_Case | Identifier 'Mixed_Case' contains lowercase characters. |
22-
| test.cpp:112:1:112:27 | MACRO_with_lower | Identifier 'MACRO_with_lower' contains lowercase characters. |
23-
| test.cpp:113:1:113:26 | MACRO_123_lower | Identifier 'MACRO_123_lower' contains lowercase characters. |
24-
| test.cpp:114:1:114:25 | macro_ALL_CAPS | Identifier 'macro_ALL_CAPS' contains lowercase characters. |
25-
| test.cpp:115:1:115:23 | MACRO$DOLLAR | Identifier 'MACRO$DOLLAR' contains invalid characters. |
26-
| test.cpp:116:1:117:11 | x | Identifier 'x' contains lowercase characters. |
27-
| test.cpp:121:1:121:38 | __Y | Identifier '__Y' contains double underscores. |
28-
| test.cpp:121:1:121:38 | __Y | Identifier '__Y' starts with underscore. |
29-
| test.cpp:125:5:125:6 | l1 | Identifier 'l1' is defined in reserved namespace. |
30-
| test.cpp:134:5:134:6 | l2 | Identifier 'l2' is defined in reserved namespace. |
31-
| test.cpp:138:5:138:6 | l3 | Identifier 'l3' is defined in reserved namespace. |
32-
| test.cpp:142:5:142:6 | l4 | Identifier 'l4' is defined in reserved namespace. |
33-
| test.cpp:147:5:147:6 | l5 | Identifier 'l5' is defined in reserved namespace. |
34-
| test.cpp:165:7:165:11 | final | Identifier 'final' is a reserved name. |
35-
| test.cpp:166:7:166:14 | override | Identifier 'override' is a reserved name. |
36-
| test.cpp:167:7:167:13 | defined | Identifier 'defined' is a reserved name. |
37-
| test.cpp:168:7:168:12 | size_t | Identifier 'size_t' is a reserved name. |
38-
| test.cpp:169:7:169:10 | FILE | Identifier 'FILE' is a reserved name. |
39-
| test.cpp:170:7:170:12 | time_t | Identifier 'time_t' is a reserved name. |
40-
| test.cpp:171:7:171:15 | ptrdiff_t | Identifier 'ptrdiff_t' is a reserved name. |
41-
| test.cpp:172:7:172:13 | clock_t | Identifier 'clock_t' is a reserved name. |
42-
| test.cpp:173:7:173:11 | div_t | Identifier 'div_t' is a reserved name. |
43-
| test.cpp:174:7:174:12 | fpos_t | Identifier 'fpos_t' is a reserved name. |
44-
| test.cpp:175:7:175:11 | lconv | Identifier 'lconv' is a reserved name. |
45-
| test.cpp:176:7:176:12 | ldiv_t | Identifier 'ldiv_t' is a reserved name. |
46-
| test.cpp:177:7:177:15 | mbstate_t | Identifier 'mbstate_t' is a reserved name. |
47-
| test.cpp:178:7:178:18 | sig_atomic_t | Identifier 'sig_atomic_t' is a reserved name. |
48-
| test.cpp:179:7:179:8 | tm | Identifier 'tm' is a reserved name. |
49-
| test.cpp:180:7:180:13 | va_list | Identifier 'va_list' is a reserved name. |
50-
| test.cpp:181:7:181:15 | wctrans_t | Identifier 'wctrans_t' is a reserved name. |
51-
| test.cpp:182:7:182:14 | wctype_t | Identifier 'wctype_t' is a reserved name. |
52-
| test.cpp:183:7:183:12 | wint_t | Identifier 'wint_t' is a reserved name. |
5+
| test.cpp:43:7:43:12 | cafe\\u03012 | Identifier 'cafe\u03012' has non-NFC normalized codepoint at index 4 with NFC_QC value 'M'. |
6+
| test.cpp:45:7:45:13 | nai\\u0308ve2 | Identifier 'nai\u0308ve2' has non-NFC normalized codepoint at index 3 with NFC_QC value 'M'. |
7+
| test.cpp:47:7:47:15 | re\\u0301sume\\u03012 | Identifier 're\u0301sume\u03012' has non-NFC normalized codepoint at index 2 with NFC_QC value 'M'. |
8+
| test.cpp:47:7:47:15 | re\\u0301sume\\u03012 | Identifier 're\u0301sume\u03012' has non-NFC normalized codepoint at index 7 with NFC_QC value 'M'. |
9+
| test.cpp:53:7:53:15 | __invalid | Identifier '__invalid' contains double underscores. |
10+
| test.cpp:53:7:53:15 | __invalid | Identifier '__invalid' starts with underscore. |
11+
| test.cpp:54:7:54:13 | val__id | Identifier 'val__id' contains double underscores. |
12+
| test.cpp:55:7:55:13 | __end__ | Identifier '__end__' contains double underscores. |
13+
| test.cpp:55:7:55:13 | __end__ | Identifier '__end__' starts with underscore. |
14+
| test.cpp:60:7:60:12 | _local | Identifier '_local' starts with underscore. |
15+
| test.cpp:71:15:71:28 | mil | User-defined literal suffix 'mil' does not start with underscore. |
16+
| test.cpp:83:15:83:37 | _micrometer | User-defined literal suffix '_micrometer' is reserved due to leading underscore and space. |
17+
| test.cpp:87:15:87:36 | _picometer | User-defined literal suffix '_picometer' is reserved due to leading underscore and space. |
18+
| test.cpp:90:15:90:34 | angstrom | User-defined literal suffix 'angstrom' does not start with underscore. |
19+
| test.cpp:112:1:112:24 | invalid_macro | Identifier 'invalid_macro' contains lowercase characters. |
20+
| test.cpp:113:1:113:21 | Mixed_Case | Identifier 'Mixed_Case' contains lowercase characters. |
21+
| test.cpp:115:1:115:27 | MACRO_with_lower | Identifier 'MACRO_with_lower' contains lowercase characters. |
22+
| test.cpp:116:1:116:26 | MACRO_123_lower | Identifier 'MACRO_123_lower' contains lowercase characters. |
23+
| test.cpp:117:1:117:25 | macro_ALL_CAPS | Identifier 'macro_ALL_CAPS' contains lowercase characters. |
24+
| test.cpp:118:1:118:23 | MACRO$DOLLAR | Identifier 'MACRO$DOLLAR' contains invalid characters. |
25+
| test.cpp:119:1:120:11 | x | Identifier 'x' contains lowercase characters. |
26+
| test.cpp:124:1:124:38 | __Y | Identifier '__Y' contains double underscores. |
27+
| test.cpp:124:1:124:38 | __Y | Identifier '__Y' starts with underscore. |
28+
| test.cpp:128:5:128:6 | l1 | Identifier 'l1' is defined in reserved namespace. |
29+
| test.cpp:137:5:137:6 | l2 | Identifier 'l2' is defined in reserved namespace. |
30+
| test.cpp:141:5:141:6 | l3 | Identifier 'l3' is defined in reserved namespace. |
31+
| test.cpp:145:5:145:6 | l4 | Identifier 'l4' is defined in reserved namespace. |
32+
| test.cpp:150:5:150:6 | l5 | Identifier 'l5' is defined in reserved namespace. |
33+
| test.cpp:168:7:168:11 | final | Identifier 'final' is a reserved name. |
34+
| test.cpp:169:7:169:14 | override | Identifier 'override' is a reserved name. |
35+
| test.cpp:170:7:170:13 | defined | Identifier 'defined' is a reserved name. |
36+
| test.cpp:171:7:171:12 | size_t | Identifier 'size_t' is a reserved name. |
37+
| test.cpp:172:7:172:10 | FILE | Identifier 'FILE' is a reserved name. |
38+
| test.cpp:173:7:173:12 | time_t | Identifier 'time_t' is a reserved name. |
39+
| test.cpp:174:7:174:15 | ptrdiff_t | Identifier 'ptrdiff_t' is a reserved name. |
40+
| test.cpp:175:7:175:13 | clock_t | Identifier 'clock_t' is a reserved name. |
41+
| test.cpp:176:7:176:11 | div_t | Identifier 'div_t' is a reserved name. |
42+
| test.cpp:177:7:177:12 | fpos_t | Identifier 'fpos_t' is a reserved name. |
43+
| test.cpp:178:7:178:11 | lconv | Identifier 'lconv' is a reserved name. |
44+
| test.cpp:179:7:179:12 | ldiv_t | Identifier 'ldiv_t' is a reserved name. |
45+
| test.cpp:180:7:180:15 | mbstate_t | Identifier 'mbstate_t' is a reserved name. |
46+
| test.cpp:181:7:181:18 | sig_atomic_t | Identifier 'sig_atomic_t' is a reserved name. |
47+
| test.cpp:182:7:182:8 | tm | Identifier 'tm' is a reserved name. |
48+
| test.cpp:183:7:183:13 | va_list | Identifier 'va_list' is a reserved name. |
49+
| test.cpp:184:7:184:15 | wctrans_t | Identifier 'wctrans_t' is a reserved name. |
50+
| test.cpp:185:7:185:14 | wctype_t | Identifier 'wctype_t' is a reserved name. |
51+
| test.cpp:186:7:186:12 | wint_t | Identifier 'wint_t' is a reserved name. |

cpp/misra/test/rules/RULE-5-10-1/test.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,22 @@ void test_universal_character_continue() {
2121
int varα = 2; // COMPLIANT - XID_Continue character
2222
int var_γ = 3; // COMPLIANT - underscore and XID_Continue
2323
int var⁺invalid = 5; // NON_COMPLIANT - U+207A not in XID_Continue class
24-
int var̃ = 6; // COMPLIANT - combining tilde, XID_Continue but not XID_Start
25-
int var‿conn = 7; // COMPLIANT - connector punctuation, XID_Continue
26-
int var9 = 8; // COMPLIANT - decimal number, XID_Continue
24+
int var̅ = 6; // COMPLIANT - combining overline, XID_Continue but not
25+
// XID_Start, NFC form
26+
int var‿conn = 7; // COMPLIANT - connector punctuation, XID_Continue
27+
int var9 = 8; // COMPLIANT - decimal number, XID_Continue
2728
int varً = 9; // COMPLIANT - Arabic fathatan, XID_Continue but not XID_Start
2829
int var֪ = 10; // COMPLIANT - Hebrew point, XID_Continue but not XID_Start
2930
}
3031

3132
// Test case for Normalization Form C compliance - separate functions to avoid
3233
// redefinition
3334
void test_normalization_form_c_nfc() {
34-
int café1 = 1; // COMPLIANT - NFC form (precomposed)
35-
int naïve1 = 2; // COMPLIANT - NFC form (precomposed)
36-
int résumé1 = 3; // COMPLIANT - NFC form (precomposed)
35+
int café1 = 1; // COMPLIANT - NFC form (precomposed)
36+
int naïve1 = 2; // COMPLIANT - NFC form (precomposed)
37+
int résumé1 = 3; // COMPLIANT - NFC form (precomposed)
38+
int no̠tpre̕comp̐os̎ed̍ = 3; // COMPLIANT - NFC form (combining marks that
39+
// cannot be precomposed)
3740
}
3841

3942
void test_normalization_form_c_nfd() {

0 commit comments

Comments
 (0)