Skip to content

Commit 518aceb

Browse files
committed
Re-factor the Types testcase to use the new API.
1 parent 388cb70 commit 518aceb

File tree

1 file changed

+8
-8
lines changed
  • csharp/ql/test/library-tests/dataflow/types

1 file changed

+8
-8
lines changed

csharp/ql/test/library-tests/dataflow/types/Types.ql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@
33
*/
44

55
import csharp
6-
import DataFlow::PathGraph
6+
import Types::PathGraph
77

8-
class Conf extends DataFlow::Configuration {
9-
Conf() { this = "TypesConf" }
10-
11-
override predicate isSource(DataFlow::Node src) {
8+
module TypesConfig implements DataFlow::ConfigSig {
9+
predicate isSource(DataFlow::Node src) {
1210
src.asExpr() instanceof ObjectCreation or
1311
src.asExpr() instanceof NullLiteral
1412
}
1513

16-
override predicate isSink(DataFlow::Node sink) {
14+
predicate isSink(DataFlow::Node sink) {
1715
exists(MethodCall mc |
1816
mc.getTarget().hasUndecoratedName("Sink") and
1917
mc.getAnArgument() = sink.asExpr()
2018
)
2119
}
2220
}
2321

24-
from DataFlow::PathNode source, DataFlow::PathNode sink, Conf conf
25-
where conf.hasFlowPath(source, sink)
22+
module Types = DataFlow::Global<TypesConfig>;
23+
24+
from Types::PathNode source, Types::PathNode sink
25+
where Types::flowPath(source, sink)
2626
select source, source, sink, "$@", sink, sink.toString()

0 commit comments

Comments
 (0)