Skip to content

Commit c32c810

Browse files
committed
C++: Add a test with a 'short' type.
1 parent 32fe084 commit c32c810

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-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
@@ -29,6 +29,9 @@
2929
| test.c:152:8:152:8 | p |
3030
| test.c:158:8:158:9 | ! ... |
3131
| test.c:158:9:158:9 | p |
32+
| test.c:164:8:164:8 | s |
33+
| test.c:170:8:170:9 | ! ... |
34+
| test.c:170:9:170:9 | s |
3235
| test.cpp:18:8:18:10 | call to get |
3336
| test.cpp:31:7:31:13 | ... == ... |
3437
| test.cpp:42:13:42:20 | call to getABool |

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,7 @@
165165
| 152 | p == 0 when p is false |
166166
| 158 | ! ... != 0 when ! ... is true |
167167
| 158 | ! ... == 0 when ! ... is false |
168+
| 164 | s != 0 when s is true |
169+
| 164 | s == 0 when s is false |
170+
| 170 | ! ... != 0 when ! ... is true |
171+
| 170 | ! ... == 0 when ! ... is false |

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@
8282
| test.c:152:8:152:8 | p | true | 152 | 154 |
8383
| test.c:158:8:158:9 | ! ... | true | 158 | 160 |
8484
| test.c:158:9:158:9 | p | false | 158 | 160 |
85+
| test.c:164:8:164:8 | s | true | 164 | 166 |
86+
| test.c:170:8:170:9 | ! ... | true | 170 | 172 |
87+
| test.c:170:9:170:9 | s | false | 170 | 172 |
8588
| test.cpp:18:8:18:10 | call to get | true | 19 | 19 |
8689
| test.cpp:31:7:31:13 | ... == ... | false | 30 | 30 |
8790
| test.cpp:31:7:31:13 | ... == ... | false | 34 | 34 |

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ unary
247247
| test.c:146:7:146:8 | ! ... | test.c:146:7:146:8 | ! ... | != | 0 | 146 | 147 |
248248
| test.c:152:8:152:8 | p | test.c:152:8:152:8 | p | != | 0 | 152 | 154 |
249249
| test.c:158:8:158:9 | ! ... | test.c:158:8:158:9 | ! ... | != | 0 | 158 | 160 |
250+
| test.c:164:8:164:8 | s | test.c:164:8:164:8 | s | != | 0 | 164 | 166 |
251+
| test.c:170:8:170:9 | ! ... | test.c:170:8:170:9 | ! ... | != | 0 | 170 | 172 |
250252
| test.cpp:18:8:18:10 | call to get | test.cpp:18:8:18:10 | call to get | != | 0 | 19 | 19 |
251253
| test.cpp:31:7:31:13 | ... == ... | test.cpp:31:7:31:7 | x | != | -1 | 30 | 30 |
252254
| test.cpp:31:7:31:13 | ... == ... | test.cpp:31:7:31:7 | x | != | -1 | 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
@@ -157,5 +157,17 @@ void test6(char* p) {
157157
void test7(char* p) {
158158
if(!p) {
159159

160+
}
161+
}
162+
163+
void test8(short s) {
164+
if(s) {
165+
166+
}
167+
}
168+
169+
void test9(short s) {
170+
if(!s) {
171+
160172
}
161173
}

0 commit comments

Comments
 (0)