Skip to content

Commit 0656a18

Browse files
authored
Reformat test files with clang-format v14
1 parent f9a2c5e commit 0656a18

File tree

12 files changed

+93
-49
lines changed

12 files changed

+93
-49
lines changed

cpp/autosar/test/rules/A5-1-9/test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@ void test_noncompliant() {
8686
#include <string>
8787
class Test_issue468 {
8888
public:
89-
template <typename... As> static void LogInfo(const As &... rest) {
89+
template <typename... As> static void LogInfo(const As &...rest) {
9090
[](const std::string &s) -> void { LogInfo(s); }; // COMPLIANT
9191
}
92-
template <typename... As> static void LogWarn(const As &... rest) {
92+
template <typename... As> static void LogWarn(const As &...rest) {
9393
[](const std::string &s) -> void { LogWarn(s); }; // COMPLIANT
9494
}
95-
template <typename... As> static void LogError(const As &... rest) {
95+
template <typename... As> static void LogError(const As &...rest) {
9696
[](const std::string &s) -> void { LogError(s); }; // NON_COMPLIANT
9797
}
98-
template <typename... As> static void LogFatal(const As &... rest) {
98+
template <typename... As> static void LogFatal(const As &...rest) {
9999
[](const std::string &s) -> void { LogError(s); }; // NON_COMPLIANT
100100
}
101101
void instantiate() {

cpp/autosar/test/rules/A5-2-2/test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ void test_cpp_style_cast() {
4545
class A5_2_2a {
4646
public:
4747
template <typename... As>
48-
static void Foo(const std::string &name, As &&... rest) {
48+
static void Foo(const std::string &name, As &&...rest) {
4949
Fun(Log(
5050
std::forward<As>(rest)...)); // COMPLIANT - reported as a false positive
5151
}
5252

53-
template <typename... As> static std::string Log(As &&... tail) {
53+
template <typename... As> static std::string Log(As &&...tail) {
5454
return std::string();
5555
}
5656

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
| test.cpp:1:6:1:6 | C | Base type of enumeration is not explicitly specified. |
2-
| test.cpp:3:12:3:12 | A | Base type of enumeration is not explicitly specified. |
2+
| test.cpp:5:12:5:12 | A | Base type of enumeration is not explicitly specified. |
Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
enum C // NON_COMPLIANT
2-
{ c1 };
2+
{
3+
c1
4+
};
35
enum class A // NON_COMPLIANT
4-
{ a1 };
6+
{
7+
a1
8+
};
59
enum class B : int // COMPLIANT
6-
{ b1 };
10+
{
11+
b1
12+
};
713
enum D : int // COMPLIANT
8-
{ d1 };
14+
{
15+
d1
16+
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
| test.cpp:1:6:1:6 | C | Enum C is not a scoped enum. |
2-
| test.cpp:11:6:11:6 | D | Enum D is not a scoped enum. |
2+
| test.cpp:21:6:21:6 | D | Enum D is not a scoped enum. |
Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
enum C // NON_COMPLIANT
2-
{ c1 };
2+
{
3+
c1
4+
};
35
enum class A // COMPLIANT - Violates a different rule (A7-2-2)
4-
{ a1 };
6+
{
7+
a1
8+
};
59
enum struct A1 // COMPLIANT - Violates a different rule (A7-2-2)
6-
{ a12 };
10+
{
11+
a12
12+
};
713
enum class B : int // COMPLIANT
8-
{ b1 };
14+
{
15+
b1
16+
};
917
enum struct B1 : int // COMPLIANT
10-
{ b12 };
18+
{
19+
b12
20+
};
1121
enum D : int // NON_COMPLIANT
12-
{ d1 };
22+
{
23+
d1
24+
};
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
| test.cpp:9:12:9:13 | A2 | Neither none, the first, or all enumerated constants are initialized in this enumeration. |
2-
| test.cpp:33:14:33:15 | B3 | Neither none, the first, or all enumerated constants are initialized in this enumeration. |
3-
| test.cpp:45:6:45:6 | D | Neither none, the first, or all enumerated constants are initialized in this enumeration. |
4-
| test.cpp:53:6:53:7 | E1 | Neither none, the first, or all enumerated constants are initialized in this enumeration. |
1+
| test.cpp:13:12:13:13 | A2 | Neither none, the first, or all enumerated constants are initialized in this enumeration. |
2+
| test.cpp:47:14:47:15 | B3 | Neither none, the first, or all enumerated constants are initialized in this enumeration. |
3+
| test.cpp:63:6:63:6 | D | Neither none, the first, or all enumerated constants are initialized in this enumeration. |
4+
| test.cpp:75:6:75:7 | E1 | Neither none, the first, or all enumerated constants are initialized in this enumeration. |
Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,79 @@
11
enum class A // COMPLIANT
2-
{ a1 };
2+
{
3+
a1
4+
};
35

46
enum class A1 // COMPLIANT
5-
{ a1 = 0,
7+
{
8+
a1 = 0,
69
a2 = 1,
7-
a3 = 2 };
10+
a3 = 2
11+
};
812

913
enum class A2 // NON_COMPLIANT
10-
{ a1,
14+
{
15+
a1,
1116
a2 = 0,
12-
a3 };
17+
a3
18+
};
1319

1420
enum class A3 // COMPLIANT
15-
{ a1 = 0,
21+
{
22+
a1 = 0,
1623
a2,
17-
a3 };
24+
a3
25+
};
1826

1927
enum class B : int // COMPLIANT
20-
{ b1 };
28+
{
29+
b1
30+
};
2131

2232
enum class B1 : int // COMPLIANT
23-
{ b1,
33+
{
34+
b1,
2435
b2,
25-
b3 };
36+
b3
37+
};
2638

2739
enum class B2 : int // COMPLIANT
28-
{ b1 = 0,
40+
{
41+
b1 = 0,
2942
b2,
30-
b3 };
43+
b3
44+
};
3145

3246
int f() {
3347
enum class B3 : int // NON_COMPLIANT
34-
{ b1,
48+
{
49+
b1,
3550
b2 = 0,
36-
b3 = 0 };
51+
b3 = 0
52+
};
3753

3854
return 0;
3955
}
4056

4157
enum C // COMPLIANT
42-
{ c1,
43-
c2 };
58+
{
59+
c1,
60+
c2
61+
};
4462

4563
enum D // NON_COMPLIANT
46-
{ d1,
47-
d2 = 0 };
64+
{
65+
d1,
66+
d2 = 0
67+
};
4868

4969
enum E : int // COMPLIANT
50-
{ e1,
51-
e2 };
70+
{
71+
e1,
72+
e2
73+
};
5274

5375
enum E1 : int // NON_COMPLIANT
54-
{ e11,
55-
e22 = 0 };
76+
{
77+
e11,
78+
e22 = 0
79+
};

cpp/autosar/test/rules/A8-4-5/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class TestClass4 {
4848

4949
// template type
5050
template <typename T, typename... X>
51-
T test_forward(X &&... f) { // forward parameter
51+
T test_forward(X &&...f) { // forward parameter
5252
return T{std::forward<X>(f)...}; // COMPLIANT
5353
}
5454

cpp/autosar/test/rules/A8-4-6/test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class TestClass2 {
1010
explicit TestClass2(const std::vector<int> &v);
1111
};
1212
// template type
13-
template <typename T, typename... X> T make(X &&... x) { // forward param
14-
return T{std::forward<X>(x)...}; // COMPLIANT
13+
template <typename T, typename... X> T make(X &&...x) { // forward param
14+
return T{std::forward<X>(x)...}; // COMPLIANT
1515
}
1616
// template type
1717
template <typename T, typename U> T make2(U &&x) { // forward param

cpp/autosar/test/rules/M6-4-5/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ void test_switchclause_termination2(int expression) {
4040
k = i;
4141
}
4242
default: // NON_COMPLIANT
43-
;
43+
;
4444
}
4545
}

cpp/autosar/test/rules/M8-4-4/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void test_function_identifier_f2() {
2525

2626
template <typename F> static void Log(const F kF) {}
2727

28-
template <typename... As> static void LogFatal(const As &... rest) {
28+
template <typename... As> static void LogFatal(const As &...rest) {
2929
Log([](const std::string &s) -> void {}); // COMPLIANT
3030
}
3131

0 commit comments

Comments
 (0)