Skip to content

Commit ccfd383

Browse files
committed
C++: Add some more tests.
1 parent 5504c9f commit ccfd383

File tree

6 files changed

+292
-0
lines changed

6 files changed

+292
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@
4444
| test.c:198:8:198:8 | b |
4545
| test.c:206:7:206:8 | ! ... |
4646
| test.c:206:8:206:8 | c |
47+
| test.c:213:6:213:6 | b |
48+
| test.c:222:6:222:11 | ... != ... |
49+
| test.c:231:6:231:6 | b |
50+
| test.c:240:6:240:11 | ... != ... |
51+
| test.c:249:6:249:6 | b |
52+
| test.c:258:6:258:11 | ... != ... |
4753
| test.cpp:18:8:18:10 | call to get |
4854
| test.cpp:31:7:31:13 | ... == ... |
4955
| test.cpp:42:13:42:20 | call to getABool |
@@ -92,3 +98,8 @@
9298
| test.cpp:241:9:241:43 | ... && ... |
9399
| test.cpp:241:22:241:30 | ... == ... |
94100
| test.cpp:241:35:241:43 | ... == ... |
101+
| test.cpp:248:6:248:11 | ... != ... |
102+
| test.cpp:257:6:257:6 | b |
103+
| test.cpp:266:6:266:11 | ... != ... |
104+
| test.cpp:275:6:275:6 | b |
105+
| test.cpp:284:6:284:11 | ... != ... |

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

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,48 @@
356356
| test.c:206:8:206:8 | c | ! ... == 1 when c is false |
357357
| test.c:206:8:206:8 | c | c != 0 when c is true |
358358
| test.c:206:8:206:8 | c | c == 0 when c is false |
359+
| test.c:213:6:213:6 | b | b != 0 when b is true |
360+
| test.c:213:6:213:6 | b | b != 1 when b is false |
361+
| test.c:213:6:213:6 | b | b == 0 when b is false |
362+
| test.c:213:6:213:6 | b | b == 1 when b is true |
363+
| test.c:222:6:222:11 | ... != ... | 2 != b+0 when ... != ... is true |
364+
| test.c:222:6:222:11 | ... != ... | 2 == b+0 when ... != ... is false |
365+
| test.c:222:6:222:11 | ... != ... | ... != ... != 0 when ... != ... is true |
366+
| test.c:222:6:222:11 | ... != ... | ... != ... != 1 when ... != ... is false |
367+
| test.c:222:6:222:11 | ... != ... | ... != ... == 0 when ... != ... is false |
368+
| test.c:222:6:222:11 | ... != ... | ... != ... == 1 when ... != ... is true |
369+
| test.c:222:6:222:11 | ... != ... | b != 2 when ... != ... is true |
370+
| test.c:222:6:222:11 | ... != ... | b != 2+0 when ... != ... is true |
371+
| test.c:222:6:222:11 | ... != ... | b == 2 when ... != ... is false |
372+
| test.c:222:6:222:11 | ... != ... | b == 2+0 when ... != ... is false |
373+
| test.c:231:6:231:6 | b | b != 0 when b is true |
374+
| test.c:231:6:231:6 | b | b != 1 when b is false |
375+
| test.c:231:6:231:6 | b | b == 0 when b is false |
376+
| test.c:231:6:231:6 | b | b == 1 when b is true |
377+
| test.c:240:6:240:11 | ... != ... | 2 != b+0 when ... != ... is true |
378+
| test.c:240:6:240:11 | ... != ... | 2 == b+0 when ... != ... is false |
379+
| test.c:240:6:240:11 | ... != ... | ... != ... != 0 when ... != ... is true |
380+
| test.c:240:6:240:11 | ... != ... | ... != ... != 1 when ... != ... is false |
381+
| test.c:240:6:240:11 | ... != ... | ... != ... == 0 when ... != ... is false |
382+
| test.c:240:6:240:11 | ... != ... | ... != ... == 1 when ... != ... is true |
383+
| test.c:240:6:240:11 | ... != ... | b != 2 when ... != ... is true |
384+
| test.c:240:6:240:11 | ... != ... | b != 2+0 when ... != ... is true |
385+
| test.c:240:6:240:11 | ... != ... | b == 2 when ... != ... is false |
386+
| test.c:240:6:240:11 | ... != ... | b == 2+0 when ... != ... is false |
387+
| test.c:249:6:249:6 | b | b != 0 when b is true |
388+
| test.c:249:6:249:6 | b | b != 1 when b is false |
389+
| test.c:249:6:249:6 | b | b == 0 when b is false |
390+
| test.c:249:6:249:6 | b | b == 1 when b is true |
391+
| test.c:258:6:258:11 | ... != ... | 2 != b+0 when ... != ... is true |
392+
| test.c:258:6:258:11 | ... != ... | 2 == b+0 when ... != ... is false |
393+
| test.c:258:6:258:11 | ... != ... | ... != ... != 0 when ... != ... is true |
394+
| test.c:258:6:258:11 | ... != ... | ... != ... != 1 when ... != ... is false |
395+
| test.c:258:6:258:11 | ... != ... | ... != ... == 0 when ... != ... is false |
396+
| test.c:258:6:258:11 | ... != ... | ... != ... == 1 when ... != ... is true |
397+
| test.c:258:6:258:11 | ... != ... | b != 2 when ... != ... is true |
398+
| test.c:258:6:258:11 | ... != ... | b != 2+0 when ... != ... is true |
399+
| test.c:258:6:258:11 | ... != ... | b == 2 when ... != ... is false |
400+
| test.c:258:6:258:11 | ... != ... | b == 2+0 when ... != ... is false |
359401
| test.cpp:18:8:18:10 | call to get | call to get != 0 when call to get is true |
360402
| test.cpp:18:8:18:10 | call to get | call to get != 1 when call to get is false |
361403
| test.cpp:18:8:18:10 | call to get | call to get == 0 when call to get is false |
@@ -803,3 +845,41 @@
803845
| test.cpp:241:35:241:43 | ... == ... | i != 0+0 when ... == ... is false |
804846
| test.cpp:241:35:241:43 | ... == ... | i == 0 when ... == ... is true |
805847
| test.cpp:241:35:241:43 | ... == ... | i == 0+0 when ... == ... is true |
848+
| test.cpp:248:6:248:11 | ... != ... | 2 != b+0 when ... != ... is true |
849+
| test.cpp:248:6:248:11 | ... != ... | 2 == b+0 when ... != ... is false |
850+
| test.cpp:248:6:248:11 | ... != ... | ... != ... != 0 when ... != ... is true |
851+
| test.cpp:248:6:248:11 | ... != ... | ... != ... != 1 when ... != ... is false |
852+
| test.cpp:248:6:248:11 | ... != ... | ... != ... == 0 when ... != ... is false |
853+
| test.cpp:248:6:248:11 | ... != ... | ... != ... == 1 when ... != ... is true |
854+
| test.cpp:248:6:248:11 | ... != ... | b != 2 when ... != ... is true |
855+
| test.cpp:248:6:248:11 | ... != ... | b != 2+0 when ... != ... is true |
856+
| test.cpp:248:6:248:11 | ... != ... | b == 2 when ... != ... is false |
857+
| test.cpp:248:6:248:11 | ... != ... | b == 2+0 when ... != ... is false |
858+
| test.cpp:257:6:257:6 | b | b != 0 when b is true |
859+
| test.cpp:257:6:257:6 | b | b != 1 when b is false |
860+
| test.cpp:257:6:257:6 | b | b == 0 when b is false |
861+
| test.cpp:257:6:257:6 | b | b == 1 when b is true |
862+
| test.cpp:266:6:266:11 | ... != ... | 2 != b+0 when ... != ... is true |
863+
| test.cpp:266:6:266:11 | ... != ... | 2 == b+0 when ... != ... is false |
864+
| test.cpp:266:6:266:11 | ... != ... | ... != ... != 0 when ... != ... is true |
865+
| test.cpp:266:6:266:11 | ... != ... | ... != ... != 1 when ... != ... is false |
866+
| test.cpp:266:6:266:11 | ... != ... | ... != ... == 0 when ... != ... is false |
867+
| test.cpp:266:6:266:11 | ... != ... | ... != ... == 1 when ... != ... is true |
868+
| test.cpp:266:6:266:11 | ... != ... | b != 2 when ... != ... is true |
869+
| test.cpp:266:6:266:11 | ... != ... | b != 2+0 when ... != ... is true |
870+
| test.cpp:266:6:266:11 | ... != ... | b == 2 when ... != ... is false |
871+
| test.cpp:266:6:266:11 | ... != ... | b == 2+0 when ... != ... is false |
872+
| test.cpp:275:6:275:6 | b | b != 0 when b is true |
873+
| test.cpp:275:6:275:6 | b | b != 1 when b is false |
874+
| test.cpp:275:6:275:6 | b | b == 0 when b is false |
875+
| test.cpp:275:6:275:6 | b | b == 1 when b is true |
876+
| test.cpp:284:6:284:11 | ... != ... | 2 != b+0 when ... != ... is true |
877+
| test.cpp:284:6:284:11 | ... != ... | 2 == b+0 when ... != ... is false |
878+
| test.cpp:284:6:284:11 | ... != ... | ... != ... != 0 when ... != ... is true |
879+
| test.cpp:284:6:284:11 | ... != ... | ... != ... != 1 when ... != ... is false |
880+
| test.cpp:284:6:284:11 | ... != ... | ... != ... == 0 when ... != ... is false |
881+
| test.cpp:284:6:284:11 | ... != ... | ... != ... == 1 when ... != ... is true |
882+
| test.cpp:284:6:284:11 | ... != ... | b != 2 when ... != ... is true |
883+
| test.cpp:284:6:284:11 | ... != ... | b != 2+0 when ... != ... is true |
884+
| test.cpp:284:6:284:11 | ... != ... | b == 2 when ... != ... is false |
885+
| test.cpp:284:6:284:11 | ... != ... | b == 2+0 when ... != ... is false |

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@
103103
| test.c:198:8:198:8 | b | false | test.c:198:11:200:3 | { ... } |
104104
| test.c:206:7:206:8 | ! ... | true | test.c:206:11:208:3 | { ... } |
105105
| test.c:206:8:206:8 | c | false | test.c:206:11:208:3 | { ... } |
106+
| test.c:213:6:213:6 | b | false | test.c:215:10:217:3 | { ... } |
107+
| test.c:213:6:213:6 | b | true | test.c:213:9:215:3 | { ... } |
108+
| test.c:222:6:222:11 | ... != ... | false | test.c:224:10:226:3 | { ... } |
109+
| test.c:222:6:222:11 | ... != ... | true | test.c:222:14:224:3 | { ... } |
110+
| test.c:231:6:231:6 | b | false | test.c:233:10:235:3 | { ... } |
111+
| test.c:231:6:231:6 | b | true | test.c:231:9:233:3 | { ... } |
112+
| test.c:240:6:240:11 | ... != ... | false | test.c:242:10:244:3 | { ... } |
113+
| test.c:240:6:240:11 | ... != ... | true | test.c:240:14:242:3 | { ... } |
114+
| test.c:249:6:249:6 | b | false | test.c:251:10:253:3 | { ... } |
115+
| test.c:249:6:249:6 | b | true | test.c:249:9:251:3 | { ... } |
116+
| test.c:258:6:258:11 | ... != ... | false | test.c:260:10:262:3 | { ... } |
117+
| test.c:258:6:258:11 | ... != ... | true | test.c:258:14:260:3 | { ... } |
106118
| test.cpp:18:8:18:10 | call to get | true | test.cpp:19:5:19:14 | ExprStmt |
107119
| test.cpp:31:7:31:13 | ... == ... | false | test.cpp:30:6:30:16 | doSomething |
108120
| test.cpp:31:7:31:13 | ... == ... | false | test.cpp:34:1:34:1 | return ... |
@@ -168,3 +180,13 @@
168180
| test.cpp:241:22:241:30 | ... == ... | true | test.cpp:241:35:241:43 | ms |
169181
| test.cpp:241:22:241:30 | ... == ... | true | test.cpp:241:46:242:13 | { ... } |
170182
| test.cpp:241:35:241:43 | ... == ... | true | test.cpp:241:46:242:13 | { ... } |
183+
| test.cpp:248:6:248:11 | ... != ... | false | test.cpp:250:10:252:3 | { ... } |
184+
| test.cpp:248:6:248:11 | ... != ... | true | test.cpp:248:14:250:3 | { ... } |
185+
| test.cpp:257:6:257:6 | b | false | test.cpp:259:10:261:3 | { ... } |
186+
| test.cpp:257:6:257:6 | b | true | test.cpp:257:9:259:3 | { ... } |
187+
| test.cpp:266:6:266:11 | ... != ... | false | test.cpp:268:10:270:3 | { ... } |
188+
| test.cpp:266:6:266:11 | ... != ... | true | test.cpp:266:14:268:3 | { ... } |
189+
| test.cpp:275:6:275:6 | b | false | test.cpp:277:10:279:3 | { ... } |
190+
| test.cpp:275:6:275:6 | b | true | test.cpp:275:9:277:3 | { ... } |
191+
| test.cpp:284:6:284:11 | ... != ... | false | test.cpp:286:10:288:3 | { ... } |
192+
| test.cpp:284:6:284:11 | ... != ... | true | test.cpp:284:14:286:3 | { ... } |

0 commit comments

Comments
 (0)