@@ -2,7 +2,7 @@ import java
2
2
import semmle.code.java.dataflow.DataFlow
3
3
import semmle.code.java.dataflow.ExternalFlow
4
4
import semmle.code.java.dataflow.TaintTracking
5
- import TestUtilities.InlineExpectationsTest
5
+ import TestUtilities.InlineFlowTest
6
6
7
7
class SummaryModelTest extends SummaryModelCsv {
8
8
override predicate row ( string row ) {
@@ -17,54 +17,4 @@ class SummaryModelTest extends SummaryModelCsv {
17
17
}
18
18
}
19
19
20
- class ValueFlowConf extends DataFlow:: Configuration {
21
- ValueFlowConf ( ) { this = "qltest:valueFlowConf" }
22
-
23
- override predicate isSource ( DataFlow:: Node n ) {
24
- n .asExpr ( ) .( MethodAccess ) .getMethod ( ) .hasName ( "source" )
25
- }
26
-
27
- override predicate isSink ( DataFlow:: Node n ) {
28
- n .asExpr ( ) .( Argument ) .getCall ( ) .getCallee ( ) .hasName ( "sink" )
29
- }
30
-
31
- override int fieldFlowBranchLimit ( ) { result = 1000 }
32
- }
33
-
34
- class TaintFlowConf extends TaintTracking:: Configuration {
35
- TaintFlowConf ( ) { this = "qltest:taintFlowConf" }
36
-
37
- override predicate isSource ( DataFlow:: Node n ) {
38
- n .asExpr ( ) .( MethodAccess ) .getMethod ( ) .hasName ( "source" )
39
- }
40
-
41
- override predicate isSink ( DataFlow:: Node n ) {
42
- n .asExpr ( ) .( Argument ) .getCall ( ) .getCallee ( ) .hasName ( "sink" )
43
- }
44
-
45
- override int fieldFlowBranchLimit ( ) { result = 1000 }
46
- }
47
-
48
- class HasFlowTest extends InlineExpectationsTest {
49
- HasFlowTest ( ) { this = "HasFlowTest" }
50
-
51
- override string getARelevantTag ( ) { result = [ "hasValueFlow" , "hasTaintFlow" ] }
52
-
53
- override predicate hasActualResult ( Location location , string element , string tag , string value ) {
54
- tag = "hasValueFlow" and
55
- exists ( DataFlow:: Node src , DataFlow:: Node sink , ValueFlowConf conf | conf .hasFlow ( src , sink ) |
56
- sink .getLocation ( ) = location and
57
- element = sink .toString ( ) and
58
- value = ""
59
- )
60
- or
61
- tag = "hasTaintFlow" and
62
- exists ( DataFlow:: Node src , DataFlow:: Node sink , TaintFlowConf conf |
63
- conf .hasFlow ( src , sink ) and not any ( ValueFlowConf c ) .hasFlow ( src , sink )
64
- |
65
- sink .getLocation ( ) = location and
66
- element = sink .toString ( ) and
67
- value = ""
68
- )
69
- }
70
- }
20
+ class HasFlowTest extends InlineFlowTest { }
0 commit comments