Skip to content

Commit f85fa87

Browse files
committed
C#: Add test that illustrates problem with getEnclosingCallable
1 parent 1d654d1 commit f85fa87

File tree

9 files changed

+263
-152
lines changed

9 files changed

+263
-152
lines changed

csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,12 +1303,12 @@
13031303
| cflow.cs:234:13:236:13 | {...} | cflow.cs:235:17:235:22 | break; | 2 |
13041304
| cflow.cs:240:10:240:13 | enter Goto | cflow.cs:241:5:259:5 | {...} | 2 |
13051305
| cflow.cs:240:10:240:13 | exit Goto (normal) | cflow.cs:240:10:240:13 | exit Goto | 2 |
1306-
| cflow.cs:242:9:242:13 | Label: | cflow.cs:242:23:242:39 | ... == ... | 7 |
1307-
| cflow.cs:242:20:242:40 | [false] !... | cflow.cs:242:20:242:40 | [false] !... | 1 |
1308-
| cflow.cs:242:20:242:40 | [true] !... | cflow.cs:242:20:242:40 | [true] !... | 1 |
1309-
| cflow.cs:242:21:242:40 | [false] !... | cflow.cs:242:21:242:40 | [false] !... | 1 |
1310-
| cflow.cs:242:21:242:40 | [true] !... | cflow.cs:242:21:242:40 | [true] !... | 1 |
1311-
| cflow.cs:242:43:242:45 | {...} | cflow.cs:242:43:242:45 | {...} | 1 |
1306+
| cflow.cs:242:5:242:9 | Label: | cflow.cs:242:19:242:35 | ... == ... | 7 |
1307+
| cflow.cs:242:16:242:36 | [false] !... | cflow.cs:242:16:242:36 | [false] !... | 1 |
1308+
| cflow.cs:242:16:242:36 | [true] !... | cflow.cs:242:16:242:36 | [true] !... | 1 |
1309+
| cflow.cs:242:17:242:36 | [false] !... | cflow.cs:242:17:242:36 | [false] !... | 1 |
1310+
| cflow.cs:242:17:242:36 | [true] !... | cflow.cs:242:17:242:36 | [true] !... | 1 |
1311+
| cflow.cs:242:39:242:41 | {...} | cflow.cs:242:39:242:41 | {...} | 1 |
13121312
| cflow.cs:244:9:244:41 | if (...) ... | cflow.cs:244:13:244:28 | ... > ... | 6 |
13131313
| cflow.cs:244:31:244:41 | goto ...; | cflow.cs:244:31:244:41 | goto ...; | 1 |
13141314
| cflow.cs:246:9:258:9 | switch (...) {...} | cflow.cs:248:18:248:18 | 0 | 8 |
@@ -1332,3 +1332,5 @@
13321332
| cflow.cs:300:44:300:51 | [true] !... | cflow.cs:300:44:300:51 | [true] !... | 1 |
13331333
| cflow.cs:300:44:300:64 | ... && ... | cflow.cs:298:10:298:10 | exit M | 5 |
13341334
| cflow.cs:300:56:300:56 | access to parameter s | cflow.cs:300:56:300:64 | ... != ... | 3 |
1335+
| cflow.cs:306:60:310:5 | enter (...) => ... | cflow.cs:306:60:310:5 | exit (...) => ... | 9 |
1336+
| cflow.cs:306:60:310:5 | enter get__getter | cflow.cs:306:60:310:5 | exit get__getter | 4 |

csharp/ql/test/library-tests/controlflow/graph/Condition.expected

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2410,15 +2410,15 @@ conditionBlock
24102410
| cflow.cs:226:22:226:22 | String x | cflow.cs:233:13:236:13 | if (...) ... | false |
24112411
| cflow.cs:226:22:226:22 | String x | cflow.cs:234:13:236:13 | {...} | false |
24122412
| cflow.cs:233:13:236:13 | if (...) ... | cflow.cs:234:13:236:13 | {...} | true |
2413-
| cflow.cs:242:9:242:13 | Label: | cflow.cs:242:20:242:40 | [false] !... | false |
2414-
| cflow.cs:242:9:242:13 | Label: | cflow.cs:242:20:242:40 | [true] !... | true |
2415-
| cflow.cs:242:9:242:13 | Label: | cflow.cs:242:21:242:40 | [false] !... | true |
2416-
| cflow.cs:242:9:242:13 | Label: | cflow.cs:242:21:242:40 | [true] !... | false |
2417-
| cflow.cs:242:9:242:13 | Label: | cflow.cs:242:43:242:45 | {...} | true |
2418-
| cflow.cs:242:20:242:40 | [true] !... | cflow.cs:242:43:242:45 | {...} | true |
2419-
| cflow.cs:242:21:242:40 | [false] !... | cflow.cs:242:20:242:40 | [true] !... | false |
2420-
| cflow.cs:242:21:242:40 | [false] !... | cflow.cs:242:43:242:45 | {...} | false |
2421-
| cflow.cs:242:21:242:40 | [true] !... | cflow.cs:242:20:242:40 | [false] !... | true |
2413+
| cflow.cs:242:5:242:9 | Label: | cflow.cs:242:16:242:36 | [false] !... | false |
2414+
| cflow.cs:242:5:242:9 | Label: | cflow.cs:242:16:242:36 | [true] !... | true |
2415+
| cflow.cs:242:5:242:9 | Label: | cflow.cs:242:17:242:36 | [false] !... | true |
2416+
| cflow.cs:242:5:242:9 | Label: | cflow.cs:242:17:242:36 | [true] !... | false |
2417+
| cflow.cs:242:5:242:9 | Label: | cflow.cs:242:39:242:41 | {...} | true |
2418+
| cflow.cs:242:16:242:36 | [true] !... | cflow.cs:242:39:242:41 | {...} | true |
2419+
| cflow.cs:242:17:242:36 | [false] !... | cflow.cs:242:16:242:36 | [true] !... | false |
2420+
| cflow.cs:242:17:242:36 | [false] !... | cflow.cs:242:39:242:41 | {...} | false |
2421+
| cflow.cs:242:17:242:36 | [true] !... | cflow.cs:242:16:242:36 | [false] !... | true |
24222422
| cflow.cs:244:9:244:41 | if (...) ... | cflow.cs:240:10:240:13 | exit Goto (normal) | false |
24232423
| cflow.cs:244:9:244:41 | if (...) ... | cflow.cs:244:31:244:41 | goto ...; | true |
24242424
| cflow.cs:244:9:244:41 | if (...) ... | cflow.cs:246:9:258:9 | switch (...) {...} | false |
@@ -3007,12 +3007,12 @@ conditionFlow
30073007
| cflow.cs:229:17:229:32 | ... > ... | cflow.cs:233:13:236:13 | if (...) ... | false |
30083008
| cflow.cs:233:17:233:32 | ... < ... | cflow.cs:226:9:237:9 | foreach (... ... in ...) ... | false |
30093009
| cflow.cs:233:17:233:32 | ... < ... | cflow.cs:234:13:236:13 | {...} | true |
3010-
| cflow.cs:242:20:242:40 | [false] !... | cflow.cs:244:9:244:41 | if (...) ... | false |
3011-
| cflow.cs:242:20:242:40 | [true] !... | cflow.cs:242:43:242:45 | {...} | true |
3012-
| cflow.cs:242:21:242:40 | [false] !... | cflow.cs:242:20:242:40 | [true] !... | false |
3013-
| cflow.cs:242:21:242:40 | [true] !... | cflow.cs:242:20:242:40 | [false] !... | true |
3014-
| cflow.cs:242:23:242:39 | ... == ... | cflow.cs:242:21:242:40 | [false] !... | true |
3015-
| cflow.cs:242:23:242:39 | ... == ... | cflow.cs:242:21:242:40 | [true] !... | false |
3010+
| cflow.cs:242:16:242:36 | [false] !... | cflow.cs:244:9:244:41 | if (...) ... | false |
3011+
| cflow.cs:242:16:242:36 | [true] !... | cflow.cs:242:39:242:41 | {...} | true |
3012+
| cflow.cs:242:17:242:36 | [false] !... | cflow.cs:242:16:242:36 | [true] !... | false |
3013+
| cflow.cs:242:17:242:36 | [true] !... | cflow.cs:242:16:242:36 | [false] !... | true |
3014+
| cflow.cs:242:19:242:35 | ... == ... | cflow.cs:242:17:242:36 | [false] !... | true |
3015+
| cflow.cs:242:19:242:35 | ... == ... | cflow.cs:242:17:242:36 | [true] !... | false |
30163016
| cflow.cs:244:13:244:28 | ... > ... | cflow.cs:244:31:244:41 | goto ...; | true |
30173017
| cflow.cs:244:13:244:28 | ... > ... | cflow.cs:246:9:258:9 | switch (...) {...} | false |
30183018
| cflow.cs:264:25:264:30 | ... < ... | cflow.cs:265:9:267:9 | {...} | true |

0 commit comments

Comments
 (0)