Skip to content

Commit fb4a2ec

Browse files
committed
Fix test formatting
1 parent cae9e29 commit fb4a2ec

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

  • cpp
    • common/test/rules/nullptrnottheonlyformofthenullpointerconstant
    • misra/test/rules/RULE-7-0-6

cpp/common/test/rules/nullptrnottheonlyformofthenullpointerconstant/test.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ void test_nullptr() {
1515
int l3 = 0; // COMPLIANT - use of 0 literal with no conversion to pointer
1616
f3(f1, nullptr); // COMPLIANT - use of nullptr
1717
f1(NULL); // NON_COMPLIANT - use of NULL macro
18-
// f1('\0'); // NON_COMPLIANT - use of octal escape 0 - Not accepted by clang or by CodeQL when mimicking clang
19-
f3("0"); // COMPLIANT - "0" is not a literal zero
18+
// f1('\0'); // NON_COMPLIANT - use of octal escape 0 - Not accepted by
19+
// clang or by CodeQL when mimicking clang
20+
f3("0"); // COMPLIANT - "0" is not a literal zero
2021
}

cpp/misra/test/rules/RULE-7-0-6/test.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,12 @@ void test_template_functions() {
368368

369369
// Test initialization forms
370370
std::int32_t f12(std::int8_t l1) {
371-
std::int16_t l2 = l1; // COMPLIANT
372-
std::int16_t l3{l1}; // COMPLIANT
373-
std::int16_t l4(l1); // COMPLIANT
374-
// std::int16_t l5{l1 + l1}; // NON_COMPLIANT - Not accepted by clang or by CodeQL when mimicking clang
375-
return l1; // COMPLIANT
371+
std::int16_t l2 = l1; // COMPLIANT
372+
std::int16_t l3{l1}; // COMPLIANT
373+
std::int16_t l4(l1); // COMPLIANT
374+
// std::int16_t l5{l1 + l1}; // NON_COMPLIANT - Not accepted by clang or by
375+
// CodeQL when mimicking clang
376+
return l1; // COMPLIANT
376377
}
377378

378379
std::int32_t test_return() {

0 commit comments

Comments
 (0)