Skip to content

Commit e5b84fb

Browse files
committed
Use InlineFlowTest
1 parent 5d73793 commit e5b84fb

File tree

1 file changed

+1
-52
lines changed
  • java/ql/test/library-tests/frameworks/android/uri

1 file changed

+1
-52
lines changed
Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,2 @@
11
import java
2-
import semmle.code.java.dataflow.DataFlow
3-
import semmle.code.java.dataflow.ExternalFlow
4-
import semmle.code.java.dataflow.TaintTracking
5-
import TestUtilities.InlineExpectationsTest
6-
7-
class ValueFlowConf extends DataFlow::Configuration {
8-
ValueFlowConf() { this = "qltest:valueFlowConf" }
9-
10-
override predicate isSource(DataFlow::Node n) {
11-
n.asExpr().(MethodAccess).getMethod().hasName("source")
12-
}
13-
14-
override predicate isSink(DataFlow::Node n) {
15-
n.asExpr().(Argument).getCall().getCallee().hasName("sink")
16-
}
17-
}
18-
19-
class TaintFlowConf extends TaintTracking::Configuration {
20-
TaintFlowConf() { this = "qltest:taintFlowConf" }
21-
22-
override predicate isSource(DataFlow::Node n) {
23-
n.asExpr().(MethodAccess).getMethod().hasName("source")
24-
}
25-
26-
override predicate isSink(DataFlow::Node n) {
27-
n.asExpr().(Argument).getCall().getCallee().hasName("sink")
28-
}
29-
}
30-
31-
class HasFlowTest extends InlineExpectationsTest {
32-
HasFlowTest() { this = "HasFlowTest" }
33-
34-
override string getARelevantTag() { result = ["hasValueFlow", "hasTaintFlow"] }
35-
36-
override predicate hasActualResult(Location location, string element, string tag, string value) {
37-
tag = "hasValueFlow" and
38-
exists(DataFlow::Node src, DataFlow::Node sink, ValueFlowConf conf | conf.hasFlow(src, sink) |
39-
sink.getLocation() = location and
40-
element = sink.toString() and
41-
value = ""
42-
)
43-
or
44-
tag = "hasTaintFlow" and
45-
exists(DataFlow::Node src, DataFlow::Node sink, TaintFlowConf conf |
46-
conf.hasFlow(src, sink) and not any(ValueFlowConf c).hasFlow(src, sink)
47-
|
48-
sink.getLocation() = location and
49-
element = sink.toString() and
50-
value = ""
51-
)
52-
}
53-
}
2+
import TestUtilities.InlineFlowTest

0 commit comments

Comments
 (0)