Skip to content

Commit 0e9f1a2

Browse files
committed
DeadCode: Format test cases
1 parent 22c9fe0 commit 0e9f1a2

File tree

7 files changed

+23
-22
lines changed

7 files changed

+23
-22
lines changed

c/common/test/rules/deadcode/test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// NOTICE: THE TEST CASES BELOW ARE ALSO INCLUDED IN THE C++ TEST CASE AND CHANGES
2-
// SHOULD BE REFLECTED THERE AS WELL.
1+
// NOTICE: THE TEST CASES BELOW ARE ALSO INCLUDED IN THE C++ TEST CASE AND
2+
// CHANGES SHOULD BE REFLECTED THERE AS WELL.
33
// Define true/false for compatibility with C++ test cases
44
#define false 0
55
#define true 1

c/common/test/rules/unreachablecode/test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// NOTICE: THE TEST CASES BELOW ARE ALSO INCLUDED IN THE C++ TEST CASE AND CHANGES
2-
// SHOULD BE REFLECTED THERE AS WELL.
1+
// NOTICE: THE TEST CASES BELOW ARE ALSO INCLUDED IN THE C++ TEST CASE AND
2+
// CHANGES SHOULD BE REFLECTED THERE AS WELL.
33

44
void test_switch(int p1) {
55
int l1 = 0;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
| file://:0:0:0:0 | __va_list_tag | Type declaration __va_list_tag is not used. |
22
| test.c:4:8:4:8 | A | Type declaration A is not used. |
33
| test.c:7:18:7:18 | D | Type declaration D is not used. |
4-
| test.c:30:11:30:11 | R | Type declaration R is not used. |
5-
| test.c:43:12:43:12 | struct <unnamed> | Type declaration struct <unnamed> is not used. |
4+
| test.c:28:11:28:11 | R | Type declaration R is not used. |
5+
| test.c:41:12:41:12 | struct <unnamed> | Type declaration struct <unnamed> is not used. |

c/common/test/rules/unusedtypedeclarations/test.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// NOTICE: THE TEST CASES BELOW ARE ALSO INCLUDED IN THE C++ TEST CASE AND CHANGES
2-
// SHOULD BE REFLECTED THERE AS WELL.
1+
// NOTICE: THE TEST CASES BELOW ARE ALSO INCLUDED IN THE C++ TEST CASE AND
2+
// CHANGES SHOULD BE REFLECTED THERE AS WELL.
33

44
struct A {}; // NON_COMPLIANT - unused
55

6-
struct C {}; // COMPLIANT - used in the type def
6+
struct C {}; // COMPLIANT - used in the type def
77
typedef struct C D; // NON_COMPLIANT - typedef itself not used
88

99
struct F {}; // COMPLIANT - used as a global function return type
@@ -17,17 +17,15 @@ struct G {}; // COMPLIANT - used as a global function parameter type
1717

1818
void test_global_function(struct G g) {}
1919

20-
enum M { C1, C2, C3 }; // COMPLIANT - used in an enum type access below
20+
enum M { C1, C2, C3 }; // COMPLIANT - used in an enum type access below
2121

22-
void test_enum_access() {
23-
int i = C1;
24-
}
22+
void test_enum_access() { int i = C1; }
2523

2624
struct O {}; // COMPLIANT - used in typedef below
2725

2826
typedef struct O P; // COMPLIANT - used in typedef below
29-
typedef P Q; // COMPLIANT - used in function below
30-
typedef Q R; // NON_COMPLIANT - never used
27+
typedef P Q; // COMPLIANT - used in function below
28+
typedef Q R; // NON_COMPLIANT - never used
3129

3230
Q test_type_def() {}
3331

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
| test.cpp:14:3:14:12 | declaration | This statement in function $@ is unreachable. | test.cpp:12:5:12:21 | test_after_return | test_after_return |
2-
| test.cpp:18:10:19:12 | { ... } | This statement in function $@ is unreachable. | test.cpp:17:5:17:27 | test_constant_condition | test_constant_condition |
3-
| test.cpp:29:10:30:12 | { ... } | This statement in function $@ is unreachable. | test.cpp:28:24:28:24 | f | f |
4-
| test.cpp:50:12:51:14 | { ... } | This statement in function $@ is unreachable. | test.cpp:49:7:49:8 | h1 | h1 |
5-
| test.cpp:55:12:56:14 | { ... } | This statement in function $@ is unreachable. | test.cpp:54:7:54:8 | h2 | h2 |
1+
| test.cpp:17:3:17:12 | declaration | This statement in function $@ is unreachable. | test.cpp:15:5:15:21 | test_after_return | test_after_return |
2+
| test.cpp:21:10:22:12 | { ... } | This statement in function $@ is unreachable. | test.cpp:20:5:20:27 | test_constant_condition | test_constant_condition |
3+
| test.cpp:32:10:33:12 | { ... } | This statement in function $@ is unreachable. | test.cpp:31:24:31:24 | f | f |
4+
| test.cpp:53:12:54:14 | { ... } | This statement in function $@ is unreachable. | test.cpp:52:7:52:8 | h1 | h1 |
5+
| test.cpp:58:12:59:14 | { ... } | This statement in function $@ is unreachable. | test.cpp:57:7:57:8 | h2 | h2 |

cpp/common/test/rules/unreachablecode/test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// NOTICE: SOME OF THE TEST CASES BELOW ARE ALSO INCLUDED IN THE C TEST CASE AND
2+
// CHANGES SHOULD BE REFLECTED THERE AS WELL.
3+
14
void test_switch(int p1) {
25
int l1 = 0;
36
switch (p1) {

cpp/common/test/rules/unusedtypedeclarations/test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// NOTICE: SOME OF THE TEST CASES BELOW ARE ALSO INCLUDED IN THE C TEST CASE AND CHANGES
2-
// SHOULD BE REFLECTED THERE AS WELL.
1+
// NOTICE: SOME OF THE TEST CASES BELOW ARE ALSO INCLUDED IN THE C TEST CASE AND
2+
// CHANGES SHOULD BE REFLECTED THERE AS WELL.
33

44
class A {}; // NON_COMPLIANT - unused
55

0 commit comments

Comments
 (0)