Skip to content

Commit 5e0c3ab

Browse files
committed
Fix kotlin tests
1 parent 3f5886e commit 5e0c3ab

File tree

12 files changed

+44
-44
lines changed

12 files changed

+44
-44
lines changed

java/ql/test-kotlin1/library-tests/controlflow/basic/bbStmts.expected

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
| Test.kt:3:8:80:1 | { ... } | 0 | Test.kt:3:8:80:1 | { ... } |
22
| Test.kt:3:8:80:1 | { ... } | 1 | Test.kt:3:1:80:1 | super(...) |
33
| Test.kt:3:8:80:1 | { ... } | 2 | Test.kt:3:8:80:1 | { ... } |
4-
| Test.kt:3:8:80:1 | { ... } | 3 | Test.kt:3:8:80:1 | Test |
5-
| Test.kt:4:2:79:2 | test | 0 | Test.kt:4:2:79:2 | test |
4+
| Test.kt:3:8:80:1 | { ... } | 3 | Test.kt:3:8:80:1 | Exit |
5+
| Test.kt:4:2:79:2 | Exit | 0 | Test.kt:4:2:79:2 | Exit |
66
| Test.kt:4:13:79:2 | { ... } | 0 | Test.kt:4:13:79:2 | { ... } |
77
| Test.kt:4:13:79:2 | { ... } | 1 | Test.kt:5:7:5:7 | var ...; |
88
| Test.kt:4:13:79:2 | { ... } | 2 | Test.kt:5:16:5:16 | 0 |
@@ -102,7 +102,7 @@
102102
| Test.kt:43:3:43:3 | <Expr>; | 8 | Test.kt:77:3:77:8 | ...=... |
103103
| Test.kt:43:3:43:3 | <Expr>; | 9 | Test.kt:78:3:78:8 | INSTANCE |
104104
| Test.kt:43:3:43:3 | <Expr>; | 10 | Test.kt:78:3:78:8 | return ... |
105-
| Test.kt:82:1:89:1 | t1 | 0 | Test.kt:82:1:89:1 | t1 |
105+
| Test.kt:82:1:89:1 | Exit | 0 | Test.kt:82:1:89:1 | Exit |
106106
| Test.kt:82:21:89:1 | { ... } | 0 | Test.kt:82:21:89:1 | { ... } |
107107
| Test.kt:82:21:89:1 | { ... } | 1 | Test.kt:83:2:88:2 | try ... |
108108
| Test.kt:82:21:89:1 | { ... } | 2 | Test.kt:83:6:86:2 | { ... } |
@@ -117,7 +117,7 @@
117117
| Test.kt:86:4:88:2 | catch (...) | 2 | Test.kt:86:34:88:2 | { ... } |
118118
| Test.kt:86:4:88:2 | catch (...) | 3 | Test.kt:87:10:87:10 | 2 |
119119
| Test.kt:86:4:88:2 | catch (...) | 4 | Test.kt:87:3:87:10 | return ... |
120-
| Test.kt:91:1:98:1 | t2 | 0 | Test.kt:91:1:98:1 | t2 |
120+
| Test.kt:91:1:98:1 | Exit | 0 | Test.kt:91:1:98:1 | Exit |
121121
| Test.kt:91:22:98:1 | { ... } | 0 | Test.kt:91:22:98:1 | { ... } |
122122
| Test.kt:91:22:98:1 | { ... } | 1 | Test.kt:92:2:97:2 | try ... |
123123
| Test.kt:91:22:98:1 | { ... } | 2 | Test.kt:92:6:95:2 | { ... } |
@@ -132,7 +132,7 @@
132132
| Test.kt:95:4:97:2 | catch (...) | 2 | Test.kt:95:36:97:2 | { ... } |
133133
| Test.kt:95:4:97:2 | catch (...) | 3 | Test.kt:96:10:96:10 | 2 |
134134
| Test.kt:95:4:97:2 | catch (...) | 4 | Test.kt:96:3:96:10 | return ... |
135-
| Test.kt:100:1:110:1 | fn | 0 | Test.kt:100:1:110:1 | fn |
135+
| Test.kt:100:1:110:1 | Exit | 0 | Test.kt:100:1:110:1 | Exit |
136136
| Test.kt:100:25:110:1 | { ... } | 0 | Test.kt:100:25:110:1 | { ... } |
137137
| Test.kt:100:25:110:1 | { ... } | 1 | Test.kt:101:5:103:5 | <Expr>; |
138138
| Test.kt:100:25:110:1 | { ... } | 2 | Test.kt:101:5:103:5 | when ... |
@@ -165,7 +165,7 @@
165165
| Test.kt:107:27:109:5 | { ... } | 1 | Test.kt:108:9:108:29 | <Expr>; |
166166
| Test.kt:107:27:109:5 | { ... } | 2 | Test.kt:108:17:108:28 | "y not null" |
167167
| Test.kt:107:27:109:5 | { ... } | 3 | Test.kt:108:9:108:29 | println(...) |
168-
| Test.kt:112:1:116:1 | fn | 0 | Test.kt:112:1:116:1 | fn |
168+
| Test.kt:112:1:116:1 | Exit | 0 | Test.kt:112:1:116:1 | Exit |
169169
| Test.kt:112:32:116:1 | { ... } | 0 | Test.kt:112:32:116:1 | { ... } |
170170
| Test.kt:112:32:116:1 | { ... } | 1 | Test.kt:113:5:115:5 | <Expr>; |
171171
| Test.kt:112:32:116:1 | { ... } | 2 | Test.kt:113:5:115:5 | when ... |
@@ -174,7 +174,7 @@
174174
| Test.kt:112:32:116:1 | { ... } | 5 | Test.kt:113:9:113:9 | x |
175175
| Test.kt:113:14:113:14 | y | 0 | Test.kt:113:14:113:14 | y |
176176
| Test.kt:113:17:115:5 | { ... } | 0 | Test.kt:113:17:115:5 | { ... } |
177-
| Test.kt:118:1:124:1 | fn_when | 0 | Test.kt:118:1:124:1 | fn_when |
177+
| Test.kt:118:1:124:1 | Exit | 0 | Test.kt:118:1:124:1 | Exit |
178178
| Test.kt:118:37:124:1 | { ... } | 0 | Test.kt:118:37:124:1 | { ... } |
179179
| Test.kt:118:37:124:1 | { ... } | 1 | Test.kt:119:2:123:12 | <Expr>; |
180180
| Test.kt:118:37:124:1 | { ... } | 2 | Test.kt:119:2:123:12 | when ... |

java/ql/test-kotlin1/library-tests/controlflow/basic/bbStmts.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import default
33
from BasicBlock b, int i, ControlFlowNode n
44
where
55
b.getNode(i) = n and
6-
b.getFile().(CompilationUnit).fromSource()
6+
b.getLocation().getFile().(CompilationUnit).fromSource()
77
select b, i, n

java/ql/test-kotlin1/library-tests/controlflow/basic/bbStrictDominance.expected

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
| Test.kt:4:13:79:2 | { ... } | Test.kt:4:2:79:2 | test |
1+
| Test.kt:4:13:79:2 | { ... } | Test.kt:4:2:79:2 | Exit |
22
| Test.kt:4:13:79:2 | { ... } | Test.kt:11:3:16:3 | ... -> ... |
33
| Test.kt:4:13:79:2 | { ... } | Test.kt:11:14:14:3 | { ... } |
44
| Test.kt:4:13:79:2 | { ... } | Test.kt:18:3:18:3 | <Expr>; |
@@ -9,7 +9,7 @@
99
| Test.kt:4:13:79:2 | { ... } | Test.kt:38:9:38:9 | x |
1010
| Test.kt:4:13:79:2 | { ... } | Test.kt:38:16:41:3 | { ... } |
1111
| Test.kt:4:13:79:2 | { ... } | Test.kt:43:3:43:3 | <Expr>; |
12-
| Test.kt:18:3:18:3 | <Expr>; | Test.kt:4:2:79:2 | test |
12+
| Test.kt:18:3:18:3 | <Expr>; | Test.kt:4:2:79:2 | Exit |
1313
| Test.kt:18:3:18:3 | <Expr>; | Test.kt:21:3:24:9 | ... -> ... |
1414
| Test.kt:18:3:18:3 | <Expr>; | Test.kt:22:4:22:4 | <Expr>; |
1515
| Test.kt:18:3:18:3 | <Expr>; | Test.kt:30:15:33:3 | { ... } |
@@ -27,13 +27,13 @@
2727
| Test.kt:35:3:35:3 | <Expr>; | Test.kt:43:3:43:3 | <Expr>; |
2828
| Test.kt:38:9:38:9 | x | Test.kt:38:16:41:3 | { ... } |
2929
| Test.kt:38:9:38:9 | x | Test.kt:43:3:43:3 | <Expr>; |
30-
| Test.kt:82:21:89:1 | { ... } | Test.kt:82:1:89:1 | t1 |
30+
| Test.kt:82:21:89:1 | { ... } | Test.kt:82:1:89:1 | Exit |
3131
| Test.kt:82:21:89:1 | { ... } | Test.kt:84:7:84:7 | x |
3232
| Test.kt:82:21:89:1 | { ... } | Test.kt:86:4:88:2 | catch (...) |
33-
| Test.kt:91:22:98:1 | { ... } | Test.kt:91:1:98:1 | t2 |
33+
| Test.kt:91:22:98:1 | { ... } | Test.kt:91:1:98:1 | Exit |
3434
| Test.kt:91:22:98:1 | { ... } | Test.kt:93:7:93:7 | x |
3535
| Test.kt:91:22:98:1 | { ... } | Test.kt:95:4:97:2 | catch (...) |
36-
| Test.kt:100:25:110:1 | { ... } | Test.kt:100:1:110:1 | fn |
36+
| Test.kt:100:25:110:1 | { ... } | Test.kt:100:1:110:1 | Exit |
3737
| Test.kt:100:25:110:1 | { ... } | Test.kt:101:22:101:22 | y |
3838
| Test.kt:100:25:110:1 | { ... } | Test.kt:101:33:103:5 | { ... } |
3939
| Test.kt:100:25:110:1 | { ... } | Test.kt:105:5:109:5 | <Expr>; |
@@ -45,11 +45,11 @@
4545
| Test.kt:105:5:109:5 | <Expr>; | Test.kt:107:16:109:5 | ... -> ... |
4646
| Test.kt:105:5:109:5 | <Expr>; | Test.kt:107:27:109:5 | { ... } |
4747
| Test.kt:107:16:109:5 | ... -> ... | Test.kt:107:27:109:5 | { ... } |
48-
| Test.kt:112:32:116:1 | { ... } | Test.kt:112:1:116:1 | fn |
48+
| Test.kt:112:32:116:1 | { ... } | Test.kt:112:1:116:1 | Exit |
4949
| Test.kt:112:32:116:1 | { ... } | Test.kt:113:14:113:14 | y |
5050
| Test.kt:112:32:116:1 | { ... } | Test.kt:113:17:115:5 | { ... } |
5151
| Test.kt:113:14:113:14 | y | Test.kt:113:17:115:5 | { ... } |
52-
| Test.kt:118:37:124:1 | { ... } | Test.kt:118:1:124:1 | fn_when |
52+
| Test.kt:118:37:124:1 | { ... } | Test.kt:118:1:124:1 | Exit |
5353
| Test.kt:118:37:124:1 | { ... } | Test.kt:121:9:121:9 | <Expr>; |
5454
| Test.kt:118:37:124:1 | { ... } | Test.kt:122:12:122:16 | ... -> ... |
5555
| Test.kt:118:37:124:1 | { ... } | Test.kt:123:8:123:10 | { ... } |

java/ql/test-kotlin1/library-tests/controlflow/basic/bbSuccessor.expected

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,42 @@
44
| Test.kt:11:14:14:3 | { ... } | Test.kt:18:3:18:3 | <Expr>; |
55
| Test.kt:18:3:18:3 | <Expr>; | Test.kt:21:3:24:9 | ... -> ... |
66
| Test.kt:18:3:18:3 | <Expr>; | Test.kt:22:4:22:4 | <Expr>; |
7-
| Test.kt:21:3:24:9 | ... -> ... | Test.kt:4:2:79:2 | test |
7+
| Test.kt:21:3:24:9 | ... -> ... | Test.kt:4:2:79:2 | Exit |
88
| Test.kt:22:4:22:4 | <Expr>; | Test.kt:30:15:33:3 | { ... } |
99
| Test.kt:22:4:22:4 | <Expr>; | Test.kt:35:3:35:3 | <Expr>; |
1010
| Test.kt:30:15:33:3 | { ... } | Test.kt:35:3:35:3 | <Expr>; |
1111
| Test.kt:35:3:35:3 | <Expr>; | Test.kt:38:9:38:9 | x |
1212
| Test.kt:38:9:38:9 | x | Test.kt:38:16:41:3 | { ... } |
1313
| Test.kt:38:9:38:9 | x | Test.kt:43:3:43:3 | <Expr>; |
1414
| Test.kt:38:16:41:3 | { ... } | Test.kt:38:9:38:9 | x |
15-
| Test.kt:43:3:43:3 | <Expr>; | Test.kt:4:2:79:2 | test |
15+
| Test.kt:43:3:43:3 | <Expr>; | Test.kt:4:2:79:2 | Exit |
1616
| Test.kt:82:21:89:1 | { ... } | Test.kt:84:7:84:7 | x |
1717
| Test.kt:82:21:89:1 | { ... } | Test.kt:86:4:88:2 | catch (...) |
18-
| Test.kt:84:7:84:7 | x | Test.kt:82:1:89:1 | t1 |
19-
| Test.kt:86:4:88:2 | catch (...) | Test.kt:82:1:89:1 | t1 |
18+
| Test.kt:84:7:84:7 | x | Test.kt:82:1:89:1 | Exit |
19+
| Test.kt:86:4:88:2 | catch (...) | Test.kt:82:1:89:1 | Exit |
2020
| Test.kt:91:22:98:1 | { ... } | Test.kt:93:7:93:7 | x |
2121
| Test.kt:91:22:98:1 | { ... } | Test.kt:95:4:97:2 | catch (...) |
22-
| Test.kt:93:7:93:7 | x | Test.kt:91:1:98:1 | t2 |
23-
| Test.kt:95:4:97:2 | catch (...) | Test.kt:91:1:98:1 | t2 |
22+
| Test.kt:93:7:93:7 | x | Test.kt:91:1:98:1 | Exit |
23+
| Test.kt:95:4:97:2 | catch (...) | Test.kt:91:1:98:1 | Exit |
2424
| Test.kt:100:25:110:1 | { ... } | Test.kt:101:22:101:22 | y |
2525
| Test.kt:100:25:110:1 | { ... } | Test.kt:105:5:109:5 | <Expr>; |
2626
| Test.kt:101:22:101:22 | y | Test.kt:101:33:103:5 | { ... } |
2727
| Test.kt:101:22:101:22 | y | Test.kt:105:5:109:5 | <Expr>; |
28-
| Test.kt:101:33:103:5 | { ... } | Test.kt:100:1:110:1 | fn |
28+
| Test.kt:101:33:103:5 | { ... } | Test.kt:100:1:110:1 | Exit |
2929
| Test.kt:105:5:109:5 | <Expr>; | Test.kt:105:20:107:5 | { ... } |
3030
| Test.kt:105:5:109:5 | <Expr>; | Test.kt:107:16:109:5 | ... -> ... |
31-
| Test.kt:105:20:107:5 | { ... } | Test.kt:100:1:110:1 | fn |
32-
| Test.kt:107:16:109:5 | ... -> ... | Test.kt:100:1:110:1 | fn |
31+
| Test.kt:105:20:107:5 | { ... } | Test.kt:100:1:110:1 | Exit |
32+
| Test.kt:107:16:109:5 | ... -> ... | Test.kt:100:1:110:1 | Exit |
3333
| Test.kt:107:16:109:5 | ... -> ... | Test.kt:107:27:109:5 | { ... } |
34-
| Test.kt:107:27:109:5 | { ... } | Test.kt:100:1:110:1 | fn |
35-
| Test.kt:112:32:116:1 | { ... } | Test.kt:112:1:116:1 | fn |
34+
| Test.kt:107:27:109:5 | { ... } | Test.kt:100:1:110:1 | Exit |
35+
| Test.kt:112:32:116:1 | { ... } | Test.kt:112:1:116:1 | Exit |
3636
| Test.kt:112:32:116:1 | { ... } | Test.kt:113:14:113:14 | y |
37-
| Test.kt:113:14:113:14 | y | Test.kt:112:1:116:1 | fn |
37+
| Test.kt:113:14:113:14 | y | Test.kt:112:1:116:1 | Exit |
3838
| Test.kt:113:14:113:14 | y | Test.kt:113:17:115:5 | { ... } |
39-
| Test.kt:113:17:115:5 | { ... } | Test.kt:112:1:116:1 | fn |
39+
| Test.kt:113:17:115:5 | { ... } | Test.kt:112:1:116:1 | Exit |
4040
| Test.kt:118:37:124:1 | { ... } | Test.kt:121:9:121:9 | <Expr>; |
4141
| Test.kt:118:37:124:1 | { ... } | Test.kt:122:12:122:16 | ... -> ... |
42-
| Test.kt:121:9:121:9 | <Expr>; | Test.kt:118:1:124:1 | fn_when |
42+
| Test.kt:121:9:121:9 | <Expr>; | Test.kt:118:1:124:1 | Exit |
4343
| Test.kt:121:9:121:9 | <Expr>; | Test.kt:123:8:123:10 | { ... } |
44-
| Test.kt:122:12:122:16 | ... -> ... | Test.kt:118:1:124:1 | fn_when |
45-
| Test.kt:123:8:123:10 | { ... } | Test.kt:118:1:124:1 | fn_when |
44+
| Test.kt:122:12:122:16 | ... -> ... | Test.kt:118:1:124:1 | Exit |
45+
| Test.kt:123:8:123:10 | { ... } | Test.kt:118:1:124:1 | Exit |

java/ql/test-kotlin1/library-tests/controlflow/basic/strictDominance.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import default
22
import semmle.code.java.controlflow.Dominance
33

44
from Stmt pre, Stmt post
5-
where strictlyDominates(pre, post)
5+
where strictlyDominates(pre.getControlFlowNode(), post.getControlFlowNode())
66
select pre, post

java/ql/test-kotlin1/library-tests/controlflow/basic/strictPostDominance.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import default
22
import semmle.code.java.controlflow.Dominance
33

44
from Stmt pre, Stmt post
5-
where strictlyPostDominates(post, pre)
5+
where strictlyPostDominates(post.getControlFlowNode(), pre.getControlFlowNode())
66
select post, pre

java/ql/test-kotlin1/library-tests/controlflow/dominance/dominanceBad.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import semmle.code.java.controlflow.Dominance
44
from IfStmt i, BlockStmt b
55
where
66
b = i.getThen() and
7-
dominates(i.getThen(), b) and
8-
dominates(i.getElse(), b)
7+
dominates(i.getThen().getControlFlowNode(), b.getControlFlowNode()) and
8+
dominates(i.getElse().getControlFlowNode(), b.getControlFlowNode())
99
select i, b

java/ql/test-kotlin1/library-tests/controlflow/dominance/dominanceWrong.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ predicate dominanceCounterExample(ControlFlowNode entry, ControlFlowNode dom, Co
1717
from Callable c, ControlFlowNode dom, ControlFlowNode node
1818
where
1919
(strictlyDominates(dom, node) or bbStrictlyDominates(dom, node)) and
20-
dominanceCounterExample(c.getBody(), dom, node)
20+
dominanceCounterExample(c.getBody().getControlFlowNode(), dom, node)
2121
select c, dom, node

java/ql/test-kotlin1/library-tests/controlflow/dominance/dominatedByStart.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import default
33
import semmle.code.java.controlflow.Dominance
44

55
ControlFlowNode reachableIn(Method func) {
6-
result = func.getBody() or
6+
result = func.getBody().getControlFlowNode() or
77
result = reachableIn(func).getASuccessor()
88
}
99

1010
from Method func, ControlFlowNode entry, ControlFlowNode node
1111
where
12-
func.getBody() = entry and
12+
func.getBody().getControlFlowNode() = entry and
1313
reachableIn(func) = node and
1414
entry != node and
15-
not strictlyDominates(func.getBody(), node)
15+
not strictlyDominates(func.getBody().getControlFlowNode(), node)
1616
select func, node

java/ql/test-kotlin1/library-tests/controlflow/dominance/dominator.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
| Test.kt:21:3:24:11 | true | Test.kt:24:11:24:11 | z |
4545
| Test.kt:21:3:24:11 | when ... | Test.kt:21:3:24:11 | ... -> ... |
4646
| Test.kt:21:7:21:7 | x | Test.kt:21:11:21:11 | 0 |
47-
| Test.kt:21:7:21:11 | ... < ... | Test.kt:2:2:79:2 | test |
47+
| Test.kt:21:7:21:11 | ... < ... | Test.kt:2:2:79:2 | Exit |
4848
| Test.kt:21:7:21:11 | ... < ... | Test.kt:21:3:24:11 | ... -> ... |
4949
| Test.kt:21:7:21:11 | ... < ... | Test.kt:22:4:22:4 | <Expr>; |
5050
| Test.kt:21:11:21:11 | 0 | Test.kt:21:7:21:11 | ... < ... |
@@ -142,7 +142,7 @@
142142
| Test.kt:92:4:93:9 | <Expr>; | Test.kt:92:4:93:9 | when ... |
143143
| Test.kt:92:4:93:9 | when ... | Test.kt:92:4:93:9 | ... -> ... |
144144
| Test.kt:92:8:92:8 | a | Test.kt:92:13:92:14 | 10 |
145-
| Test.kt:92:8:92:14 | ... (value equals) ... | Test.kt:81:2:98:2 | test2 |
145+
| Test.kt:92:8:92:14 | ... (value equals) ... | Test.kt:81:2:98:2 | Exit |
146146
| Test.kt:92:8:92:14 | ... (value equals) ... | Test.kt:93:5:93:9 | break |
147147
| Test.kt:92:8:92:14 | ... (value equals) ... | Test.kt:94:4:95:12 | <Expr>; |
148148
| Test.kt:92:13:92:14 | 10 | Test.kt:92:8:92:14 | ... (value equals) ... |

0 commit comments

Comments
 (0)