diff --git a/csharp/ql/test/library-tests/dataflow/content/ContentFlow.cs b/csharp/ql/test/library-tests/dataflow/content/ContentFlow.cs index 9f73fa1d30e..e3db962193f 100644 --- a/csharp/ql/test/library-tests/dataflow/content/ContentFlow.cs +++ b/csharp/ql/test/library-tests/dataflow/content/ContentFlow.cs @@ -16,16 +16,36 @@ public class ContentFlow public void M(A a, B b) { var a1 = new A(); - Sink(a1.FieldA.FieldB); + Sink(Through(a1.FieldA.FieldB)); a.FieldA.FieldB = new B(); - Sink(a); + Sink(Through(a)); var a2 = new A(); b.FieldB.FieldA = a2.FieldB.FieldA; - Sink(b); + Sink(Through(b)); + + Sink(Through(Out())); + + In(new A().FieldA.FieldB); } public static void Sink(T t) { } + public T Through(T t) + { + Sink(t); + return t; + } + + public void In(T t) + { + Sink(t); + } + + public B Out() + { + var a = new A(); + return a.FieldA.FieldB; + } } diff --git a/csharp/ql/test/library-tests/dataflow/content/ContentFlow.expected b/csharp/ql/test/library-tests/dataflow/content/ContentFlow.expected index 0369650c333..ab2f004f8f2 100644 --- a/csharp/ql/test/library-tests/dataflow/content/ContentFlow.expected +++ b/csharp/ql/test/library-tests/dataflow/content/ContentFlow.expected @@ -1,3 +1,5 @@ -| ContentFlow.cs:18:18:18:24 | object creation of type A | field FieldB.field FieldA. | ContentFlow.cs:19:14:19:29 | access to field FieldB | | true | -| ContentFlow.cs:21:27:21:33 | object creation of type B | | ContentFlow.cs:22:14:22:14 | access to parameter a | field FieldA.field FieldB. | true | -| ContentFlow.cs:24:18:24:24 | object creation of type A | field FieldA.field FieldB. | ContentFlow.cs:26:14:26:14 | access to parameter b | field FieldB.field FieldA. | true | +| ContentFlow.cs:18:18:18:24 | object creation of type A | field FieldB.field FieldA. | ContentFlow.cs:19:14:19:38 | call to method Through | | true | +| ContentFlow.cs:21:27:21:33 | object creation of type B | | ContentFlow.cs:22:14:22:23 | call to method Through | field FieldA.field FieldB. | true | +| ContentFlow.cs:24:18:24:24 | object creation of type A | field FieldA.field FieldB. | ContentFlow.cs:26:14:26:23 | call to method Through | field FieldB.field FieldA. | true | +| ContentFlow.cs:30:12:30:18 | object creation of type A | field FieldB.field FieldA. | ContentFlow.cs:43:14:43:14 | access to parameter t | | true | +| ContentFlow.cs:48:17:48:23 | object creation of type A | field FieldB.field FieldA. | ContentFlow.cs:28:14:28:27 | call to method Through | | true |