Skip to content

Commit df1a5f2

Browse files
Format cpp tests
1 parent 4b0b74e commit df1a5f2

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

cpp/common/test/rules/shortcircuitedpersistentsideeffectshared/ShortCircuitedPersistentSideEffectShared.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
| test.cpp:26:7:26:15 | ... \|\| ... | The $@ may have a side effect that is not always evaluated. | test.cpp:26:12:26:13 | call to f1 | right-hand operand |
44
| test.cpp:29:7:29:16 | ... \|\| ... | The $@ may have a side effect that is not always evaluated. | test.cpp:29:12:29:13 | call to f3 | right-hand operand |
55
| test.cpp:45:7:45:41 | ... \|\| ... | The $@ may have a side effect that is not always evaluated. | test.cpp:45:26:45:26 | call to operator== | right-hand operand |
6-
| test.cpp:56:9:56:17 | ... \|\| ... | The $@ may have a side effect that is not always evaluated. | test.cpp:56:14:56:15 | call to f8 | right-hand operand |
7-
| test.cpp:66:9:66:18 | ... \|\| ... | The $@ may have a side effect that is not always evaluated. | test.cpp:66:14:66:16 | call to f10 | right-hand operand |
6+
| test.cpp:56:7:56:15 | ... \|\| ... | The $@ may have a side effect that is not always evaluated. | test.cpp:56:12:56:13 | call to f8 | right-hand operand |
7+
| test.cpp:66:7:66:16 | ... \|\| ... | The $@ may have a side effect that is not always evaluated. | test.cpp:66:12:66:14 | call to f10 | right-hand operand |

cpp/common/test/rules/shortcircuitedpersistentsideeffectshared/test.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ bool f2() {
1111
}
1212

1313
bool f3(int &i) {
14-
i++;
15-
return i == 1;
14+
i++;
15+
return i == 1;
1616
}
1717

1818
void f4(bool b) {
@@ -39,30 +39,30 @@ int f6() { return 1; }
3939
void f7() {
4040
if (1 && sizeof(f5())) {
4141
} // COMPLIANT - sizeof operands not evaluated
42-
if (1 &&noexcept(f5()) &&noexcept(f5())) {
42+
if (1 && noexcept(f5()) && noexcept(f5())) {
4343
} // COMPLIANT - noexcept operands not evaluated
4444

4545
if (1 || (typeid(f6()) == typeid(f5()))) {
4646
} // NON_COMPLIANT - typeid operands not evaluated, but the ==operator is
4747
}
4848

4949
bool f8() {
50-
static int k = 0;
51-
k++;
52-
return k == 1;
50+
static int k = 0;
51+
k++;
52+
return k == 1;
5353
}
5454

5555
void f9(bool b) {
56-
if (b || f8()) { // NON_COMPLIANT, f8 has static side-effects
57-
}
56+
if (b || f8()) { // NON_COMPLIANT, f8 has static side-effects
57+
}
5858
}
5959

6060
bool f10() {
61-
volatile bool m = 0;
62-
return m;
61+
volatile bool m = 0;
62+
return m;
6363
}
6464

6565
void f11(bool b) {
66-
if (b || f10()) { // NON_COMPLIANT, f10 has volatile side-effects
67-
}
66+
if (b || f10()) { // NON_COMPLIANT, f10 has volatile side-effects
67+
}
6868
}

0 commit comments

Comments
 (0)