C#: Move constructor data flow tests to a separate folder.

This commit is contained in:
Michael Nebel
2024-02-02 11:20:44 +01:00
parent afe3c5ea8d
commit 86212b24ba
4 changed files with 73 additions and 56 deletions

View File

@@ -0,0 +1,61 @@
testFailures
edges
| Constructors.cs:5:24:5:25 | [post] this access : C_no_ctor [field s1] : Object | Constructors.cs:9:27:9:41 | object creation of type C_no_ctor : C_no_ctor [field s1] : Object |
| Constructors.cs:5:24:5:25 | [post] this access : C_no_ctor [field s1] : Object | Constructors.cs:9:27:9:41 | object creation of type C_no_ctor : C_no_ctor [field s1] : Object |
| Constructors.cs:5:29:5:45 | call to method Source<Object> : Object | Constructors.cs:5:24:5:25 | [post] this access : C_no_ctor [field s1] : Object |
| Constructors.cs:5:29:5:45 | call to method Source<Object> : Object | Constructors.cs:5:24:5:25 | [post] this access : C_no_ctor [field s1] : Object |
| Constructors.cs:9:27:9:41 | object creation of type C_no_ctor : C_no_ctor [field s1] : Object | Constructors.cs:10:13:10:13 | access to local variable c : C_no_ctor [field s1] : Object |
| Constructors.cs:9:27:9:41 | object creation of type C_no_ctor : C_no_ctor [field s1] : Object | Constructors.cs:10:13:10:13 | access to local variable c : C_no_ctor [field s1] : Object |
| Constructors.cs:10:13:10:13 | access to local variable c : C_no_ctor [field s1] : Object | Constructors.cs:13:21:13:22 | this : C_no_ctor [field s1] : Object |
| Constructors.cs:10:13:10:13 | access to local variable c : C_no_ctor [field s1] : Object | Constructors.cs:13:21:13:22 | this : C_no_ctor [field s1] : Object |
| Constructors.cs:13:21:13:22 | this : C_no_ctor [field s1] : Object | Constructors.cs:15:18:15:19 | this access : C_no_ctor [field s1] : Object |
| Constructors.cs:13:21:13:22 | this : C_no_ctor [field s1] : Object | Constructors.cs:15:18:15:19 | this access : C_no_ctor [field s1] : Object |
| Constructors.cs:15:18:15:19 | this access : C_no_ctor [field s1] : Object | Constructors.cs:15:18:15:19 | access to field s1 |
| Constructors.cs:15:18:15:19 | this access : C_no_ctor [field s1] : Object | Constructors.cs:15:18:15:19 | access to field s1 |
| Constructors.cs:21:24:21:25 | [post] this access : C_with_ctor [field s1] : Object | Constructors.cs:25:29:25:45 | object creation of type C_with_ctor : C_with_ctor [field s1] : Object |
| Constructors.cs:21:24:21:25 | [post] this access : C_with_ctor [field s1] : Object | Constructors.cs:25:29:25:45 | object creation of type C_with_ctor : C_with_ctor [field s1] : Object |
| Constructors.cs:21:29:21:45 | call to method Source<Object> : Object | Constructors.cs:21:24:21:25 | [post] this access : C_with_ctor [field s1] : Object |
| Constructors.cs:21:29:21:45 | call to method Source<Object> : Object | Constructors.cs:21:24:21:25 | [post] this access : C_with_ctor [field s1] : Object |
| Constructors.cs:25:29:25:45 | object creation of type C_with_ctor : C_with_ctor [field s1] : Object | Constructors.cs:26:13:26:13 | access to local variable c : C_with_ctor [field s1] : Object |
| Constructors.cs:25:29:25:45 | object creation of type C_with_ctor : C_with_ctor [field s1] : Object | Constructors.cs:26:13:26:13 | access to local variable c : C_with_ctor [field s1] : Object |
| Constructors.cs:26:13:26:13 | access to local variable c : C_with_ctor [field s1] : Object | Constructors.cs:31:21:31:22 | this : C_with_ctor [field s1] : Object |
| Constructors.cs:26:13:26:13 | access to local variable c : C_with_ctor [field s1] : Object | Constructors.cs:31:21:31:22 | this : C_with_ctor [field s1] : Object |
| Constructors.cs:31:21:31:22 | this : C_with_ctor [field s1] : Object | Constructors.cs:33:18:33:19 | this access : C_with_ctor [field s1] : Object |
| Constructors.cs:31:21:31:22 | this : C_with_ctor [field s1] : Object | Constructors.cs:33:18:33:19 | this access : C_with_ctor [field s1] : Object |
| Constructors.cs:33:18:33:19 | this access : C_with_ctor [field s1] : Object | Constructors.cs:33:18:33:19 | access to field s1 |
| Constructors.cs:33:18:33:19 | this access : C_with_ctor [field s1] : Object | Constructors.cs:33:18:33:19 | access to field s1 |
nodes
| Constructors.cs:5:24:5:25 | [post] this access : C_no_ctor [field s1] : Object | semmle.label | [post] this access : C_no_ctor [field s1] : Object |
| Constructors.cs:5:24:5:25 | [post] this access : C_no_ctor [field s1] : Object | semmle.label | [post] this access : C_no_ctor [field s1] : Object |
| Constructors.cs:5:29:5:45 | call to method Source<Object> : Object | semmle.label | call to method Source<Object> : Object |
| Constructors.cs:5:29:5:45 | call to method Source<Object> : Object | semmle.label | call to method Source<Object> : Object |
| Constructors.cs:9:27:9:41 | object creation of type C_no_ctor : C_no_ctor [field s1] : Object | semmle.label | object creation of type C_no_ctor : C_no_ctor [field s1] : Object |
| Constructors.cs:9:27:9:41 | object creation of type C_no_ctor : C_no_ctor [field s1] : Object | semmle.label | object creation of type C_no_ctor : C_no_ctor [field s1] : Object |
| Constructors.cs:10:13:10:13 | access to local variable c : C_no_ctor [field s1] : Object | semmle.label | access to local variable c : C_no_ctor [field s1] : Object |
| Constructors.cs:10:13:10:13 | access to local variable c : C_no_ctor [field s1] : Object | semmle.label | access to local variable c : C_no_ctor [field s1] : Object |
| Constructors.cs:13:21:13:22 | this : C_no_ctor [field s1] : Object | semmle.label | this : C_no_ctor [field s1] : Object |
| Constructors.cs:13:21:13:22 | this : C_no_ctor [field s1] : Object | semmle.label | this : C_no_ctor [field s1] : Object |
| Constructors.cs:15:18:15:19 | access to field s1 | semmle.label | access to field s1 |
| Constructors.cs:15:18:15:19 | access to field s1 | semmle.label | access to field s1 |
| Constructors.cs:15:18:15:19 | this access : C_no_ctor [field s1] : Object | semmle.label | this access : C_no_ctor [field s1] : Object |
| Constructors.cs:15:18:15:19 | this access : C_no_ctor [field s1] : Object | semmle.label | this access : C_no_ctor [field s1] : Object |
| Constructors.cs:21:24:21:25 | [post] this access : C_with_ctor [field s1] : Object | semmle.label | [post] this access : C_with_ctor [field s1] : Object |
| Constructors.cs:21:24:21:25 | [post] this access : C_with_ctor [field s1] : Object | semmle.label | [post] this access : C_with_ctor [field s1] : Object |
| Constructors.cs:21:29:21:45 | call to method Source<Object> : Object | semmle.label | call to method Source<Object> : Object |
| Constructors.cs:21:29:21:45 | call to method Source<Object> : Object | semmle.label | call to method Source<Object> : Object |
| Constructors.cs:25:29:25:45 | object creation of type C_with_ctor : C_with_ctor [field s1] : Object | semmle.label | object creation of type C_with_ctor : C_with_ctor [field s1] : Object |
| Constructors.cs:25:29:25:45 | object creation of type C_with_ctor : C_with_ctor [field s1] : Object | semmle.label | object creation of type C_with_ctor : C_with_ctor [field s1] : Object |
| Constructors.cs:26:13:26:13 | access to local variable c : C_with_ctor [field s1] : Object | semmle.label | access to local variable c : C_with_ctor [field s1] : Object |
| Constructors.cs:26:13:26:13 | access to local variable c : C_with_ctor [field s1] : Object | semmle.label | access to local variable c : C_with_ctor [field s1] : Object |
| Constructors.cs:31:21:31:22 | this : C_with_ctor [field s1] : Object | semmle.label | this : C_with_ctor [field s1] : Object |
| Constructors.cs:31:21:31:22 | this : C_with_ctor [field s1] : Object | semmle.label | this : C_with_ctor [field s1] : Object |
| Constructors.cs:33:18:33:19 | access to field s1 | semmle.label | access to field s1 |
| Constructors.cs:33:18:33:19 | access to field s1 | semmle.label | access to field s1 |
| Constructors.cs:33:18:33:19 | this access : C_with_ctor [field s1] : Object | semmle.label | this access : C_with_ctor [field s1] : Object |
| Constructors.cs:33:18:33:19 | this access : C_with_ctor [field s1] : Object | semmle.label | this access : C_with_ctor [field s1] : Object |
subpaths
#select
| Constructors.cs:15:18:15:19 | access to field s1 | Constructors.cs:5:29:5:45 | call to method Source<Object> : Object | Constructors.cs:15:18:15:19 | access to field s1 | $@ | Constructors.cs:5:29:5:45 | call to method Source<Object> : Object | call to method Source<Object> : Object |
| Constructors.cs:15:18:15:19 | access to field s1 | Constructors.cs:5:29:5:45 | call to method Source<Object> : Object | Constructors.cs:15:18:15:19 | access to field s1 | $@ | Constructors.cs:5:29:5:45 | call to method Source<Object> : Object | call to method Source<Object> : Object |
| Constructors.cs:33:18:33:19 | access to field s1 | Constructors.cs:21:29:21:45 | call to method Source<Object> : Object | Constructors.cs:33:18:33:19 | access to field s1 | $@ | Constructors.cs:21:29:21:45 | call to method Source<Object> : Object | call to method Source<Object> : Object |
| Constructors.cs:33:18:33:19 | access to field s1 | Constructors.cs:21:29:21:45 | call to method Source<Object> : Object | Constructors.cs:33:18:33:19 | access to field s1 | $@ | Constructors.cs:21:29:21:45 | call to method Source<Object> : Object | call to method Source<Object> : Object |

View File

@@ -0,0 +1,12 @@
/**
* @kind path-problem
*/
import csharp
import TestUtilities.InlineFlowTest
import DefaultFlowTest
import PathGraph
from PathNode source, PathNode sink
where flowPath(source, sink)
select sink, source, sink, "$@", source, source.toString()

View File

@@ -308,30 +308,6 @@ edges
| C.cs:25:14:25:15 | this access : C [field s3] : Elem | C.cs:25:14:25:15 | access to field s3 | provenance | |
| C.cs:27:14:27:15 | this access : C [property s5] : Elem | C.cs:27:14:27:15 | access to property s5 | provenance | |
| C.cs:27:14:27:15 | this access : C [property s5] : Elem | C.cs:27:14:27:15 | access to property s5 | provenance | |
| C_ctor.cs:5:24:5:25 | [post] this access : C_no_ctor [field s1] : Object | C_ctor.cs:9:27:9:41 | object creation of type C_no_ctor : C_no_ctor [field s1] : Object | provenance | |
| C_ctor.cs:5:24:5:25 | [post] this access : C_no_ctor [field s1] : Object | C_ctor.cs:9:27:9:41 | object creation of type C_no_ctor : C_no_ctor [field s1] : Object | provenance | |
| C_ctor.cs:5:29:5:45 | call to method Source<Object> : Object | C_ctor.cs:5:24:5:25 | [post] this access : C_no_ctor [field s1] : Object | provenance | |
| C_ctor.cs:5:29:5:45 | call to method Source<Object> : Object | C_ctor.cs:5:24:5:25 | [post] this access : C_no_ctor [field s1] : Object | provenance | |
| C_ctor.cs:9:27:9:41 | object creation of type C_no_ctor : C_no_ctor [field s1] : Object | C_ctor.cs:10:13:10:13 | access to local variable c : C_no_ctor [field s1] : Object | provenance | |
| C_ctor.cs:9:27:9:41 | object creation of type C_no_ctor : C_no_ctor [field s1] : Object | C_ctor.cs:10:13:10:13 | access to local variable c : C_no_ctor [field s1] : Object | provenance | |
| C_ctor.cs:10:13:10:13 | access to local variable c : C_no_ctor [field s1] : Object | C_ctor.cs:13:21:13:22 | this : C_no_ctor [field s1] : Object | provenance | |
| C_ctor.cs:10:13:10:13 | access to local variable c : C_no_ctor [field s1] : Object | C_ctor.cs:13:21:13:22 | this : C_no_ctor [field s1] : Object | provenance | |
| C_ctor.cs:13:21:13:22 | this : C_no_ctor [field s1] : Object | C_ctor.cs:15:18:15:19 | this access : C_no_ctor [field s1] : Object | provenance | |
| C_ctor.cs:13:21:13:22 | this : C_no_ctor [field s1] : Object | C_ctor.cs:15:18:15:19 | this access : C_no_ctor [field s1] : Object | provenance | |
| C_ctor.cs:15:18:15:19 | this access : C_no_ctor [field s1] : Object | C_ctor.cs:15:18:15:19 | access to field s1 | provenance | |
| C_ctor.cs:15:18:15:19 | this access : C_no_ctor [field s1] : Object | C_ctor.cs:15:18:15:19 | access to field s1 | provenance | |
| C_ctor.cs:21:24:21:25 | [post] this access : C_with_ctor [field s1] : Object | C_ctor.cs:25:29:25:45 | object creation of type C_with_ctor : C_with_ctor [field s1] : Object | provenance | |
| C_ctor.cs:21:24:21:25 | [post] this access : C_with_ctor [field s1] : Object | C_ctor.cs:25:29:25:45 | object creation of type C_with_ctor : C_with_ctor [field s1] : Object | provenance | |
| C_ctor.cs:21:29:21:45 | call to method Source<Object> : Object | C_ctor.cs:21:24:21:25 | [post] this access : C_with_ctor [field s1] : Object | provenance | |
| C_ctor.cs:21:29:21:45 | call to method Source<Object> : Object | C_ctor.cs:21:24:21:25 | [post] this access : C_with_ctor [field s1] : Object | provenance | |
| C_ctor.cs:25:29:25:45 | object creation of type C_with_ctor : C_with_ctor [field s1] : Object | C_ctor.cs:26:13:26:13 | access to local variable c : C_with_ctor [field s1] : Object | provenance | |
| C_ctor.cs:25:29:25:45 | object creation of type C_with_ctor : C_with_ctor [field s1] : Object | C_ctor.cs:26:13:26:13 | access to local variable c : C_with_ctor [field s1] : Object | provenance | |
| C_ctor.cs:26:13:26:13 | access to local variable c : C_with_ctor [field s1] : Object | C_ctor.cs:31:21:31:22 | this : C_with_ctor [field s1] : Object | provenance | |
| C_ctor.cs:26:13:26:13 | access to local variable c : C_with_ctor [field s1] : Object | C_ctor.cs:31:21:31:22 | this : C_with_ctor [field s1] : Object | provenance | |
| C_ctor.cs:31:21:31:22 | this : C_with_ctor [field s1] : Object | C_ctor.cs:33:18:33:19 | this access : C_with_ctor [field s1] : Object | provenance | |
| C_ctor.cs:31:21:31:22 | this : C_with_ctor [field s1] : Object | C_ctor.cs:33:18:33:19 | this access : C_with_ctor [field s1] : Object | provenance | |
| C_ctor.cs:33:18:33:19 | this access : C_with_ctor [field s1] : Object | C_ctor.cs:33:18:33:19 | access to field s1 | provenance | |
| C_ctor.cs:33:18:33:19 | this access : C_with_ctor [field s1] : Object | C_ctor.cs:33:18:33:19 | access to field s1 | provenance | |
| D.cs:8:9:8:11 | this : D [field trivialPropField] : Object | D.cs:8:22:8:25 | this access : D [field trivialPropField] : Object | provenance | |
| D.cs:8:9:8:11 | this : D [field trivialPropField] : Object | D.cs:8:22:8:25 | this access : D [field trivialPropField] : Object | provenance | |
| D.cs:8:22:8:25 | this access : D [field trivialPropField] : Object | D.cs:8:22:8:42 | access to field trivialPropField : Object | provenance | |
@@ -1281,34 +1257,6 @@ nodes
| C.cs:27:14:27:15 | this access : C [property s5] : Elem | semmle.label | this access : C [property s5] : Elem |
| C.cs:28:14:28:15 | access to property s6 | semmle.label | access to property s6 |
| C.cs:28:14:28:15 | access to property s6 | semmle.label | access to property s6 |
| C_ctor.cs:5:24:5:25 | [post] this access : C_no_ctor [field s1] : Object | semmle.label | [post] this access : C_no_ctor [field s1] : Object |
| C_ctor.cs:5:24:5:25 | [post] this access : C_no_ctor [field s1] : Object | semmle.label | [post] this access : C_no_ctor [field s1] : Object |
| C_ctor.cs:5:29:5:45 | call to method Source<Object> : Object | semmle.label | call to method Source<Object> : Object |
| C_ctor.cs:5:29:5:45 | call to method Source<Object> : Object | semmle.label | call to method Source<Object> : Object |
| C_ctor.cs:9:27:9:41 | object creation of type C_no_ctor : C_no_ctor [field s1] : Object | semmle.label | object creation of type C_no_ctor : C_no_ctor [field s1] : Object |
| C_ctor.cs:9:27:9:41 | object creation of type C_no_ctor : C_no_ctor [field s1] : Object | semmle.label | object creation of type C_no_ctor : C_no_ctor [field s1] : Object |
| C_ctor.cs:10:13:10:13 | access to local variable c : C_no_ctor [field s1] : Object | semmle.label | access to local variable c : C_no_ctor [field s1] : Object |
| C_ctor.cs:10:13:10:13 | access to local variable c : C_no_ctor [field s1] : Object | semmle.label | access to local variable c : C_no_ctor [field s1] : Object |
| C_ctor.cs:13:21:13:22 | this : C_no_ctor [field s1] : Object | semmle.label | this : C_no_ctor [field s1] : Object |
| C_ctor.cs:13:21:13:22 | this : C_no_ctor [field s1] : Object | semmle.label | this : C_no_ctor [field s1] : Object |
| C_ctor.cs:15:18:15:19 | access to field s1 | semmle.label | access to field s1 |
| C_ctor.cs:15:18:15:19 | access to field s1 | semmle.label | access to field s1 |
| C_ctor.cs:15:18:15:19 | this access : C_no_ctor [field s1] : Object | semmle.label | this access : C_no_ctor [field s1] : Object |
| C_ctor.cs:15:18:15:19 | this access : C_no_ctor [field s1] : Object | semmle.label | this access : C_no_ctor [field s1] : Object |
| C_ctor.cs:21:24:21:25 | [post] this access : C_with_ctor [field s1] : Object | semmle.label | [post] this access : C_with_ctor [field s1] : Object |
| C_ctor.cs:21:24:21:25 | [post] this access : C_with_ctor [field s1] : Object | semmle.label | [post] this access : C_with_ctor [field s1] : Object |
| C_ctor.cs:21:29:21:45 | call to method Source<Object> : Object | semmle.label | call to method Source<Object> : Object |
| C_ctor.cs:21:29:21:45 | call to method Source<Object> : Object | semmle.label | call to method Source<Object> : Object |
| C_ctor.cs:25:29:25:45 | object creation of type C_with_ctor : C_with_ctor [field s1] : Object | semmle.label | object creation of type C_with_ctor : C_with_ctor [field s1] : Object |
| C_ctor.cs:25:29:25:45 | object creation of type C_with_ctor : C_with_ctor [field s1] : Object | semmle.label | object creation of type C_with_ctor : C_with_ctor [field s1] : Object |
| C_ctor.cs:26:13:26:13 | access to local variable c : C_with_ctor [field s1] : Object | semmle.label | access to local variable c : C_with_ctor [field s1] : Object |
| C_ctor.cs:26:13:26:13 | access to local variable c : C_with_ctor [field s1] : Object | semmle.label | access to local variable c : C_with_ctor [field s1] : Object |
| C_ctor.cs:31:21:31:22 | this : C_with_ctor [field s1] : Object | semmle.label | this : C_with_ctor [field s1] : Object |
| C_ctor.cs:31:21:31:22 | this : C_with_ctor [field s1] : Object | semmle.label | this : C_with_ctor [field s1] : Object |
| C_ctor.cs:33:18:33:19 | access to field s1 | semmle.label | access to field s1 |
| C_ctor.cs:33:18:33:19 | access to field s1 | semmle.label | access to field s1 |
| C_ctor.cs:33:18:33:19 | this access : C_with_ctor [field s1] : Object | semmle.label | this access : C_with_ctor [field s1] : Object |
| C_ctor.cs:33:18:33:19 | this access : C_with_ctor [field s1] : Object | semmle.label | this access : C_with_ctor [field s1] : Object |
| D.cs:8:9:8:11 | this : D [field trivialPropField] : Object | semmle.label | this : D [field trivialPropField] : Object |
| D.cs:8:9:8:11 | this : D [field trivialPropField] : Object | semmle.label | this : D [field trivialPropField] : Object |
| D.cs:8:22:8:25 | this access : D [field trivialPropField] : Object | semmle.label | this access : D [field trivialPropField] : Object |
@@ -2121,10 +2069,6 @@ subpaths
| C.cs:27:14:27:15 | access to property s5 | C.cs:7:37:7:51 | call to method Source<Elem> : Elem | C.cs:27:14:27:15 | access to property s5 | $@ | C.cs:7:37:7:51 | call to method Source<Elem> : Elem | call to method Source<Elem> : Elem |
| C.cs:28:14:28:15 | access to property s6 | C.cs:8:30:8:44 | call to method Source<Elem> : Elem | C.cs:28:14:28:15 | access to property s6 | $@ | C.cs:8:30:8:44 | call to method Source<Elem> : Elem | call to method Source<Elem> : Elem |
| C.cs:28:14:28:15 | access to property s6 | C.cs:8:30:8:44 | call to method Source<Elem> : Elem | C.cs:28:14:28:15 | access to property s6 | $@ | C.cs:8:30:8:44 | call to method Source<Elem> : Elem | call to method Source<Elem> : Elem |
| C_ctor.cs:15:18:15:19 | access to field s1 | C_ctor.cs:5:29:5:45 | call to method Source<Object> : Object | C_ctor.cs:15:18:15:19 | access to field s1 | $@ | C_ctor.cs:5:29:5:45 | call to method Source<Object> : Object | call to method Source<Object> : Object |
| C_ctor.cs:15:18:15:19 | access to field s1 | C_ctor.cs:5:29:5:45 | call to method Source<Object> : Object | C_ctor.cs:15:18:15:19 | access to field s1 | $@ | C_ctor.cs:5:29:5:45 | call to method Source<Object> : Object | call to method Source<Object> : Object |
| C_ctor.cs:33:18:33:19 | access to field s1 | C_ctor.cs:21:29:21:45 | call to method Source<Object> : Object | C_ctor.cs:33:18:33:19 | access to field s1 | $@ | C_ctor.cs:21:29:21:45 | call to method Source<Object> : Object | call to method Source<Object> : Object |
| C_ctor.cs:33:18:33:19 | access to field s1 | C_ctor.cs:21:29:21:45 | call to method Source<Object> : Object | C_ctor.cs:33:18:33:19 | access to field s1 | $@ | C_ctor.cs:21:29:21:45 | call to method Source<Object> : Object | call to method Source<Object> : Object |
| D.cs:32:14:32:23 | access to property AutoProp | D.cs:29:17:29:33 | call to method Source<Object> : Object | D.cs:32:14:32:23 | access to property AutoProp | $@ | D.cs:29:17:29:33 | call to method Source<Object> : Object | call to method Source<Object> : Object |
| D.cs:32:14:32:23 | access to property AutoProp | D.cs:29:17:29:33 | call to method Source<Object> : Object | D.cs:32:14:32:23 | access to property AutoProp | $@ | D.cs:29:17:29:33 | call to method Source<Object> : Object | call to method Source<Object> : Object |
| D.cs:39:14:39:26 | access to property TrivialProp | D.cs:37:26:37:42 | call to method Source<Object> : Object | D.cs:39:14:39:26 | access to property TrivialProp | $@ | D.cs:37:26:37:42 | call to method Source<Object> : Object | call to method Source<Object> : Object |