Skip to content

Commit 6c24820

Browse files
committed
Fix ll suffixes on tests
1 parent b05afca commit 6c24820

File tree

4 files changed

+64
-64
lines changed

4 files changed

+64
-64
lines changed

c/misra/test/rules/RULE-7-2/UOrUSuffixRepresentedInUnsignedType.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
| test.c:232:3:232:25 | 9223372036854775808 | Unsigned literal 01000000000000000000000 does not explicitly express sign with a 'U' or 'u' suffix. |
99
| test.c:249:3:249:26 | 9223372036854775808 | Unsigned literal 01000000000000000000000l does not explicitly express sign with a 'U' or 'u' suffix. |
1010
| test.c:266:3:266:26 | 9223372036854775808 | Unsigned literal 01000000000000000000000L does not explicitly express sign with a 'U' or 'u' suffix. |
11-
| test.c:283:3:283:26 | 9223372036854775808 | Unsigned literal 01000000000000000000000l does not explicitly express sign with a 'U' or 'u' suffix. |
12-
| test.c:300:3:300:26 | 9223372036854775808 | Unsigned literal 01000000000000000000000L does not explicitly express sign with a 'U' or 'u' suffix. |
11+
| test.c:283:3:283:27 | 9223372036854775808 | Unsigned literal 01000000000000000000000ll does not explicitly express sign with a 'U' or 'u' suffix. |
12+
| test.c:300:3:300:27 | 9223372036854775808 | Unsigned literal 01000000000000000000000LL does not explicitly express sign with a 'U' or 'u' suffix. |

c/misra/test/rules/RULE-7-2/test.c

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -275,38 +275,38 @@ void test_octal_constants() {
275275
// correctly
276276

277277
// Use of the `ll` suffix
278-
00ll; // COMPLIANT - uses signed long long
279-
017777777777l; // COMPLIANT - uses signed long long
280-
020000000000l; // COMPLIANT - uses signed long long
281-
040000000000l; // COMPLIANT - uses signed long long
282-
0777777777777777777777l; // COMPLIANT - max long int
283-
01000000000000000000000l; // NON_COMPLIANT - larger than long int, so will be
284-
// unsigned long int
285-
00Ul; // COMPLIANT - unsigned, but uses the suffix correctly
286-
017777777777Ul; // COMPLIANT - unsigned, but uses the suffix correctly
287-
020000000000Ul; // COMPLIANT - unsigned, but uses the suffix correctly
288-
040000000000Ul; // COMPLIANT - unsigned, but uses the suffix correctly
289-
0777777777777777777777Ul; // COMPLIANT - unsigned, but uses the suffix
290-
// correctly
291-
01000000000000000000000Ul; // COMPLIANT - unsigned, but uses the suffix
292-
// correctly
278+
00ll; // COMPLIANT - uses signed long long
279+
017777777777ll; // COMPLIANT - uses signed long long
280+
020000000000ll; // COMPLIANT - uses signed long long
281+
040000000000ll; // COMPLIANT - uses signed long long
282+
0777777777777777777777ll; // COMPLIANT - max long int
283+
01000000000000000000000ll; // NON_COMPLIANT - larger than long int, so will be
284+
// unsigned long int
285+
00Ull; // COMPLIANT - unsigned, but uses the suffix correctly
286+
017777777777Ull; // COMPLIANT - unsigned, but uses the suffix correctly
287+
020000000000Ull; // COMPLIANT - unsigned, but uses the suffix correctly
288+
040000000000Ull; // COMPLIANT - unsigned, but uses the suffix correctly
289+
0777777777777777777777Ull; // COMPLIANT - unsigned, but uses the suffix
290+
// correctly
291+
01000000000000000000000Ull; // COMPLIANT - unsigned, but uses the suffix
292+
// correctly
293293

294294
// Use of the `LL` suffix
295-
00L; // COMPLIANT - uses signed long long
296-
017777777777L; // COMPLIANT - uses signed long long
297-
020000000000L; // COMPLIANT - uses signed long long
298-
040000000000L; // COMPLIANT - uses signed long long
299-
0777777777777777777777L; // COMPLIANT - max long int
300-
01000000000000000000000L; // NON_COMPLIANT - larger than long int, so will be
301-
// unsigned long int
302-
00UL; // COMPLIANT - unsigned, but uses the suffix correctly
303-
017777777777UL; // COMPLIANT - unsigned, but uses the suffix correctly
304-
020000000000UL; // COMPLIANT - unsigned, but uses the suffix correctly
305-
040000000000UL; // COMPLIANT - unsigned, but uses the suffix correctly
306-
0777777777777777777777UL; // COMPLIANT - unsigned, but uses the suffix
307-
// correctly
308-
01000000000000000000000UL; // COMPLIANT - unsigned, but uses the suffix
309-
// correctly
295+
00LL; // COMPLIANT - uses signed long long
296+
017777777777LL; // COMPLIANT - uses signed long long
297+
020000000000LL; // COMPLIANT - uses signed long long
298+
040000000000LL; // COMPLIANT - uses signed long long
299+
0777777777777777777777LL; // COMPLIANT - max long int
300+
01000000000000000000000LL; // NON_COMPLIANT - larger than long int, so will be
301+
// unsigned long int
302+
00ULL; // COMPLIANT - unsigned, but uses the suffix correctly
303+
017777777777ULL; // COMPLIANT - unsigned, but uses the suffix correctly
304+
020000000000ULL; // COMPLIANT - unsigned, but uses the suffix correctly
305+
040000000000ULL; // COMPLIANT - unsigned, but uses the suffix correctly
306+
0777777777777777777777ULL; // COMPLIANT - unsigned, but uses the suffix
307+
// correctly
308+
01000000000000000000000ULL; // COMPLIANT - unsigned, but uses the suffix
309+
// correctly
310310
}
311311

312312
#define COMPLIANT_VAL 0x80000000U

cpp/common/test/rules/unsignedintegerliteralsnotappropriatelysuffixed/UnsignedIntegerLiteralsNotAppropriatelySuffixed.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
| test.cpp:232:3:232:25 | 9223372036854775808 | Octal literal is an unsigned integer but does not include a 'U' suffix. |
99
| test.cpp:249:3:249:26 | 9223372036854775808 | Octal literal is an unsigned integer but does not include a 'U' suffix. |
1010
| test.cpp:266:3:266:26 | 9223372036854775808 | Octal literal is an unsigned integer but does not include a 'U' suffix. |
11-
| test.cpp:283:3:283:26 | 9223372036854775808 | Octal literal is an unsigned integer but does not include a 'U' suffix. |
12-
| test.cpp:300:3:300:26 | 9223372036854775808 | Octal literal is an unsigned integer but does not include a 'U' suffix. |
11+
| test.cpp:283:3:283:27 | 9223372036854775808 | Octal literal is an unsigned integer but does not include a 'U' suffix. |
12+
| test.cpp:300:3:300:27 | 9223372036854775808 | Octal literal is an unsigned integer but does not include a 'U' suffix. |

cpp/common/test/rules/unsignedintegerliteralsnotappropriatelysuffixed/test.cpp

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -275,38 +275,38 @@ void test_octal_constants() {
275275
// correctly
276276

277277
// Use of the `ll` suffix
278-
00ll; // COMPLIANT - uses signed long long
279-
017777777777l; // COMPLIANT - uses signed long long
280-
020000000000l; // COMPLIANT - uses signed long long
281-
040000000000l; // COMPLIANT - uses signed long long
282-
0777777777777777777777l; // COMPLIANT - max long int
283-
01000000000000000000000l; // NON_COMPLIANT - larger than long int, so will be
284-
// unsigned long int
285-
00Ul; // COMPLIANT - unsigned, but uses the suffix correctly
286-
017777777777Ul; // COMPLIANT - unsigned, but uses the suffix correctly
287-
020000000000Ul; // COMPLIANT - unsigned, but uses the suffix correctly
288-
040000000000Ul; // COMPLIANT - unsigned, but uses the suffix correctly
289-
0777777777777777777777Ul; // COMPLIANT - unsigned, but uses the suffix
290-
// correctly
291-
01000000000000000000000Ul; // COMPLIANT - unsigned, but uses the suffix
292-
// correctly
278+
00ll; // COMPLIANT - uses signed long long
279+
017777777777ll; // COMPLIANT - uses signed long long
280+
020000000000ll; // COMPLIANT - uses signed long long
281+
040000000000ll; // COMPLIANT - uses signed long long
282+
0777777777777777777777ll; // COMPLIANT - max long int
283+
01000000000000000000000ll; // NON_COMPLIANT - larger than long int, so will be
284+
// unsigned long int
285+
00Ull; // COMPLIANT - unsigned, but uses the suffix correctly
286+
017777777777Ull; // COMPLIANT - unsigned, but uses the suffix correctly
287+
020000000000Ull; // COMPLIANT - unsigned, but uses the suffix correctly
288+
040000000000Ull; // COMPLIANT - unsigned, but uses the suffix correctly
289+
0777777777777777777777Ull; // COMPLIANT - unsigned, but uses the suffix
290+
// correctly
291+
01000000000000000000000Ull; // COMPLIANT - unsigned, but uses the suffix
292+
// correctly
293293

294294
// Use of the `LL` suffix
295-
00L; // COMPLIANT - uses signed long long
296-
017777777777L; // COMPLIANT - uses signed long long
297-
020000000000L; // COMPLIANT - uses signed long long
298-
040000000000L; // COMPLIANT - uses signed long long
299-
0777777777777777777777L; // COMPLIANT - max long int
300-
01000000000000000000000L; // NON_COMPLIANT - larger than long int, so will be
301-
// unsigned long int
302-
00UL; // COMPLIANT - unsigned, but uses the suffix correctly
303-
017777777777UL; // COMPLIANT - unsigned, but uses the suffix correctly
304-
020000000000UL; // COMPLIANT - unsigned, but uses the suffix correctly
305-
040000000000UL; // COMPLIANT - unsigned, but uses the suffix correctly
306-
0777777777777777777777UL; // COMPLIANT - unsigned, but uses the suffix
307-
// correctly
308-
01000000000000000000000UL; // COMPLIANT - unsigned, but uses the suffix
309-
// correctly
295+
00LL; // COMPLIANT - uses signed long long
296+
017777777777LL; // COMPLIANT - uses signed long long
297+
020000000000LL; // COMPLIANT - uses signed long long
298+
040000000000LL; // COMPLIANT - uses signed long long
299+
0777777777777777777777LL; // COMPLIANT - max long int
300+
01000000000000000000000LL; // NON_COMPLIANT - larger than long int, so will be
301+
// unsigned long int
302+
00ULL; // COMPLIANT - unsigned, but uses the suffix correctly
303+
017777777777ULL; // COMPLIANT - unsigned, but uses the suffix correctly
304+
020000000000ULL; // COMPLIANT - unsigned, but uses the suffix correctly
305+
040000000000ULL; // COMPLIANT - unsigned, but uses the suffix correctly
306+
0777777777777777777777ULL; // COMPLIANT - unsigned, but uses the suffix
307+
// correctly
308+
01000000000000000000000ULL; // COMPLIANT - unsigned, but uses the suffix
309+
// correctly
310310
}
311311

312312
#define COMPLIANT_VAL 0x80000000U

0 commit comments

Comments
 (0)