Skip to content

Commit 3767714

Browse files
committed
C#: Update QL tests.
1 parent 58a1353 commit 3767714

File tree

6 files changed

+16
-22
lines changed

6 files changed

+16
-22
lines changed

csharp/ql/consistency-queries/DataFlowConsistency.ql

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ private module Input implements InputSig<CsharpDataFlow> {
3131
n instanceof FlowInsensitiveFieldNode
3232
}
3333

34-
predicate missingLocationExclude(Node n) {
35-
// Some CIL methods are missing locations
36-
n.asParameter() instanceof CIL::Parameter
37-
}
34+
predicate missingLocationExclude(Node n) { none() }
3835

3936
predicate postWithInFlowExclude(Node n) {
4037
n instanceof FlowSummaryNode
@@ -48,8 +45,6 @@ private module Input implements InputSig<CsharpDataFlow> {
4845
not exists(LocalFlow::getAPostUpdateNodeForArg(n.getControlFlowNode()))
4946
or
5047
n instanceof ParamsArgumentNode
51-
or
52-
n.asExpr() instanceof CIL::Expr
5348
}
5449

5550
predicate postHasUniquePreExclude(PostUpdateNode n) {

csharp/ql/test/library-tests/cil/consistency/Handles.expected

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ tooManyMatchingHandles
33
missingCil
44
csharpLocationViolation
55
matchingObjectMethods
6-
| Equals(object) | System.Boolean System.Object.Equals(System.Object) |
7-
| Equals(object, object) | System.Boolean System.Object.Equals(System.Object,System.Object) |
8-
| GetHashCode() | System.Int32 System.Object.GetHashCode() |
9-
| GetType() | System.Type System.Object.GetType() |
10-
| MemberwiseClone() | System.Object System.Object.MemberwiseClone() |
11-
| Object() | System.Void System.Object..ctor() |
12-
| ReferenceEquals(object, object) | System.Boolean System.Object.ReferenceEquals(System.Object,System.Object) |
13-
| ToString() | System.String System.Object.ToString() |
14-
| ~Object() | System.Void System.Object.Finalize() |
6+
| System.Boolean System.Object.Equals(System.Object) | System.Boolean System.Object.Equals(System.Object) |
7+
| System.Boolean System.Object.Equals(System.Object,System.Object) | System.Boolean System.Object.Equals(System.Object,System.Object) |
8+
| System.Boolean System.Object.ReferenceEquals(System.Object,System.Object) | System.Boolean System.Object.ReferenceEquals(System.Object,System.Object) |
9+
| System.Int32 System.Object.GetHashCode() | System.Int32 System.Object.GetHashCode() |
10+
| System.Object System.Object.MemberwiseClone() | System.Object System.Object.MemberwiseClone() |
11+
| System.String System.Object.ToString() | System.String System.Object.ToString() |
12+
| System.Type System.Object.GetType() | System.Type System.Object.GetType() |
13+
| System.Void System.Object..ctor() | System.Void System.Object..ctor() |
14+
| System.Void System.Object.Finalize() | System.Void System.Object.Finalize() |

csharp/ql/test/library-tests/cil/consistency/Handles.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ query predicate csharpLocationViolation(Element e) {
5959
}
6060

6161
query predicate matchingObjectMethods(string s1, string s2) {
62-
exists(Callable m1, CIL::Method m2 |
62+
exists(DotNet::Callable m1, CIL::Method m2 |
6363
m1.getDeclaringType().hasFullyQualifiedName("System", "Object") and
6464
m1.matchesHandle(m2) and
6565
s1 = m1.toStringWithTypes() and

csharp/ql/test/library-tests/commons/Disposal/DisposedParameter.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import dotnet
1+
import csharp
22
import semmle.code.csharp.commons.Disposal
33

4-
from DotNet::Callable c, DotNet::Parameter param, int p
4+
from Callable c, Parameter param, int p
55
where
66
mayBeDisposed(param) and
77
param = c.getParameter(p) and

csharp/ql/test/library-tests/commons/Disposal/UndisposedParameter.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import dotnet
1+
import csharp
22
import semmle.code.csharp.commons.Disposal
3-
import cil
43

5-
from DotNet::Callable c, DotNet::Parameter param, int p
4+
from Callable c, Parameter param, int p
65
where
76
not mayBeDisposed(param) and
87
param = c.getParameter(p) and

csharp/ql/test/library-tests/members/GetLabel.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import dotnet::DotNet
1+
import csharp
22

33
from NamedElement ne
44
where ne.fromSource()

0 commit comments

Comments
 (0)