|
|
|
|
@ -22,12 +22,10 @@ using System.Collections.Immutable;
@@ -22,12 +22,10 @@ using System.Collections.Immutable;
|
|
|
|
|
using System.IO; |
|
|
|
|
using System.Linq; |
|
|
|
|
using System.Reflection.Metadata; |
|
|
|
|
using System.Reflection.PortableExecutable; |
|
|
|
|
using System.Runtime.CompilerServices; |
|
|
|
|
using System.Runtime.InteropServices; |
|
|
|
|
using System.Text; |
|
|
|
|
using ICSharpCode.Decompiler.Metadata; |
|
|
|
|
using ICSharpCode.Decompiler.Semantics; |
|
|
|
|
using ICSharpCode.Decompiler.TypeSystem; |
|
|
|
|
using ICSharpCode.Decompiler.TypeSystem.Implementation; |
|
|
|
|
using NUnit.Framework; |
|
|
|
|
@ -677,6 +675,26 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
@@ -677,6 +675,26 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
|
|
|
|
|
Assert.AreEqual((int)CharSet.Unicode, dllImport.NamedArguments.Single().Value); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void DllImportAttributeWithPreserveSigFalse() |
|
|
|
|
{ |
|
|
|
|
IMethod method = GetTypeDefinition(typeof(NonCustomAttributes)).Methods.Single(m => m.Name == "DoNotPreserveSig"); |
|
|
|
|
IAttribute dllImport = method.GetAttributes().Single(); |
|
|
|
|
Assert.AreEqual("System.Runtime.InteropServices.DllImportAttribute", dllImport.AttributeType.FullName); |
|
|
|
|
Assert.AreEqual("unmanaged.dll", dllImport.FixedArguments[0].Value); |
|
|
|
|
Assert.AreEqual(false, dllImport.NamedArguments.Single().Value); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void PreserveSigAttribute() |
|
|
|
|
{ |
|
|
|
|
IMethod method = GetTypeDefinition(typeof(NonCustomAttributes)).Methods.Single(m => m.Name == "PreserveSigAsAttribute"); |
|
|
|
|
IAttribute preserveSig = method.GetAttributes().Single(); |
|
|
|
|
Assert.AreEqual("System.Runtime.InteropServices.PreserveSigAttribute", preserveSig.AttributeType.FullName); |
|
|
|
|
Assert.IsTrue(preserveSig.FixedArguments.Length == 0); |
|
|
|
|
Assert.IsTrue(preserveSig.NamedArguments.Length == 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void InOutParametersOnRefMethod() |
|
|
|
|
{ |
|
|
|
|
|