Skip to content

Commit 806d428

Browse files
committed
C++: Add test in C file with pointer type guard.
1 parent 607ed2e commit 806d428

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

cpp/ql/test/library-tests/controlflow/guards/Guards.expected

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
| test.c:137:7:137:7 | 0 |
2727
| test.c:146:7:146:8 | ! ... |
2828
| test.c:146:8:146:8 | x |
29+
| test.c:152:8:152:8 | p |
30+
| test.c:158:8:158:9 | ! ... |
31+
| test.c:158:9:158:9 | p |
2932
| test.cpp:18:8:18:10 | call to get |
3033
| test.cpp:31:7:31:13 | ... == ... |
3134
| test.cpp:42:13:42:20 | call to getABool |

cpp/ql/test/library-tests/controlflow/guards/GuardsControl.expected

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@
7979
| test.c:137:7:137:7 | 0 | false | 142 | 136 |
8080
| test.c:146:7:146:8 | ! ... | true | 146 | 147 |
8181
| test.c:146:8:146:8 | x | false | 146 | 147 |
82+
| test.c:152:8:152:8 | p | true | 152 | 154 |
83+
| test.c:158:8:158:9 | ! ... | true | 158 | 160 |
84+
| test.c:158:9:158:9 | p | false | 158 | 160 |
8285
| test.cpp:18:8:18:10 | call to get | true | 19 | 19 |
8386
| test.cpp:31:7:31:13 | ... == ... | false | 30 | 30 |
8487
| test.cpp:31:7:31:13 | ... == ... | false | 34 | 34 |

cpp/ql/test/library-tests/controlflow/guards/test.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,15 @@ void test5(int x) {
147147
test3();
148148
}
149149
}
150+
151+
void test6(char* p) {
152+
if(p) {
153+
154+
}
155+
}
156+
157+
void test7(char* p) {
158+
if(!p) {
159+
160+
}
161+
}

0 commit comments

Comments
 (0)