C#: Update ContentDataFlow test

Illustrates missing flow when the sink is inside a method that is also part of
a `subpath`.
This commit is contained in:
Tom Hvitved
2022-05-23 13:03:56 +02:00
parent 909ad2a61a
commit 9cc9991c74
2 changed files with 28 additions and 6 deletions

View File

@@ -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 t) { }
public T Through<T>(T t)
{
Sink(t);
return t;
}
public void In<T>(T t)
{
Sink(t);
}
public B Out()
{
var a = new A();
return a.FieldA.FieldB;
}
}

View File

@@ -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<B> | | true |
| ContentFlow.cs:21:27:21:33 | object creation of type B | | ContentFlow.cs:22:14:22:23 | call to method Through<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:23 | call to method Through<B> | 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<B> | | true |