Skip to content

Commit 35f6e6e

Browse files
committed
Java: Update tests to new partial flow api
1 parent b1d4ca5 commit 35f6e6e

File tree

6 files changed

+11
-23
lines changed

6 files changed

+11
-23
lines changed

java/ql/test/library-tests/dataflow/capture/test.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module Flow = DataFlow::Global<Config>;
1616

1717
int explorationLimit() { result = 100 }
1818

19-
module PartialFlow = Flow::FlowExploration<explorationLimit/0>;
19+
module PartialFlow = Flow::FlowExplorationFwd<explorationLimit/0>;
2020

2121
from PartialFlow::PartialPathNode src, PartialFlow::PartialPathNode sink
2222
where PartialFlow::partialFlow(src, sink, _)

java/ql/test/library-tests/dataflow/partial/test.expected

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
edges
2-
| A.java:4:16:4:18 | this <constr(this)> [post update] [elem] | A.java:22:17:22:25 | new Box(...) [elem] |
3-
| A.java:5:19:5:22 | elem | A.java:24:10:24:19 | other.elem |
42
| A.java:12:5:12:5 | b [post update] : Box [elem] | A.java:13:12:13:12 | b : Box [elem] |
53
| A.java:12:14:12:18 | src(...) : Object | A.java:12:5:12:5 | b [post update] : Box [elem] |
64
| A.java:12:14:12:18 | src(...) : Object | A.java:12:5:12:18 | ...=... : Object |
75
| A.java:13:12:13:12 | b : Box [elem] | A.java:17:13:17:16 | f1(...) : Box [elem] |
86
| A.java:17:13:17:16 | f1(...) : Box [elem] | A.java:18:8:18:8 | b : Box [elem] |
97
| A.java:18:8:18:8 | b : Box [elem] | A.java:21:11:21:15 | b : Box [elem] |
10-
| A.java:22:17:22:25 | new Box(...) [elem] | A.java:23:13:23:17 | other [elem] |
11-
| A.java:23:13:23:17 | other [elem] | A.java:24:10:24:14 | other [elem] |
12-
| A.java:23:13:23:17 | other [post update] [elem] | A.java:24:10:24:14 | other [elem] |
13-
| A.java:24:10:24:14 | other [elem] | A.java:24:10:24:19 | other.elem |
14-
| A.java:28:5:28:5 | b [post update] [elem] | A.java:23:13:23:17 | other [post update] [elem] |
15-
| A.java:28:14:28:25 | new Object(...) | A.java:28:5:28:5 | b [post update] [elem] |
168
#select
179
| 0 | A.java:12:5:12:5 | b [post update] : Box [elem] |
1810
| 0 | A.java:12:5:12:18 | ...=... : Object |

java/ql/test/library-tests/dataflow/partial/test.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module Config implements ConfigSig {
1010

1111
int explorationLimit() { result = 10 }
1212

13-
module PartialFlow = Global<Config>::FlowExploration<explorationLimit/0>;
13+
module PartialFlow = Global<Config>::FlowExplorationFwd<explorationLimit/0>;
1414

1515
import PartialFlow::PartialPathGraph
1616

java/ql/test/library-tests/dataflow/partial/testRev.expected

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
edges
22
| A.java:4:16:4:18 | this <constr(this)> [post update] [elem] | A.java:22:17:22:25 | new Box(...) [elem] |
33
| A.java:5:19:5:22 | elem | A.java:24:10:24:19 | other.elem |
4-
| A.java:12:5:12:5 | b [post update] : Box [elem] | A.java:13:12:13:12 | b : Box [elem] |
5-
| A.java:12:14:12:18 | src(...) : Object | A.java:12:5:12:5 | b [post update] : Box [elem] |
6-
| A.java:12:14:12:18 | src(...) : Object | A.java:12:5:12:18 | ...=... : Object |
7-
| A.java:13:12:13:12 | b : Box [elem] | A.java:17:13:17:16 | f1(...) : Box [elem] |
8-
| A.java:17:13:17:16 | f1(...) : Box [elem] | A.java:18:8:18:8 | b : Box [elem] |
9-
| A.java:18:8:18:8 | b : Box [elem] | A.java:21:11:21:15 | b : Box [elem] |
104
| A.java:22:17:22:25 | new Box(...) [elem] | A.java:23:13:23:17 | other [elem] |
115
| A.java:23:13:23:17 | other [elem] | A.java:24:10:24:14 | other [elem] |
126
| A.java:23:13:23:17 | other [post update] [elem] | A.java:24:10:24:14 | other [elem] |

java/ql/test/library-tests/dataflow/partial/testRev.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ module Config implements ConfigSig {
1010

1111
int explorationLimit() { result = 10 }
1212

13-
module PartialFlow = Global<Config>::FlowExploration<explorationLimit/0>;
13+
module PartialFlow = Global<Config>::FlowExplorationRev<explorationLimit/0>;
1414

1515
import PartialFlow::PartialPathGraph
1616

1717
from PartialFlow::PartialPathNode n, int dist
18-
where PartialFlow::partialFlowRev(n, _, dist)
18+
where PartialFlow::partialFlow(n, _, dist)
1919
select dist, n

java/ql/test/library-tests/dataflow/state/test.ql

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ int explorationLimit() { result = 0 }
5757

5858
module Flow = TaintTracking::GlobalWithState<Config>;
5959

60-
module PartialFlow = Flow::FlowExploration<explorationLimit/0>;
60+
module PartialFlowFwd = Flow::FlowExplorationFwd<explorationLimit/0>;
61+
62+
module PartialFlowRev = Flow::FlowExplorationRev<explorationLimit/0>;
6163

6264
module HasFlowTest implements TestSig {
6365
string getARelevantTag() { result = ["pFwd", "pRev", "flow"] }
@@ -72,17 +74,17 @@ module HasFlowTest implements TestSig {
7274
)
7375
or
7476
tag = "pFwd" and
75-
exists(PartialFlow::PartialPathNode src, PartialFlow::PartialPathNode node |
76-
PartialFlow::partialFlow(src, node, _) and
77+
exists(PartialFlowFwd::PartialPathNode src, PartialFlowFwd::PartialPathNode node |
78+
PartialFlowFwd::partialFlow(src, node, _) and
7779
checkNode(node.getNode()) and
7880
node.getNode().getLocation() = location and
7981
element = node.toString() and
8082
value = src.getState() + "-" + node.getState()
8183
)
8284
or
8385
tag = "pRev" and
84-
exists(PartialFlow::PartialPathNode node, PartialFlow::PartialPathNode sink |
85-
PartialFlow::partialFlowRev(node, sink, _) and
86+
exists(PartialFlowRev::PartialPathNode node, PartialFlowRev::PartialPathNode sink |
87+
PartialFlowRev::partialFlow(node, sink, _) and
8688
checkNode(node.getNode()) and
8789
node.getNode().getLocation() = location and
8890
element = node.toString() and

0 commit comments

Comments
 (0)