Skip to content

Commit e42afa3

Browse files
committed
C#: Adjustments to test cases.
1 parent 09239ba commit e42afa3

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

csharp/ql/test/library-tests/cil/attributes/attribute.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ private predicate isOsSpecific(Declaration d) {
55
d.getFullyQualifiedName()
66
.matches("%" +
77
[
8-
"libobjc", "libproc", "libc", "Interop.Sys",
8+
"libobjc", "libproc", "libc", "Interop.OSReleaseFile", "Interop.Sys",
99
"System.Runtime.InteropServices.ObjectiveC.ObjectiveCMarshal",
1010
"System.Diagnostics.Tracing.XplatEventLogger", "System.Threading.AutoreleasePool",
1111
"System.CLRConfig", "System.Diagnostics.Tracing.EventSource.<WriteEventString>",
12+
"System.IO.FileSystem.<TryCloneFile>"
1213
] + "%")
1314
}
1415

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
import semmle.code.cil.Types
22
import semmle.code.csharp.commons.QualifiedName
33

4+
predicate osSpecific(string qualifier, string name) {
5+
qualifier = "Interop.Sys" and
6+
(
7+
name = "LockType" or // doesn't exist on osx
8+
name = "NSSearchPathDirectory" // doesn't exist on linux.
9+
)
10+
}
11+
412
from Enum e, string qualifier, string name
513
where
614
e.hasFullyQualifiedName(qualifier, name) and
7-
not (qualifier = "Interop.Sys" and name = "LockType") // doesn't exist on osx
15+
not osSpecific(qualifier, name)
816
select getQualifiedName(qualifier, name), e.getUnderlyingType().toStringWithTypes()

csharp/ql/test/library-tests/cil/typeAnnotations/typeAnnotations.ql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,20 @@ private predicate exclude(string s) {
5858
"Parameter 1 of System.CLRConfig.GetConfigBoolValue",
5959
"Parameter 1 of System.Runtime.InteropServices.ObjectiveC.ObjectiveCMarshal.CreateReferenceTrackingHandleInternal",
6060
"Parameter 2 of System.Runtime.InteropServices.ObjectiveC.ObjectiveCMarshal.CreateReferenceTrackingHandleInternal",
61+
"Parameter 2 of Interop.OSReleaseFile.<GetPrettyName>g__TryGetFieldValue|1_0",
6162
"Parameter 2 of System.Runtime.InteropServices.ObjectiveC.ObjectiveCMarshal.InvokeUnhandledExceptionPropagation",
63+
"Parameter 3 of System.IO.FileSystem.<TryCloneFile>g__TryCloneFile|5_0",
64+
"Parameter 3 of System.IO.FileSystem.TryCloneFile",
65+
"Parameter 6 of Microsoft.Win32.SafeHandles.SafeFileHandle.OpenNoFollowSymlink",
6266
"Local variable 1 of method Interop.libobjc.NSOperatingSystemVersion_objc_msgSend_stret",
6367
"Local variable 1 of method System.Diagnostics.Tracing.XplatEventLogger.LogEventSource",
6468
"Local variable 2 of method System.Runtime.InteropServices.ObjectiveC.ObjectiveCMarshal.CreateReferenceTrackingHandleInternal",
6569
"Local variable 3 of method System.Diagnostics.Tracing.XplatEventLogger.LogEventSource",
6670
"Local variable 4 of method System.CLRConfig.GetConfigBoolValue",
6771
"Local variable 4 of method System.Runtime.InteropServices.ObjectiveC.ObjectiveCMarshal.CreateReferenceTrackingHandleInternal",
72+
"Local variable 5 of method Interop.OSReleaseFile.<GetPrettyName>g__TryGetFieldValue|1_0",
6873
"Local variable 5 of method System.Diagnostics.Tracing.XplatEventLogger.LogEventSource",
74+
"Local variable 13 of method Interop.procfs.TryParseStatusFile",
6975
"Parameter 0 of System.Diagnostics.Tracing.XplatEventLogger.AppendByteArrayAsHexString",
7076
"Parameter 1 of System.Diagnostics.Tracing.XplatEventLogger.MinimalJsonserializer"
7177
]

csharp/ql/test/library-tests/conversion/operator/Operator.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ where
1313

1414
s2 != "FormatParam" and
1515
s2 != "StringOrCharArray" and
16-
s2 != "EventSourceActivity"
16+
s2 != "EventSourceActivity" and
17+
s2 != "EventSourcePrimitive"
1718
select s1, s2 order by s1, s2

0 commit comments

Comments
 (0)