From db96edff1520dbed235ee5c7cf57adca15f840ea Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Thu, 26 Oct 2023 17:06:53 -0700 Subject: [PATCH 01/19] Merge 8 subfolders of Interop into the merged runner itself. Remove some "process isolation" entries that were added for transition but are not required. --- .../Common/CoreCLRTestLibrary/Utilities.cs | 26 ++++++ .../BoolArray/MarshalBoolArrayTest.cs | 13 +-- .../BoolArray/MarshalBoolArrayTest.csproj | 14 --- .../SafeArray/SafeArrayTest.cs | 2 + .../SafeArray/SafeArrayTest.csproj | 15 ---- .../StructArray/MarshalStructArrayTest.csproj | 12 --- src/tests/Interop/COM/Directory.Build.targets | 4 + .../ConsumeNETServer/ConsumeNETServer.csproj | 2 +- .../NativeClients/DefaultInterfaces.csproj | 4 - .../COM/NativeClients/Directory.Build.props | 2 + .../Interop/COM/NativeClients/Dispatch.csproj | 4 - .../Interop/COM/NativeClients/Events.csproj | 4 - .../COM/NativeClients/Licensing.csproj | 4 - .../COM/NativeClients/Primitives.csproj | 4 - .../DllImportPath/DllImportPathTest.csproj | 5 +- .../IDynamicInterfaceCastable.csproj | 13 --- .../IDynamicInterfaceCastable/Program.cs | 42 +++------ src/tests/Interop/Interop.csproj | 25 ++++++ .../Interop/LayoutClass/LayoutClassTest.cs | 49 ++++------ .../LayoutClass/LayoutClassTest.csproj | 14 --- .../FunctionPointer/FunctionPtrTest.csproj | 14 --- .../MarshalAPI/IUnknown/IUnknownTest.cs | 54 ++++++----- .../MarshalAPI/IUnknown/IUnknownTest.csproj | 18 ---- .../IUnknown/IUnknownTestInALC.csproj | 18 ---- .../Interop/MarshalAPI/IUnknown/TestInALC.cs | 18 ---- .../Miscellaneous/CopyCtor/CopyCtorTest.cs | 6 +- .../CopyCtor/CopyCtorTest.csproj | 2 - .../PInvoke/Invalid/InvalidParamIndex.cs | 9 +- .../PInvoke/Invalid/InvalidParamIndex.csproj | 4 - .../Interop/RefCharArray/RefCharArrayTest.cs | 19 ++-- .../RefCharArray/RefCharArrayTest.csproj | 15 ---- .../Interop/SimpleStruct/SimpleStruct.csproj | 15 ---- .../SimpleStruct/SimpleStructManaged.cs | 1 + .../AnsiBSTR/AnsiBStrTest.cs | 17 +--- .../AnsiBSTR/AnsiBStrTest.csproj | 6 +- .../StringMarshalling/BSTR/BSTRTest.cs | 26 ------ .../StringMarshalling/BSTR/BSTRTest.csproj | 7 +- .../Common/CommonStringTests.cs | 89 ------------------- .../Common/StringBuilderTests.cs | 43 +++++++++ .../Common/StringInStructTests.cs | 34 +++++++ .../StringMarshalling/Common/StringTests.cs | 73 +++++++++++++++ .../StringMarshalling/LPSTR/LPSTRTest.cs | 26 ------ .../StringMarshalling/LPSTR/LPSTRTest.csproj | 3 - .../StringMarshalling/LPTSTR/LPTSTRTest.cs | 40 +++++---- .../LPTSTR/LPTSTRTest.csproj | 4 - .../StringMarshalling/UTF8/UTF8Test.cs | 1 + .../StringMarshalling/UTF8/UTF8Test.csproj | 4 - .../VBByRefStr/VBByRefStrTest.cs | 3 + .../VBByRefStr/VBByRefStrTest.csproj | 7 -- .../Interop/StructPacking/StructPacking.cs | 2 +- .../StructPacking/StructPacking.csproj | 10 --- .../SuppressGCTransitionNegativeTest.csproj | 2 +- src/tests/Interop/WinRT/Program.cs | 13 +-- src/tests/Interop/WinRT/WinRT.csproj | 11 --- 54 files changed, 341 insertions(+), 531 deletions(-) delete mode 100644 src/tests/Interop/ArrayMarshalling/BoolArray/MarshalBoolArrayTest.csproj delete mode 100644 src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.csproj delete mode 100644 src/tests/Interop/ArrayMarshalling/StructArray/MarshalStructArrayTest.csproj delete mode 100644 src/tests/Interop/IDynamicInterfaceCastable/IDynamicInterfaceCastable.csproj delete mode 100644 src/tests/Interop/LayoutClass/LayoutClassTest.csproj delete mode 100644 src/tests/Interop/MarshalAPI/FunctionPointer/FunctionPtrTest.csproj delete mode 100644 src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.csproj delete mode 100644 src/tests/Interop/MarshalAPI/IUnknown/IUnknownTestInALC.csproj delete mode 100644 src/tests/Interop/MarshalAPI/IUnknown/TestInALC.cs delete mode 100644 src/tests/Interop/RefCharArray/RefCharArrayTest.csproj delete mode 100644 src/tests/Interop/SimpleStruct/SimpleStruct.csproj delete mode 100644 src/tests/Interop/StringMarshalling/BSTR/BSTRTest.cs delete mode 100644 src/tests/Interop/StringMarshalling/Common/CommonStringTests.cs create mode 100644 src/tests/Interop/StringMarshalling/Common/StringBuilderTests.cs create mode 100644 src/tests/Interop/StringMarshalling/Common/StringInStructTests.cs create mode 100644 src/tests/Interop/StringMarshalling/Common/StringTests.cs delete mode 100644 src/tests/Interop/StringMarshalling/LPSTR/LPSTRTest.cs delete mode 100644 src/tests/Interop/StructPacking/StructPacking.csproj delete mode 100644 src/tests/Interop/WinRT/WinRT.csproj diff --git a/src/tests/Common/CoreCLRTestLibrary/Utilities.cs b/src/tests/Common/CoreCLRTestLibrary/Utilities.cs index c298a46abca874..236bb9d118cdbb 100644 --- a/src/tests/Common/CoreCLRTestLibrary/Utilities.cs +++ b/src/tests/Common/CoreCLRTestLibrary/Utilities.cs @@ -95,6 +95,7 @@ public static bool IsWindowsIoTCore public static bool IsMonoRuntime => Type.GetType("Mono.RuntimeStructs") != null; public static bool IsNotMonoRuntime => !IsMonoRuntime; public static bool IsNativeAot => IsNotMonoRuntime && !IsReflectionEmitSupported; + public static bool IsNotNativeAot => !IsNativeAot; public static bool HasAssemblyFiles => !string.IsNullOrEmpty(typeof(Utilities).Assembly.Location); public static bool IsSingleFile => !HasAssemblyFiles; @@ -456,5 +457,30 @@ public static int ExecuteAndUnload(string assemblyPath, string[] args, Action - - - true - 1 - - - - - - - - - diff --git a/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.cs b/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.cs index be5eb00aa71396..77de22fb8264b4 100644 --- a/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.cs +++ b/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.cs @@ -12,6 +12,8 @@ public class Tester { [Fact] + [PlatformSpecific(TestPlatforms.Windows)] + [SkipOnMono("Requires COM support")] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.csproj b/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.csproj deleted file mode 100644 index 9c1c7fa25b0633..00000000000000 --- a/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - true - - true - - - - - - - - - diff --git a/src/tests/Interop/ArrayMarshalling/StructArray/MarshalStructArrayTest.csproj b/src/tests/Interop/ArrayMarshalling/StructArray/MarshalStructArrayTest.csproj deleted file mode 100644 index 7d1c9c4459454c..00000000000000 --- a/src/tests/Interop/ArrayMarshalling/StructArray/MarshalStructArrayTest.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - true - true - - - - - - - - diff --git a/src/tests/Interop/COM/Directory.Build.targets b/src/tests/Interop/COM/Directory.Build.targets index 1761a1e495d8b9..af561cb765a390 100644 --- a/src/tests/Interop/COM/Directory.Build.targets +++ b/src/tests/Interop/COM/Directory.Build.targets @@ -8,11 +8,15 @@ true true + + true true true + + true diff --git a/src/tests/Interop/COM/NETClients/ConsumeNETServer/ConsumeNETServer.csproj b/src/tests/Interop/COM/NETClients/ConsumeNETServer/ConsumeNETServer.csproj index 71a8647c88c384..8902714d19b95e 100644 --- a/src/tests/Interop/COM/NETClients/ConsumeNETServer/ConsumeNETServer.csproj +++ b/src/tests/Interop/COM/NETClients/ConsumeNETServer/ConsumeNETServer.csproj @@ -1,6 +1,6 @@ - + true App.manifest true diff --git a/src/tests/Interop/COM/NativeClients/DefaultInterfaces.csproj b/src/tests/Interop/COM/NativeClients/DefaultInterfaces.csproj index a9d1838132c733..9d1aec86f1a1c9 100644 --- a/src/tests/Interop/COM/NativeClients/DefaultInterfaces.csproj +++ b/src/tests/Interop/COM/NativeClients/DefaultInterfaces.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/COM/NativeClients/Directory.Build.props b/src/tests/Interop/COM/NativeClients/Directory.Build.props index 6d234ecb1e7adb..0278b42ea229ae 100644 --- a/src/tests/Interop/COM/NativeClients/Directory.Build.props +++ b/src/tests/Interop/COM/NativeClients/Directory.Build.props @@ -9,6 +9,8 @@ true false true + + true diff --git a/src/tests/Interop/COM/NativeClients/Dispatch.csproj b/src/tests/Interop/COM/NativeClients/Dispatch.csproj index 3c8ac96d134cb3..c2988c5737d3b6 100644 --- a/src/tests/Interop/COM/NativeClients/Dispatch.csproj +++ b/src/tests/Interop/COM/NativeClients/Dispatch.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/COM/NativeClients/Events.csproj b/src/tests/Interop/COM/NativeClients/Events.csproj index 548695502f5375..47985b7f15ad2a 100644 --- a/src/tests/Interop/COM/NativeClients/Events.csproj +++ b/src/tests/Interop/COM/NativeClients/Events.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/COM/NativeClients/Licensing.csproj b/src/tests/Interop/COM/NativeClients/Licensing.csproj index 8722765e76ab80..64b5eceb077612 100644 --- a/src/tests/Interop/COM/NativeClients/Licensing.csproj +++ b/src/tests/Interop/COM/NativeClients/Licensing.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/COM/NativeClients/Primitives.csproj b/src/tests/Interop/COM/NativeClients/Primitives.csproj index df707092ec6a4e..1c67d810d44868 100644 --- a/src/tests/Interop/COM/NativeClients/Primitives.csproj +++ b/src/tests/Interop/COM/NativeClients/Primitives.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/DllImportAttribute/DllImportPath/DllImportPathTest.csproj b/src/tests/Interop/DllImportAttribute/DllImportPath/DllImportPathTest.csproj index 3a08a0e2425e24..65e425ff85125f 100644 --- a/src/tests/Interop/DllImportAttribute/DllImportPath/DllImportPathTest.csproj +++ b/src/tests/Interop/DllImportAttribute/DllImportPath/DllImportPathTest.csproj @@ -1,6 +1,9 @@ - + true true diff --git a/src/tests/Interop/IDynamicInterfaceCastable/IDynamicInterfaceCastable.csproj b/src/tests/Interop/IDynamicInterfaceCastable/IDynamicInterfaceCastable.csproj deleted file mode 100644 index 455ca249be5ee0..00000000000000 --- a/src/tests/Interop/IDynamicInterfaceCastable/IDynamicInterfaceCastable.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - true - true - - - - - - - - diff --git a/src/tests/Interop/IDynamicInterfaceCastable/Program.cs b/src/tests/Interop/IDynamicInterfaceCastable/Program.cs index 8897b42553c67e..0aba97ea0dfcb3 100644 --- a/src/tests/Interop/IDynamicInterfaceCastable/Program.cs +++ b/src/tests/Interop/IDynamicInterfaceCastable/Program.cs @@ -334,9 +334,11 @@ int ITest.GetNumber() } } + [ActiveIssue("https://github.com/dotnet/runtime/issues/55742", TestRuntimes.Mono)] public class Program { - private static void ValidateBasicInterface() + [Fact] + public static void ValidateBasicInterface() { Console.WriteLine($"Running {nameof(ValidateBasicInterface)}"); @@ -367,7 +369,8 @@ private static void ValidateBasicInterface() Assert.Same(castableObj, func()); } - private static void ValidateGenericInterface() + [Fact] + public static void ValidateGenericInterface() { Console.WriteLine($"Running {nameof(ValidateGenericInterface)}"); @@ -426,7 +429,8 @@ private static void ValidateGenericInterface() Assert.Equal(expectedStr, funcVar(expectedStr)); } - private static void ValidateOverriddenInterface() + [Fact] + public static void ValidateOverriddenInterface() { Console.WriteLine($"Running {nameof(ValidateOverriddenInterface)}"); @@ -459,7 +463,8 @@ private static void ValidateOverriddenInterface() Assert.Equal(IOverrideTestImpl.GetMyTypeReturnValue, funcGetType()); } - private static void ValidateNotImplemented() + [Fact] + public static void ValidateNotImplemented() { Console.WriteLine($"Running {nameof(ValidateNotImplemented)}"); @@ -473,7 +478,8 @@ private static void ValidateNotImplemented() Assert.Equal(string.Format(DynamicInterfaceCastableException.ErrorFormat, typeof(INotImplemented)), ex.Message); } - private static void ValidateDirectlyImplemented() + [Fact] + public static void ValidateDirectlyImplemented() { Console.WriteLine($"Running {nameof(ValidateDirectlyImplemented)}"); @@ -495,7 +501,8 @@ private static void ValidateDirectlyImplemented() Assert.Equal(DynamicInterfaceCastable.ImplementedMethodReturnValue, func()); } - private static void ValidateErrorHandling() + [Fact] + public static void ValidateErrorHandling() { Console.WriteLine($"Running {nameof(ValidateErrorHandling)}"); @@ -557,28 +564,5 @@ private static void ValidateErrorHandling() ex = Assert.Throws(() => testObj.GetMyType()); Console.WriteLine($" ---- {ex.GetType().Name}: {ex.Message}"); } - - [Fact] - public static int TestEntryPoint() - { - try - { - ValidateBasicInterface(); - ValidateGenericInterface(); - ValidateOverriddenInterface(); - - ValidateDirectlyImplemented(); - ValidateNotImplemented(); - - ValidateErrorHandling(); - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - - return 100; - } } } diff --git a/src/tests/Interop/Interop.csproj b/src/tests/Interop/Interop.csproj index f751282d127da4..704e64b6a56fac 100644 --- a/src/tests/Interop/Interop.csproj +++ b/src/tests/Interop/Interop.csproj @@ -1,7 +1,32 @@ + + true + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/Interop/LayoutClass/LayoutClassTest.cs b/src/tests/Interop/LayoutClass/LayoutClassTest.cs index b0fbd5b0210bcc..2e9c76cd5ce8cf 100644 --- a/src/tests/Interop/LayoutClass/LayoutClassTest.cs +++ b/src/tests/Interop/LayoutClass/LayoutClassTest.cs @@ -5,7 +5,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace PInvokeTests +namespace LayoutClass { [StructLayout(LayoutKind.Sequential)] public class EmptyBase @@ -137,7 +137,7 @@ public struct RecursiveTestStruct public RecursiveTestClass c; } - public class StructureTests + public class LayoutClassTest { private const string SimpleBlittableSeqLayoutClass_UpdateField = nameof(SimpleBlittableSeqLayoutClass_UpdateField); @@ -186,6 +186,7 @@ public class StructureTests [DllImport("LayoutClassNative", EntryPoint = "Invalid")] private static extern void RecursiveNativeLayoutInvalid(RecursiveTestStruct str); + [Fact] public static void SequentialClass() { Console.WriteLine($"Running {nameof(SequentialClass)}..."); @@ -195,6 +196,7 @@ public static void SequentialClass() Assert.True(SimpleSeqLayoutClassByRef(p)); } + [Fact] public static void SequentialClassNull() { Console.WriteLine($"Running {nameof(SequentialClassNull)}..."); @@ -202,6 +204,7 @@ public static void SequentialClassNull() Assert.True(SimpleSeqLayoutClassByRefNull(null)); } + [Fact] public static void DerivedClassWithEmptyBase() { Console.WriteLine($"Running {nameof(DerivedClassWithEmptyBase)}..."); @@ -211,6 +214,7 @@ public static void DerivedClassWithEmptyBase() Assert.True(DerivedSeqLayoutClassByRef(new SeqDerivedClass2(42), 42)); } + [Fact] public static void ExplicitClass() { Console.WriteLine($"Running {nameof(ExplicitClass)}..."); @@ -228,6 +232,7 @@ private static void ValidateBlittableClassInOut(Func pinvoke) Assert.Equal(expected, p.a); } + [Fact] public static void BlittableClass() { // [Compat] Marshalled with [In, Out] behaviour by default @@ -235,6 +240,7 @@ public static void BlittableClass() ValidateBlittableClassInOut(SimpleBlittableSeqLayoutClassByRef); } + [Fact] public static void BlittableClassNull() { // [Compat] Marshalled with [In, Out] behaviour by default @@ -242,6 +248,7 @@ public static void BlittableClassNull() Assert.True(SimpleBlittableSeqLayoutClass_Null(null)); } + [Fact] public static void BlittableClassByInAttr() { // [Compat] Marshalled with [In, Out] behaviour even when only [In] is specified @@ -249,6 +256,7 @@ public static void BlittableClassByInAttr() ValidateBlittableClassInOut(SimpleBlittableSeqLayoutClassByInAttr); } + [Fact] public static void BlittableClassByOutAttr() { // [Compat] Marshalled with [In, Out] behaviour even when only [Out] is specified @@ -265,6 +273,7 @@ private static void ValidateSealedBlittableClassInOut(Func(() => RecursiveNativeLayoutInvalid(new RecursiveTestStruct())); } - - [Fact] - public static int TestEntryPoint() - { - try - { - SequentialClass(); - SequentialClassNull(); - DerivedClassWithEmptyBase(); - ExplicitClass(); - BlittableClass(); - BlittableClassNull(); - SealedBlittableClass(); - BlittableClassByInAttr(); - SealedBlittableClassByInAttr(); - BlittableClassByOutAttr(); - SealedBlittableClassByOutAttr(); - NestedLayoutClass(); - RecursiveNativeLayout(); - SealedBlittablePinned(); - BlittablePinned(); - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - - return 100; - } } } diff --git a/src/tests/Interop/LayoutClass/LayoutClassTest.csproj b/src/tests/Interop/LayoutClass/LayoutClassTest.csproj deleted file mode 100644 index 6744a6a95a72ec..00000000000000 --- a/src/tests/Interop/LayoutClass/LayoutClassTest.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - true - true - - - - - - - - - diff --git a/src/tests/Interop/MarshalAPI/FunctionPointer/FunctionPtrTest.csproj b/src/tests/Interop/MarshalAPI/FunctionPointer/FunctionPtrTest.csproj deleted file mode 100644 index 6744a6a95a72ec..00000000000000 --- a/src/tests/Interop/MarshalAPI/FunctionPointer/FunctionPtrTest.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - true - true - - - - - - - - - diff --git a/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.cs b/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.cs index f814714738abcd..8275eb603cd590 100644 --- a/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.cs +++ b/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.cs @@ -27,7 +27,7 @@ public override string ToString() } } -public class IUnknownMarshalingTest +public class IUnknownMarshalingTest { [DllImport(@"IUnknownNative", CallingConvention = CallingConvention.Cdecl)] private static extern bool Marshal_IUnknown([In]IntPtr ptr); @@ -36,14 +36,14 @@ public class IUnknownMarshalingTest public void GetIUnknownForObjectTest() { - + try { //test null - IntPtr nullPtr = Marshal.GetIUnknownForObject(null); + IntPtr nullPtr = Marshal.GetIUnknownForObject(null); } catch (ArgumentNullException) { } - + foreach (object obj in TestObjects) { @@ -57,7 +57,7 @@ public void GetIUnknownForObjectTest() { throw new Exception("Failure on native side. Ref counts do not work as expected"); } - } + } finally { if (ptr != IntPtr.Zero) @@ -73,7 +73,7 @@ public void GetComInterfaceForObjectTest() IntPtr nullPtr = Marshal.GetComInterfaceForObject(null, typeof(object)); if (nullPtr != IntPtr.Zero) throw new Exception("A valid ptr was returned for null object."); - + foreach (object obj in TestObjects) { IntPtr ptr = IntPtr.Zero; @@ -86,7 +86,7 @@ public void GetComInterfaceForObjectTest() { throw new Exception("Failure on native side. Ref counts do not work as expected"); } - } + } finally { if (ptr != IntPtr.Zero) @@ -110,8 +110,8 @@ public void GetComInterfaceForObjectQueryInterfaceTest() if (!Marshal_IUnknown(ptr)) { throw new Exception("Failure on native side. Ref counts do not work as expected"); - } - } + } + } finally { if (ptr != IntPtr.Zero) @@ -126,7 +126,7 @@ public void GetObjectForIUnknownTest() { //test IntPtr.Zero Object nullObj = Marshal.GetObjectForIUnknown(IntPtr.Zero); - + } catch (ArgumentNullException) { } @@ -143,7 +143,7 @@ public void GetObjectForIUnknownTest() //compare the new object reference with the original object, they should point to the same underlying object if (!object.ReferenceEquals(obj, tmpObj)) throw new Exception("GetObjectForIUnknown returned a different object. Original: " + obj + ", New: " + tmpObj); - } + } finally { if (ptr != IntPtr.Zero) @@ -154,13 +154,13 @@ public void GetObjectForIUnknownTest() public void GetUniqueObjectForIUnknownTest() { - + //test IntPtr.Zero Object nullObj = Marshal.GetUniqueObjectForIUnknown(IntPtr.Zero); if (nullObj != null) - throw new Exception("Object returned for IntPtr.Zero is not null."); - + throw new Exception("Object returned for IntPtr.Zero is not null."); + foreach (object obj in TestObjects) { @@ -181,7 +181,7 @@ public void GetUniqueObjectForIUnknownTest() if (!obj.Equals(tmpObj)) throw new Exception("GetUniqueObjectForIUnknown returned an object with different value. Original: " + obj + ", New: " + tmpObj); - } + } finally { if (tmpObj != null) @@ -192,7 +192,7 @@ public void GetUniqueObjectForIUnknownTest() } } - public bool RunTests() + public bool RunTests() { Initialize(); GetIUnknownForObjectTest(); @@ -207,19 +207,31 @@ public bool Initialize() TestObjects[1] = 'a'; //char TestObjects[2] = false; //bool TestObjects[3] = "string"; //string - TestObjects[4] = new TestClass(); //Object of type TestClass + TestObjects[4] = new TestClass(); //Object of type TestClass TestObjects[5] = new List(); //Projected Type - TestObjects[6] = new Nullable(2); //Nullable Type + TestObjects[6] = new Nullable(2); //Nullable Type return true; } - [Fact] - public static void TestEntryPoint() + [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNotNativeAot))] + [PlatformSpecific(TestPlatforms.Windows)] + [SkipOnMono("Requires COM support")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/85234", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsGCStress))] + public static void Run() { - IUnknownMarshalingTest testObj = new IUnknownMarshalingTest(); + IUnknownMarshalingTest testObj = new IUnknownMarshalingTest(); testObj.Initialize(); testObj.RunTests(); } + [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNotNativeAot))] + [PlatformSpecific(TestPlatforms.Windows)] + [SkipOnMono("Requires COM support")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/85234", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsGCStress))] + public static void RunInALC() + { + TestLibrary.Utilities.ExecuteAndUnload(typeof(IUnknownMarshalingTest).Assembly.Location, nameof(IUnknownMarshalingTest), nameof(Run)); + } + } #pragma warning restore 618 diff --git a/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.csproj b/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.csproj deleted file mode 100644 index 2374e6c13c67f8..00000000000000 --- a/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - true - - true - true - - true - - - - - - - - - diff --git a/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTestInALC.csproj b/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTestInALC.csproj deleted file mode 100644 index c70fefae669f3f..00000000000000 --- a/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTestInALC.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - true - false - - true - true - - - - - - - - - - diff --git a/src/tests/Interop/MarshalAPI/IUnknown/TestInALC.cs b/src/tests/Interop/MarshalAPI/IUnknown/TestInALC.cs deleted file mode 100644 index 856f40c910ba4f..00000000000000 --- a/src/tests/Interop/MarshalAPI/IUnknown/TestInALC.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.IO; -using System.Reflection; - -namespace TestInALC -{ - class Test - { - static int Main(string[] args) - { - string currentAssemblyDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - string testAssemblyFullPath = Path.Combine(currentAssemblyDirectory, "IUnknownTest.dll"); - return TestLibrary.Utilities.ExecuteAndUnload(testAssemblyFullPath, args); - } - } -} diff --git a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs index 593ce38aaf1d0e..f5b3feff4b6c63 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs +++ b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs @@ -27,17 +27,15 @@ public static unsafe int StructWithCtorTest(StructWithCtor* ptrStruct, ref Struc } [Fact] - public static unsafe int TestEntryPoint() + public static unsafe void ValidateCopyConstructorAndDestructorCalled() { TestDelegate del = (TestDelegate)Delegate.CreateDelegate(typeof(TestDelegate), typeof(CopyCtor).GetMethod("StructWithCtorTest")); StructWithCtor s1 = new StructWithCtor(); StructWithCtor s2 = new StructWithCtor(); s1._instanceField = 1; s2._instanceField = 2; - int returnVal = FunctionPointer.Call_FunctionPointer(Marshal.GetFunctionPointerForDelegate(del), &s1, ref s2); + Assert.Equal(100, FunctionPointer.Call_FunctionPointer(Marshal.GetFunctionPointerForDelegate(del), &s1, ref s2)); GC.KeepAlive(del); - - return returnVal; } } diff --git a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.csproj b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.csproj index 0fe88fcd86221e..1324109b83119e 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.csproj +++ b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.csproj @@ -1,7 +1,5 @@ - - true True diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.cs b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.cs index 5bec38442bc3b8..b6f250c2e61854 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.cs @@ -5,7 +5,7 @@ using System.Runtime.InteropServices; using Xunit; -public class Program +public class InvalidSizeParamIndex { [DllImport("Unused")] static extern void SizeParamIndexTooBig( @@ -16,9 +16,14 @@ public static extern void SizeParamIndexWrongType( out string arrSize, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] out byte[] arrByte); [Fact] - public static void TestEntryPoint() + public static void TooBig() { Assert.Throws(() => SizeParamIndexTooBig(out var _, out var _)); + } + + [Fact] + public static void WrongType() + { Assert.Throws(() => SizeParamIndexWrongType(out var _, out var _)); } } diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.csproj b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.csproj index c06c453fd35643..4cbe50a9d167b3 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.csproj +++ b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/RefCharArray/RefCharArrayTest.cs b/src/tests/Interop/RefCharArray/RefCharArrayTest.cs index ae16d5d4845863..a71814269f528b 100644 --- a/src/tests/Interop/RefCharArray/RefCharArrayTest.cs +++ b/src/tests/Interop/RefCharArray/RefCharArrayTest.cs @@ -42,7 +42,7 @@ public class Test_RefCharArrayTest #region "TestMethod" //TestMethod1,Pinvoke,Cdecl - + static bool TestMethod_PInvoke_Cdecl() { TestFramework.BeginScenario("Pinvoke,Cdecl"); @@ -76,7 +76,7 @@ static bool TestMethod_PInvoke_Cdecl() } //TestMethod2,Pinvoke,StdCall - + static bool TestMethod_PInvoke_StdCall() { TestFramework.BeginScenario("Pinvoke,StdCall"); @@ -112,8 +112,8 @@ static bool TestMethod_PInvoke_StdCall() //TestMethod3:ReversePinvoke,Cdecl [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool CdeclCallBack( ref char[] arr ); - - + + public static bool TestMethod_MarshalRefCharArray_Cdecl( ref char[] arr ) { TestFramework.BeginScenario("Pinvoke,StdCall"); @@ -143,8 +143,8 @@ public static bool TestMethod_MarshalRefCharArray_Cdecl( ref char[] arr ) [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool StdCallBack( ref char[] arr ); - - + + public static bool TestMethod_MarshalRefCharArray_Stdcall( ref char[] arr ) { TestFramework.BeginScenario("ReversePinvoke,Stdcall"); @@ -173,7 +173,7 @@ public static bool TestMethod_MarshalRefCharArray_Stdcall( ref char[] arr ) [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool DelegatePInvokeCdecl( ref char[] arr ); - + private static bool TestMethod_DelegatePInvokeCdecl() { TestFramework.BeginScenario("DelegatePinvoke,Cdecl"); @@ -211,7 +211,7 @@ private static bool TestMethod_DelegatePInvokeCdecl() [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool DelegatePInvokeStdcall( ref char[] arr ); - + private static bool TestMethod_DelegatePInvokeStdcall() { TestFramework.BeginScenario("DelegatePinvoke,Cdecl"); @@ -247,8 +247,9 @@ private static bool TestMethod_DelegatePInvokeStdcall() #endregion - + [Fact] + [OuterLoop] public static int TestEntryPoint() { bool bresult = true; diff --git a/src/tests/Interop/RefCharArray/RefCharArrayTest.csproj b/src/tests/Interop/RefCharArray/RefCharArrayTest.csproj deleted file mode 100644 index 4a2de2ea20f17e..00000000000000 --- a/src/tests/Interop/RefCharArray/RefCharArrayTest.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - true - true - 1 - - - - - - - - - diff --git a/src/tests/Interop/SimpleStruct/SimpleStruct.csproj b/src/tests/Interop/SimpleStruct/SimpleStruct.csproj deleted file mode 100644 index 4a2de2ea20f17e..00000000000000 --- a/src/tests/Interop/SimpleStruct/SimpleStruct.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - true - true - 1 - - - - - - - - - diff --git a/src/tests/Interop/SimpleStruct/SimpleStructManaged.cs b/src/tests/Interop/SimpleStruct/SimpleStructManaged.cs index cee3c2a12a9f9f..91eb0554476466 100644 --- a/src/tests/Interop/SimpleStruct/SimpleStructManaged.cs +++ b/src/tests/Interop/SimpleStruct/SimpleStructManaged.cs @@ -511,6 +511,7 @@ public static bool AutoStructNegativeTest() #endregion [Fact] + [OuterLoop] public static int TestEntryPoint() { bool retVal = true; diff --git a/src/tests/Interop/StringMarshalling/AnsiBSTR/AnsiBStrTest.cs b/src/tests/Interop/StringMarshalling/AnsiBSTR/AnsiBStrTest.cs index 53ecd3646e7ff1..3a923414f99f24 100644 --- a/src/tests/Interop/StringMarshalling/AnsiBSTR/AnsiBStrTest.cs +++ b/src/tests/Interop/StringMarshalling/AnsiBSTR/AnsiBStrTest.cs @@ -7,20 +7,7 @@ using System.Text; using Xunit; -public class AnsiBStrTest +[OuterLoop] +public partial class StringTests { - [Fact] - public static int TestEntryPoint() - { - try - { - CommonStringTests.RunTests(runStringBuilderTests: false, runStructTests: false); - } - catch (System.Exception ex) - { - Console.WriteLine(ex.ToString()); - return 101; - } - return 100; - } } diff --git a/src/tests/Interop/StringMarshalling/AnsiBSTR/AnsiBStrTest.csproj b/src/tests/Interop/StringMarshalling/AnsiBSTR/AnsiBStrTest.csproj index 95d839c2ec0f40..f476d5f41f21f4 100644 --- a/src/tests/Interop/StringMarshalling/AnsiBSTR/AnsiBStrTest.csproj +++ b/src/tests/Interop/StringMarshalling/AnsiBSTR/AnsiBStrTest.csproj @@ -1,17 +1,15 @@ - - true true $(DefineConstants);ANSIBSTR - + + - diff --git a/src/tests/Interop/StringMarshalling/BSTR/BSTRTest.cs b/src/tests/Interop/StringMarshalling/BSTR/BSTRTest.cs deleted file mode 100644 index 29b1dd2e094559..00000000000000 --- a/src/tests/Interop/StringMarshalling/BSTR/BSTRTest.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.InteropServices; -using System; -using System.Reflection; -using System.Text; -using Xunit; - -public class BStrTest -{ - [Fact] - public static int TestEntryPoint() - { - try - { - CommonStringTests.RunTests(runStringBuilderTests: false); - } - catch (System.Exception ex) - { - Console.WriteLine(ex.ToString()); - return 101; - } - return 100; - } -} diff --git a/src/tests/Interop/StringMarshalling/BSTR/BSTRTest.csproj b/src/tests/Interop/StringMarshalling/BSTR/BSTRTest.csproj index d77d48e2216b1f..08df9c12dfe4d5 100644 --- a/src/tests/Interop/StringMarshalling/BSTR/BSTRTest.csproj +++ b/src/tests/Interop/StringMarshalling/BSTR/BSTRTest.csproj @@ -1,17 +1,16 @@ - - true true $(DefineConstants);BSTR - + + + - diff --git a/src/tests/Interop/StringMarshalling/Common/CommonStringTests.cs b/src/tests/Interop/StringMarshalling/Common/CommonStringTests.cs deleted file mode 100644 index 69939dd912da09..00000000000000 --- a/src/tests/Interop/StringMarshalling/Common/CommonStringTests.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.InteropServices; -using System; -using System.Reflection; -using System.Text; -using Xunit; - -using static StringMarshalingTestNative; - -class CommonStringTests -{ - private static readonly string InitialString = "Hello World"; - - public static void RunTests(bool runStringBuilderTests = true, bool runStructTests = true) - { - RunStringTests(); - if (runStringBuilderTests) - { - RunStringBuilderTests(); - } - if (runStructTests) - { - RunStructTests(); - } - } - - private static void RunStringTests() - { - Assert.True(MatchFunctionName(nameof(MatchFunctionName))); - { - string funcNameLocal = nameof(MatchFunctionNameByRef); - Assert.True(MatchFunctionNameByRef(ref funcNameLocal)); - } - - { - string reversed = InitialString; - ReverseInplaceByref(ref reversed); - Assert.Equal(Helpers.Reverse(InitialString), reversed); - } - - { - Reverse(InitialString, out string reversed); - Assert.Equal(Helpers.Reverse(InitialString), reversed); - } - - Assert.Equal(Helpers.Reverse(InitialString), ReverseAndReturn(InitialString)); - - Assert.True(VerifyReversed(InitialString, (orig, rev) => rev == Helpers.Reverse(orig))); - - Assert.True(ReverseInCallback(InitialString, (string str, out string rev) => rev = Helpers.Reverse(InitialString))); - - Assert.True(ReverseInCallbackReturned(InitialString, str => Helpers.Reverse(str))); - } - - private static void RunStringBuilderTests() - { - var builder = new StringBuilder(InitialString); - ReverseInplace(builder); - Assert.Equal(Helpers.Reverse(InitialString), builder.ToString()); - - builder = new StringBuilder(InitialString); - ReverseInplaceByref(ref builder); - Assert.Equal(Helpers.Reverse(InitialString), builder.ToString()); - - builder = new StringBuilder(InitialString); - Assert.True(ReverseInplaceInCallback(builder, b => - { - string reversed = Helpers.Reverse(b.ToString()); - b.Clear(); - b.Append(reversed); - })); - } - - private static void RunStructTests() - { - Assert.True(MatchFunctionNameInStruct(new StringInStruct { str = nameof(MatchFunctionNameInStruct)})); - - var str = new StringInStruct - { - str = InitialString - }; - - ReverseInplaceByrefInStruct(ref str); - - Assert.Equal(Helpers.Reverse(InitialString), str.str); - } -} diff --git a/src/tests/Interop/StringMarshalling/Common/StringBuilderTests.cs b/src/tests/Interop/StringMarshalling/Common/StringBuilderTests.cs new file mode 100644 index 00000000000000..42bb85d029e0a1 --- /dev/null +++ b/src/tests/Interop/StringMarshalling/Common/StringBuilderTests.cs @@ -0,0 +1,43 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; +using System; +using System.Reflection; +using System.Text; +using Xunit; + +using static StringMarshalingTestNative; + +public partial class StringBuilderTests +{ + private static readonly string InitialString = "Hello World"; + + [Fact] + public static void ByValue() + { + var builder = new StringBuilder(InitialString); + ReverseInplace(builder); + Assert.Equal(Helpers.Reverse(InitialString), builder.ToString()); + } + + [Fact] + public static void ByRef() + { + var builder = new StringBuilder(InitialString); + ReverseInplaceByref(ref builder); + Assert.Equal(Helpers.Reverse(InitialString), builder.ToString()); + } + + [Fact] + public static void ReversePInvoke() + { + var builder = new StringBuilder(InitialString); + Assert.True(ReverseInplaceInCallback(builder, b => + { + string reversed = Helpers.Reverse(b.ToString()); + b.Clear(); + b.Append(reversed); + })); + } +} diff --git a/src/tests/Interop/StringMarshalling/Common/StringInStructTests.cs b/src/tests/Interop/StringMarshalling/Common/StringInStructTests.cs new file mode 100644 index 00000000000000..564a29827a5938 --- /dev/null +++ b/src/tests/Interop/StringMarshalling/Common/StringInStructTests.cs @@ -0,0 +1,34 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; +using System; +using System.Reflection; +using System.Text; +using Xunit; + +using static StringMarshalingTestNative; + +public partial class StringInStructTests +{ + private static readonly string InitialString = "Hello World"; + + [Fact] + public static void ByValue() + { + Assert.True(MatchFunctionNameInStruct(new StringInStruct { str = nameof(MatchFunctionNameInStruct)})); + } + + [Fact] + public static void ByRef() + { + var str = new StringInStruct + { + str = InitialString + }; + + ReverseInplaceByrefInStruct(ref str); + + Assert.Equal(Helpers.Reverse(InitialString), str.str); + } +} diff --git a/src/tests/Interop/StringMarshalling/Common/StringTests.cs b/src/tests/Interop/StringMarshalling/Common/StringTests.cs new file mode 100644 index 00000000000000..e8dfd4319f4d53 --- /dev/null +++ b/src/tests/Interop/StringMarshalling/Common/StringTests.cs @@ -0,0 +1,73 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; +using System; +using System.Reflection; +using System.Text; +using Xunit; + +using static StringMarshalingTestNative; + +public partial class StringTests +{ + private static readonly string InitialString = "Hello World"; + + [Fact] + public static void String_ByValue() + { + Assert.True(MatchFunctionName(nameof(MatchFunctionName))); + } + + [Fact] + public static void String_ByRef() + { + string funcNameLocal = nameof(MatchFunctionNameByRef); + Assert.True(MatchFunctionNameByRef(ref funcNameLocal)); + } + + [Fact] + public static void String_ByRef_InCallback() + { + Assert.True(ReverseInCallback(InitialString, (string str, out string rev) => rev = Helpers.Reverse(InitialString))); + } + + [Fact] + public static void String_InPlace_ByRef() + { + string reversed = InitialString; + ReverseInplaceByref(ref reversed); + Assert.Equal(Helpers.Reverse(InitialString), reversed); + } + + [Fact] + public static void String_Out() + { + Reverse(InitialString, out string reversed); + Assert.Equal(Helpers.Reverse(InitialString), reversed); + } + + [Fact] + public static void String_Return() + { + Assert.Equal(Helpers.Reverse(InitialString), ReverseAndReturn(InitialString)); + } + + [Fact] + public static void String_Callback_ByValue() + { + Assert.True(VerifyReversed(InitialString, (orig, rev) => rev == Helpers.Reverse(orig))); + } + + [Fact] + public static void String_Callback_ByRef() + { + Assert.True(ReverseInCallback(InitialString, (string str, out string rev) => rev = Helpers.Reverse(InitialString))); + } + + [Fact] + public static void String_Callback_Return() + { + Assert.True(ReverseInCallbackReturned(InitialString, str => Helpers.Reverse(str))); + } +} diff --git a/src/tests/Interop/StringMarshalling/LPSTR/LPSTRTest.cs b/src/tests/Interop/StringMarshalling/LPSTR/LPSTRTest.cs deleted file mode 100644 index 8355771b6f7e3d..00000000000000 --- a/src/tests/Interop/StringMarshalling/LPSTR/LPSTRTest.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.InteropServices; -using System; -using System.Reflection; -using System.Text; -using Xunit; - -public class LPStrTest -{ - [Fact] - public static int TestEntryPoint() - { - try - { - CommonStringTests.RunTests(); - } - catch (System.Exception ex) - { - Console.WriteLine(ex.ToString()); - return 101; - } - return 100; - } -} diff --git a/src/tests/Interop/StringMarshalling/LPSTR/LPSTRTest.csproj b/src/tests/Interop/StringMarshalling/LPSTR/LPSTRTest.csproj index 4151696c37dfa9..27998767cb046e 100644 --- a/src/tests/Interop/StringMarshalling/LPSTR/LPSTRTest.csproj +++ b/src/tests/Interop/StringMarshalling/LPSTR/LPSTRTest.csproj @@ -1,7 +1,5 @@ - - true true $(DefineConstants);LPSTR @@ -12,6 +10,5 @@ - diff --git a/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs b/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs index d5b529bd778dca..4c6b4fb8361d75 100644 --- a/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs +++ b/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs @@ -9,6 +9,25 @@ using static LPTStrTestNative; +[OuterLoop] +public partial class StringTests +{ +} + + +[OuterLoop] +public partial class StringBuilderTests +{ +} + + +[OuterLoop] +public partial class StringInStructTests +{ +} + + +[OuterLoop] public class LPTStrTest { private static readonly string InitialString = "Hello World"; @@ -16,23 +35,7 @@ public class LPTStrTest private static readonly string LongUnicodeString = "\uD83D\uDC68\u200D\uD83D\uDC68\u200D\uD83D\uDC67\u200D\uD83D\uDC67\uD83D\uDC31\u200D\uD83D\uDC64"; [Fact] - public static int TestEntryPoint() - { - try - { - CommonStringTests.RunTests(); - RunStringBuilderTests(); - RunByValTStrTests(); - } - catch (System.Exception ex) - { - Console.WriteLine(ex.ToString()); - return 101; - } - return 100; - } - - private static void RunStringBuilderTests() + public static void RunStringBuilderTests() { int length = 10; StringBuilder nullTerminatorBuilder = new StringBuilder(length); @@ -40,7 +43,8 @@ private static void RunStringBuilderTests() Assert.True(Verify_NullTerminators_PastEnd_Out(nullTerminatorBuilder, length)); } - private static void RunByValTStrTests() + [Fact] + public static void RunByValTStrTests() { Assert.True(MatchFuncNameAnsi(new ByValStringInStructAnsi { str = nameof(MatchFuncNameAnsi)})); diff --git a/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.csproj b/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.csproj index b34cfd75ca1b7c..52006bf63c1d16 100644 --- a/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.csproj +++ b/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.csproj @@ -1,10 +1,7 @@ - - true true $(DefineConstants);LPTSTR - 1 @@ -13,6 +10,5 @@ - diff --git a/src/tests/Interop/StringMarshalling/UTF8/UTF8Test.cs b/src/tests/Interop/StringMarshalling/UTF8/UTF8Test.cs index 05aba3d26a4254..b0c74d1479fe15 100644 --- a/src/tests/Interop/StringMarshalling/UTF8/UTF8Test.cs +++ b/src/tests/Interop/StringMarshalling/UTF8/UTF8Test.cs @@ -237,6 +237,7 @@ public class Test }; [Fact] + [OuterLoop] public static void TestEntryPoint() { // Test string as [In,Out] parameter diff --git a/src/tests/Interop/StringMarshalling/UTF8/UTF8Test.csproj b/src/tests/Interop/StringMarshalling/UTF8/UTF8Test.csproj index 4a2de2ea20f17e..40feb428523ad7 100644 --- a/src/tests/Interop/StringMarshalling/UTF8/UTF8Test.csproj +++ b/src/tests/Interop/StringMarshalling/UTF8/UTF8Test.csproj @@ -1,15 +1,11 @@ - - true true - 1 - diff --git a/src/tests/Interop/StringMarshalling/VBByRefStr/VBByRefStrTest.cs b/src/tests/Interop/StringMarshalling/VBByRefStr/VBByRefStrTest.cs index 1daafec8ef494e..e6f48b3f04a5ca 100644 --- a/src/tests/Interop/StringMarshalling/VBByRefStr/VBByRefStrTest.cs +++ b/src/tests/Interop/StringMarshalling/VBByRefStr/VBByRefStrTest.cs @@ -13,6 +13,9 @@ public class Test { [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/65698", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/179", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [PlatformSpecific(TestPlatforms.Windows)] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/StringMarshalling/VBByRefStr/VBByRefStrTest.csproj b/src/tests/Interop/StringMarshalling/VBByRefStr/VBByRefStrTest.csproj index 5b152ea035ce85..621a9f162f3bf5 100644 --- a/src/tests/Interop/StringMarshalling/VBByRefStr/VBByRefStrTest.csproj +++ b/src/tests/Interop/StringMarshalling/VBByRefStr/VBByRefStrTest.csproj @@ -1,15 +1,8 @@ - - true true - - true - - - diff --git a/src/tests/Interop/StructPacking/StructPacking.cs b/src/tests/Interop/StructPacking/StructPacking.cs index 4882c6aabdac52..e7ff357b33330b 100644 --- a/src/tests/Interop/StructPacking/StructPacking.cs +++ b/src/tests/Interop/StructPacking/StructPacking.cs @@ -100,7 +100,7 @@ struct AutoLayoutMaxPacking : ITestStructure public int OffsetOfValue => Program.OffsetOf(ref this, ref _value); } -public unsafe class Program +public unsafe partial class Program { const int Pass = 100; const int Fail = 0; diff --git a/src/tests/Interop/StructPacking/StructPacking.csproj b/src/tests/Interop/StructPacking/StructPacking.csproj deleted file mode 100644 index 2495e486fa9bf4..00000000000000 --- a/src/tests/Interop/StructPacking/StructPacking.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - - true - true - - - - - diff --git a/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionNegativeTest.csproj b/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionNegativeTest.csproj index 2d9ddf06e3a18e..c5b12ea122b505 100644 --- a/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionNegativeTest.csproj +++ b/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionNegativeTest.csproj @@ -1,6 +1,6 @@ - + true True true diff --git a/src/tests/Interop/WinRT/Program.cs b/src/tests/Interop/WinRT/Program.cs index abb734dda54e36..39b31b4a0926b6 100644 --- a/src/tests/Interop/WinRT/Program.cs +++ b/src/tests/Interop/WinRT/Program.cs @@ -17,18 +17,9 @@ public class Program private static bool ObjectIsI(object o) => o is I; [Fact] - public static int TestEntryPoint() + public static void CannotLoadWinRTType() { - try - { - Assert.Throws(() => ObjectIsI(new object())); - } - catch (System.Exception ex) - { - Console.WriteLine(ex); - return 101; - } - return 100; + Assert.Throws(() => ObjectIsI(new object())); } } } diff --git a/src/tests/Interop/WinRT/WinRT.csproj b/src/tests/Interop/WinRT/WinRT.csproj deleted file mode 100644 index d5f390c0df41aa..00000000000000 --- a/src/tests/Interop/WinRT/WinRT.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - true - true - true - - - - - From 86c426b6417adc079389ecadd27d5bddebdc7681 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Thu, 26 Oct 2023 17:49:07 -0700 Subject: [PATCH 02/19] Add a CMakeProjectReference from the merged runner to all subdirectories and allow the interop tests that were only process-isolated due to that restriction to run in proc. Also update exclusions for some projects to use attributes instead of project properties to enable more of them to be run in-proc. --- src/tests/Interop/Interop.csproj | 7 ++-- .../AsByValArray/AsByValArrayTest.csproj | 4 --- .../AsLPArray/AsLPArrayTest.csproj | 4 --- .../AsDefault/AsDefaultTest.csproj | 4 --- .../AsLPArray/AsLPArrayTest.csproj | 4 --- .../ArrayWithOffsetTest.csproj | 2 -- .../Interop/PInvoke/AsAny/AsAnyTest.csproj | 4 --- .../PInvoke/Attributes/LCID/LCIDTest.cs | 3 ++ .../PInvoke/Attributes/LCID/LCIDTest.csproj | 6 ---- .../Assembly_Default/Assembly_Default.csproj | 6 ---- .../Assembly_False_False.csproj | 6 ---- .../Assembly_False_True.csproj | 6 ---- .../Assembly_True_False.csproj | 6 ---- .../Assembly_True_True.csproj | 6 ---- .../Interop/PInvoke/BestFitMapping/Program.cs | 3 ++ .../ArrayTest/ArrayTest.csproj | 2 +- .../ReverseTest/ReverseTest.csproj | 4 --- .../StructTest/StructTest.csproj | 2 +- .../PInvoke/CriticalHandles/Test/Test.csproj | 2 +- .../CustomMarshalers/CustomMarshalersTest.cs | 3 ++ .../CustomMarshalersTest.csproj | 5 --- .../PInvoke/DateTime/DateTimeTest.csproj | 4 --- .../PInvoke/Delegate/DelegateTest.csproj | 4 --- .../PInvoke/Generics/GenericsTest.csproj | 2 -- .../PInvoke/IEnumerator/IEnumeratorNative.cpp | 11 ++++-- .../PInvoke/IEnumerator/IEnumeratorTest.cs | 35 +++++++------------ .../IEnumerator/IEnumeratorTest.csproj | 6 ---- .../Interop/PInvoke/Int128/Int128Test.csproj | 2 -- .../Int128/Int128TestFieldLayout.csproj | 2 -- .../HandleRef/HandleRefTest.csproj | 2 +- .../MAWSPITest.csproj | 4 --- .../Primitives/Int/PInvokeIntTest.csproj | 4 --- .../Pointer/NonBlittablePointer.csproj | 2 -- .../RuntimeHandles/RuntimeHandlesTest.csproj | 4 --- .../SafeHandles/SafeHandleTests.csproj | 4 --- .../SetLastError/SetLastErrorTest.csproj | 4 --- .../PassingByOut/PassingByOutTest.csproj | 4 --- .../PassingByRef/PassingByRefTest.csproj | 4 --- .../PassingByOut/PassingByOutTest.csproj | 4 --- .../PassingByRef/PassingByRefTest.csproj | 4 --- .../Interop/PInvoke/Varargs/VarargsTest.cs | 4 +++ .../PInvoke/Varargs/VarargsTest.csproj | 8 +---- .../PInvoke/Variant/VariantTest.BuiltInCom.cs | 2 ++ .../Variant/VariantTest.ComWrappers.cs | 2 ++ .../PInvoke/Variant/VariantTest.csproj | 4 --- .../VariantTestBuiltInComDisabled.csproj | 2 +- .../Variant/VariantTestComWrappers.csproj | 2 +- 47 files changed, 50 insertions(+), 169 deletions(-) diff --git a/src/tests/Interop/Interop.csproj b/src/tests/Interop/Interop.csproj index 704e64b6a56fac..b6d5ee1f8b91f7 100644 --- a/src/tests/Interop/Interop.csproj +++ b/src/tests/Interop/Interop.csproj @@ -17,14 +17,17 @@ - - + + + + + diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.csproj b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.csproj index 5d99eb048bf1af..c250b2f8bb1822 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.csproj +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.csproj b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.csproj index 5d99eb048bf1af..c250b2f8bb1822 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.csproj +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.csproj b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.csproj index 5d99eb048bf1af..c250b2f8bb1822 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.csproj +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.csproj b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.csproj index 5d99eb048bf1af..c250b2f8bb1822 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.csproj +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.csproj b/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.csproj index b2701dfa0d165f..eff1d00c75351d 100644 --- a/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.csproj +++ b/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.csproj @@ -1,7 +1,5 @@ - - true true diff --git a/src/tests/Interop/PInvoke/AsAny/AsAnyTest.csproj b/src/tests/Interop/PInvoke/AsAny/AsAnyTest.csproj index 533e19ef20a98e..2cdc971285f649 100644 --- a/src/tests/Interop/PInvoke/AsAny/AsAnyTest.csproj +++ b/src/tests/Interop/PInvoke/AsAny/AsAnyTest.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.cs b/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.cs index e73de0b912d65e..879ac26ae3cc4e 100644 --- a/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.cs +++ b/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.cs @@ -29,6 +29,9 @@ private static string Reverse(string s) } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] + [SkipOnMono("PInvoke LCIDConversionAttribute not supported on Mono")] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(Utilities), nameof(Utilities.IsNativeAot))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.csproj b/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.csproj index d2bd5b185d3934..21e1b2cac1a75c 100644 --- a/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.csproj +++ b/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.csproj @@ -1,10 +1,4 @@ - - - true - - true - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_Default/Assembly_Default.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_Default/Assembly_Default.csproj index 7159f7cb395a1c..212db2cd4684b8 100644 --- a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_Default/Assembly_Default.csproj +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_Default/Assembly_Default.csproj @@ -1,10 +1,4 @@ - - - true - - true - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_False/Assembly_False_False.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_False/Assembly_False_False.csproj index 7159f7cb395a1c..212db2cd4684b8 100644 --- a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_False/Assembly_False_False.csproj +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_False/Assembly_False_False.csproj @@ -1,10 +1,4 @@ - - - true - - true - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_True/Assembly_False_True.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_True/Assembly_False_True.csproj index 7159f7cb395a1c..212db2cd4684b8 100644 --- a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_True/Assembly_False_True.csproj +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_True/Assembly_False_True.csproj @@ -1,10 +1,4 @@ - - - true - - true - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_False/Assembly_True_False.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_False/Assembly_True_False.csproj index 7159f7cb395a1c..212db2cd4684b8 100644 --- a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_False/Assembly_True_False.csproj +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_False/Assembly_True_False.csproj @@ -1,10 +1,4 @@ - - - true - - true - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_True/Assembly_True_True.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_True/Assembly_True_True.csproj index 7159f7cb395a1c..212db2cd4684b8 100644 --- a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_True/Assembly_True_True.csproj +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_True/Assembly_True_True.csproj @@ -1,10 +1,4 @@ - - - true - - true - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Program.cs b/src/tests/Interop/PInvoke/BestFitMapping/Program.cs index f8d1c6584e045a..c985202278c5fc 100644 --- a/src/tests/Interop/PInvoke/BestFitMapping/Program.cs +++ b/src/tests/Interop/PInvoke/BestFitMapping/Program.cs @@ -11,6 +11,9 @@ public class Program { [Fact] + [PlatformSpecific(TestPlatforms.Windows)] + [SkipOnMono("Mono doesn't support interop BestFitMapping and ThrowOnUnmappableChar attributes")] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(Utilities), nameof(Utilities.IsNativeAot))] public static void TestEntryPoint() { if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") diff --git a/src/tests/Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest.csproj b/src/tests/Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest.csproj index b0668acfac0bbd..74cb06a9f00eda 100644 --- a/src/tests/Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest.csproj +++ b/src/tests/Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest.csproj @@ -1,6 +1,6 @@ - + true diff --git a/src/tests/Interop/PInvoke/CriticalHandles/ReverseTest/ReverseTest.csproj b/src/tests/Interop/PInvoke/CriticalHandles/ReverseTest/ReverseTest.csproj index 69a9f35c3d7d1c..42213610979e7c 100644 --- a/src/tests/Interop/PInvoke/CriticalHandles/ReverseTest/ReverseTest.csproj +++ b/src/tests/Interop/PInvoke/CriticalHandles/ReverseTest/ReverseTest.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/PInvoke/CriticalHandles/StructTest/StructTest.csproj b/src/tests/Interop/PInvoke/CriticalHandles/StructTest/StructTest.csproj index b0668acfac0bbd..74cb06a9f00eda 100644 --- a/src/tests/Interop/PInvoke/CriticalHandles/StructTest/StructTest.csproj +++ b/src/tests/Interop/PInvoke/CriticalHandles/StructTest/StructTest.csproj @@ -1,6 +1,6 @@ - + true diff --git a/src/tests/Interop/PInvoke/CriticalHandles/Test/Test.csproj b/src/tests/Interop/PInvoke/CriticalHandles/Test/Test.csproj index b0668acfac0bbd..74cb06a9f00eda 100644 --- a/src/tests/Interop/PInvoke/CriticalHandles/Test/Test.csproj +++ b/src/tests/Interop/PInvoke/CriticalHandles/Test/Test.csproj @@ -1,6 +1,6 @@ - + true diff --git a/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.cs b/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.cs index 82189da3a1c487..00fd022b76762c 100644 --- a/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.cs +++ b/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.cs @@ -27,6 +27,9 @@ IReflect expando public static class CustomMarshalersTests { [Fact] + [PlatformSpecific(TestPlatforms.Windows)] + [SkipOnMono("These custom marshallers were never built-in to the runtime on Mono")] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(Utilities), nameof(Utilities.IsNativeAot))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.csproj b/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.csproj index fa777900cf2f8a..eff1d00c75351d 100644 --- a/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.csproj +++ b/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.csproj @@ -1,11 +1,6 @@ - - true true - - true - true diff --git a/src/tests/Interop/PInvoke/DateTime/DateTimeTest.csproj b/src/tests/Interop/PInvoke/DateTime/DateTimeTest.csproj index 747bf11d9db5c3..b1cb7830a007e1 100644 --- a/src/tests/Interop/PInvoke/DateTime/DateTimeTest.csproj +++ b/src/tests/Interop/PInvoke/DateTime/DateTimeTest.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/PInvoke/Delegate/DelegateTest.csproj b/src/tests/Interop/PInvoke/Delegate/DelegateTest.csproj index 533e19ef20a98e..2cdc971285f649 100644 --- a/src/tests/Interop/PInvoke/Delegate/DelegateTest.csproj +++ b/src/tests/Interop/PInvoke/Delegate/DelegateTest.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.csproj b/src/tests/Interop/PInvoke/Generics/GenericsTest.csproj index dc83907f19a11c..fa74de71fc97f3 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.csproj +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.csproj @@ -1,8 +1,6 @@ - - true true $(NoWarn);xUnit2000 diff --git a/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorNative.cpp b/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorNative.cpp index 63c5f3287f456d..462720e7526c7f 100644 --- a/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorNative.cpp +++ b/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorNative.cpp @@ -27,7 +27,7 @@ extern "C" DLL_EXPORT HRESULT STDMETHODCALLTYPE VerifyIntegerEnumerator(IEnumVAR VARIANT element; ULONG numFetched; - + for(int i = start; i < start + count; ++i) { VariantClear(&element); @@ -42,7 +42,7 @@ extern "C" DLL_EXPORT HRESULT STDMETHODCALLTYPE VerifyIntegerEnumerator(IEnumVAR return E_UNEXPECTED; } } - + hr = pEnum->Next(1, &element, &numFetched); if (hr != S_FALSE || numFetched != 0) { @@ -99,6 +99,13 @@ extern "C" DLL_EXPORT HRESULT STDMETHODCALLTYPE VerifyIntegerEnumeration(IDispat return hr; } + hr = VariantClear(&result); + + if (FAILED(hr)) + { + return hr; + } + hr = VerifyIntegerEnumerator(pEnum, start, count); pEnum->Release(); diff --git a/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs b/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs index 42d6741319c611..46c0ec2442825a 100644 --- a/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs +++ b/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs @@ -38,51 +38,40 @@ public static extern void VerifyIntegerEnumeration( public static extern IEnumerator PassThroughEnumerator(IEnumerator enumerator); } + [PlatformSpecific(TestPlatforms.Windows)] + [SkipOnMono("Requires COM support")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/37237", typeof(Utilities), nameof(Utilities.IsGCStress))] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(Utilities), nameof(Utilities.IsNativeAot))] public static class IEnumeratorTests { - private static void TestNativeToManaged() + [Fact] + public static void TestNativeToManaged() { AssertExtensions.CollectionEqual(Enumerable.Range(1, 10), EnumeratorAsEnumerable(IEnumeratorNative.GetIntegerEnumerator(1, 10))); AssertExtensions.CollectionEqual(Enumerable.Range(1, 10), IEnumeratorNative.GetIntegerEnumeration(1, 10).OfType()); } - private static void TestManagedToNative() + [Fact] + public static void TestManagedToNative() { IEnumeratorNative.VerifyIntegerEnumerator(Enumerable.Range(1, 10).GetEnumerator(), 1, 10); IEnumeratorNative.VerifyIntegerEnumeration(Enumerable.Range(1, 10), 1, 10); } - private static void TestNativeRoundTrip() + [Fact] + public static void TestNativeRoundTrip() { IEnumerator nativeEnumerator = IEnumeratorNative.GetIntegerEnumerator(1, 10); Assert.Equal(nativeEnumerator, IEnumeratorNative.PassThroughEnumerator(nativeEnumerator)); } - private static void TestManagedRoundTrip() + [Fact] + public static void TestManagedRoundTrip() { IEnumerator managedEnumerator = Enumerable.Range(1, 10).GetEnumerator(); Assert.Equal(managedEnumerator, IEnumeratorNative.PassThroughEnumerator(managedEnumerator)); } - [Fact] - public static int TestEntryPoint() - { - try - { - TestNativeToManaged(); - TestManagedToNative(); - TestNativeRoundTrip(); - TestManagedRoundTrip(); - } - catch (System.Exception e) - { - Console.WriteLine(e.ToString()); - return 101; - } - - return 100; - } - private static IEnumerable EnumeratorAsEnumerable(IEnumerator enumerator) { while (enumerator.MoveNext()) diff --git a/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.csproj b/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.csproj index 26468cf6e9d7cb..eff1d00c75351d 100644 --- a/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.csproj +++ b/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.csproj @@ -1,12 +1,6 @@ - - true true - - true - - true diff --git a/src/tests/Interop/PInvoke/Int128/Int128Test.csproj b/src/tests/Interop/PInvoke/Int128/Int128Test.csproj index 4759cf93177f7b..f3ad7390614c2b 100644 --- a/src/tests/Interop/PInvoke/Int128/Int128Test.csproj +++ b/src/tests/Interop/PInvoke/Int128/Int128Test.csproj @@ -1,8 +1,6 @@ - - true true embedded diff --git a/src/tests/Interop/PInvoke/Int128/Int128TestFieldLayout.csproj b/src/tests/Interop/PInvoke/Int128/Int128TestFieldLayout.csproj index 5db9dfb6f6d20b..659b364d133a83 100644 --- a/src/tests/Interop/PInvoke/Int128/Int128TestFieldLayout.csproj +++ b/src/tests/Interop/PInvoke/Int128/Int128TestFieldLayout.csproj @@ -1,8 +1,6 @@ - - true true embedded diff --git a/src/tests/Interop/PInvoke/Miscellaneous/HandleRef/HandleRefTest.csproj b/src/tests/Interop/PInvoke/Miscellaneous/HandleRef/HandleRefTest.csproj index 7ebf6e61eae0e9..d9a2574d9520a7 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/HandleRef/HandleRefTest.csproj +++ b/src/tests/Interop/PInvoke/Miscellaneous/HandleRef/HandleRefTest.csproj @@ -1,6 +1,6 @@ - + true true diff --git a/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/MAWSPITest.csproj b/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/MAWSPITest.csproj index 823df0d5495347..55fb397907d01d 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/MAWSPITest.csproj +++ b/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/MAWSPITest.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/PInvoke/Primitives/Int/PInvokeIntTest.csproj b/src/tests/Interop/PInvoke/Primitives/Int/PInvokeIntTest.csproj index 1c16ecaeb6d42c..5bf46810eb6de7 100644 --- a/src/tests/Interop/PInvoke/Primitives/Int/PInvokeIntTest.csproj +++ b/src/tests/Interop/PInvoke/Primitives/Int/PInvokeIntTest.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/PInvoke/Primitives/Pointer/NonBlittablePointer.csproj b/src/tests/Interop/PInvoke/Primitives/Pointer/NonBlittablePointer.csproj index becda68f03e4b6..a2b72af406a968 100644 --- a/src/tests/Interop/PInvoke/Primitives/Pointer/NonBlittablePointer.csproj +++ b/src/tests/Interop/PInvoke/Primitives/Pointer/NonBlittablePointer.csproj @@ -1,8 +1,6 @@ - - true true diff --git a/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.csproj b/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.csproj index 048f70ab5e0f9b..bf386f2ede0aa2 100644 --- a/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.csproj +++ b/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.csproj b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.csproj index 533e19ef20a98e..2cdc971285f649 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.csproj +++ b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/PInvoke/SetLastError/SetLastErrorTest.csproj b/src/tests/Interop/PInvoke/SetLastError/SetLastErrorTest.csproj index 1af9d599ef179e..3136cccdfb5e23 100644 --- a/src/tests/Interop/PInvoke/SetLastError/SetLastErrorTest.csproj +++ b/src/tests/Interop/PInvoke/SetLastError/SetLastErrorTest.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.csproj b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.csproj index dfbf60fa7b60e0..1ea7b7c1d8044d 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.csproj +++ b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.csproj b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.csproj index 2902d6e732b4fc..f0aedf2467dfd9 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.csproj +++ b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.csproj b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.csproj index dfbf60fa7b60e0..1ea7b7c1d8044d 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.csproj +++ b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.csproj b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.csproj index 2902d6e732b4fc..f0aedf2467dfd9 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.csproj +++ b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.csproj @@ -1,8 +1,4 @@ - - - true - diff --git a/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs b/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs index 4ae1f0f3861ffa..140db0a4c54e34 100644 --- a/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs +++ b/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; +using TestLibrary; using Xunit; namespace PInvokeTests @@ -34,6 +35,9 @@ private static bool AssertEqual(string lhs, string rhs) } [Fact] + [PlatformSpecific(TestPlatforms.Windows)] + [SkipOnMono("PInvoke Varargs/ArgIterator marshalling not supported on Mono")] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(Utilities), nameof(Utilities.IsNativeAot))] public static int TestEntryPoint() { var passed = true; diff --git a/src/tests/Interop/PInvoke/Varargs/VarargsTest.csproj b/src/tests/Interop/PInvoke/Varargs/VarargsTest.csproj index aeece7156755b0..e57929398922fa 100644 --- a/src/tests/Interop/PInvoke/Varargs/VarargsTest.csproj +++ b/src/tests/Interop/PInvoke/Varargs/VarargsTest.csproj @@ -1,13 +1,7 @@ - - true true - - true - - true - + diff --git a/src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs b/src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs index e8f354ae4cd3d9..519dd2a3191e0d 100644 --- a/src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs +++ b/src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs @@ -10,6 +10,8 @@ public partial class Test_VariantTest { [Fact] + [PlatformSpecific(TestPlatforms.Windows)] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(Utilities), nameof(Utilities.IsNativeAot))] public static int TestEntryPoint() { bool builtInComDisabled=false; diff --git a/src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs b/src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs index 5ff0d0fab85867..80bf4c7b1728aa 100644 --- a/src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs +++ b/src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs @@ -13,6 +13,8 @@ public partial class Test_VariantTest { [Fact] + [PlatformSpecific(TestPlatforms.Windows)] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(Utilities), nameof(Utilities.IsNativeAot))] public static int TestEntryPoint() { bool testComMarshal=true; diff --git a/src/tests/Interop/PInvoke/Variant/VariantTest.csproj b/src/tests/Interop/PInvoke/Variant/VariantTest.csproj index c1a0b56e5d6f81..99b74f484f5293 100644 --- a/src/tests/Interop/PInvoke/Variant/VariantTest.csproj +++ b/src/tests/Interop/PInvoke/Variant/VariantTest.csproj @@ -1,10 +1,6 @@ - - true true - - true diff --git a/src/tests/Interop/PInvoke/Variant/VariantTestBuiltInComDisabled.csproj b/src/tests/Interop/PInvoke/Variant/VariantTestBuiltInComDisabled.csproj index 4a5f2741b7481a..b26e4cafd218ee 100644 --- a/src/tests/Interop/PInvoke/Variant/VariantTestBuiltInComDisabled.csproj +++ b/src/tests/Interop/PInvoke/Variant/VariantTestBuiltInComDisabled.csproj @@ -1,6 +1,6 @@ - + true true diff --git a/src/tests/Interop/PInvoke/Variant/VariantTestComWrappers.csproj b/src/tests/Interop/PInvoke/Variant/VariantTestComWrappers.csproj index 2c2e341e6a60a1..71ecf6fbf36968 100644 --- a/src/tests/Interop/PInvoke/Variant/VariantTestComWrappers.csproj +++ b/src/tests/Interop/PInvoke/Variant/VariantTestComWrappers.csproj @@ -1,6 +1,6 @@ - + true true From fed19d82f2ae60731f86ef68264fb942a24b3d2c Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Thu, 26 Oct 2023 17:57:03 -0700 Subject: [PATCH 03/19] Convert another test suite to in-process test execution. --- .../AssemblyTrue/AssemblyTrueTest.cs | 19 +++--------------- .../AssemblyTrue/AssemblyTrueTest.csproj | 7 ------- .../AssemblyWithoutComVisibleTest.cs | 20 ++++--------------- .../AssemblyWithoutComVisibleTest.csproj | 7 ------- .../Default/DefaultTest.cs | 20 +++++++------------ .../Default/DefaultTest.csproj | 7 ------- .../Default/DefaultTestInALC.csproj | 17 ---------------- .../Default/TestInALC.cs | 18 ----------------- 8 files changed, 14 insertions(+), 101 deletions(-) delete mode 100644 src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTestInALC.csproj delete mode 100644 src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/TestInALC.cs diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.cs b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.cs index 290638e439cc05..015b22f6decdac 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.cs +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.cs @@ -640,6 +640,9 @@ public sealed class NestedClassGenericServer : INestedInterfaceVisibleTrue, I /// Test case set for ComVisible. The assembly is set as [assembly: ComVisible(false)] /// /// + [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNotNativeAot))] + [PlatformSpecific(TestPlatforms.Windows)] + [SkipOnMono("Requires COM support")] private static void RunComVisibleTests() { int fooSuccessVal = 0; @@ -894,20 +897,4 @@ private static void RunComVisibleTests() Console.WriteLine("CCWTest_NestedInterfaceGenericVisibleTrue"); Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceGenericVisibleTrue((object)nestedGenericServer, out fooSuccessVal)); } - - [Fact] - public static int TestEntryPoint() - { - try - { - RunComVisibleTests(); - - return 100; - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } } diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.csproj b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.csproj index b5eef3045595eb..2797157d39f4e5 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.csproj +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.csproj @@ -1,11 +1,4 @@ - - - true - - true - true - diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.cs b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.cs index 03510001417da7..9587335eb124e4 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.cs +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.cs @@ -639,6 +639,10 @@ public sealed class NestedClassGenericServer : INestedInterfaceVisibleTrue, I /// Test case set for ComVisible. The assembly is set as [assembly: ComVisible(false)] /// /// + /// + [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNotNativeAot))] + [PlatformSpecific(TestPlatforms.Windows)] + [SkipOnMono("Requires COM support")] private static void RunComVisibleTests() { int fooSuccessVal = 0; @@ -893,20 +897,4 @@ private static void RunComVisibleTests() Console.WriteLine("CCWTest_NestedInterfaceGenericVisibleTrue"); Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceGenericVisibleTrue((object)nestedGenericServer, out fooSuccessVal)); } - - [Fact] - public static int TestEntryPoint() - { - try - { - RunComVisibleTests(); - - return 100; - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } } diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.csproj b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.csproj index b307c780747e28..0dfa89286d11f1 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.csproj +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.csproj @@ -1,11 +1,4 @@ - - - true - - true - true - diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs index 3a649eaae98b86..7639ea2d7c215e 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs @@ -348,6 +348,9 @@ public sealed class ClassVisibleTrueServerNoGuid : IInterfaceVisibleTrue private int privateVal; } +[ConditionalClass(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNotNativeAot))] +[PlatformSpecific(TestPlatforms.Windows)] +[SkipOnMono("Requires COM support")] public class ComVisibleServer { /// @@ -701,7 +704,8 @@ public sealed class NestedClassGenericServer : INestedInterfaceVisibleTrue, I /// Test case set for ComVisible. The assembly is set as [assembly: ComVisible(false)] /// /// - private static void RunComVisibleTests() + [Fact] + public static void RunComVisibleTests() { int fooSuccessVal = 0; // @@ -999,18 +1003,8 @@ private static void RunComVisibleTests() } [Fact] - public static int TestEntryPoint() + public static int RunTestsInALC() { - try - { - RunComVisibleTests(); - - return 100; - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } + TestLibrary.Utilities.ExecuteAndUnload(typeof(ComVisibleServer).Assembly.Location, nameof(ComVisibleServer), nameof(RunComVisibleTests)); } } diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.csproj b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.csproj index 338de14473e54e..379fd31e0dcdaa 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.csproj +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.csproj @@ -1,11 +1,4 @@ - - - true - - true - true - diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTestInALC.csproj b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTestInALC.csproj deleted file mode 100644 index 403043997c7385..00000000000000 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTestInALC.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - true - false - - true - true - - - - - - - - - diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/TestInALC.cs b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/TestInALC.cs deleted file mode 100644 index 3ebac7939e6d02..00000000000000 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/TestInALC.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.IO; -using System.Reflection; - -namespace TestInALC -{ - class Test - { - static int Main(string[] args) - { - string currentAssemblyDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - string testAssemblyFullPath = Path.Combine(currentAssemblyDirectory, "DefaultTest.dll"); - return TestLibrary.Utilities.ExecuteAndUnload(testAssemblyFullPath, args); - } - } -} From dde487a2497d6c721c889a0add7bae31efb5e23d Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Thu, 26 Oct 2023 18:09:28 -0700 Subject: [PATCH 04/19] Fix build --- .../{AsLPArrayTest.csproj => ParamAsLPArrayTest.csproj} | 0 src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.cs | 2 +- src/tests/Interop/PInvoke/BestFitMapping/Program.cs | 2 +- .../Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.cs | 2 +- src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs | 4 ++-- .../NativeCallManagedComVisible/Default/DefaultTest.cs | 2 +- ...PassingByOutTest.csproj => ReversePassingByOutTest.csproj} | 0 ...PassingByRefTest.csproj => ReversePassingByRefTest.csproj} | 0 src/tests/Interop/PInvoke/Varargs/VarargsTest.cs | 2 +- src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs | 2 +- src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs | 2 +- 11 files changed, 9 insertions(+), 9 deletions(-) rename src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/{AsLPArrayTest.csproj => ParamAsLPArrayTest.csproj} (100%) rename src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/{PassingByOutTest.csproj => ReversePassingByOutTest.csproj} (100%) rename src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/{PassingByRefTest.csproj => ReversePassingByRefTest.csproj} (100%) diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.csproj b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/ParamAsLPArrayTest.csproj similarity index 100% rename from src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.csproj rename to src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/ParamAsLPArrayTest.csproj diff --git a/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.cs b/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.cs index 879ac26ae3cc4e..fdec3c7c97e08f 100644 --- a/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.cs +++ b/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.cs @@ -31,7 +31,7 @@ private static string Reverse(string s) [Fact] [PlatformSpecific(TestPlatforms.Windows)] [SkipOnMono("PInvoke LCIDConversionAttribute not supported on Mono")] - [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(Utilities), nameof(Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Program.cs b/src/tests/Interop/PInvoke/BestFitMapping/Program.cs index c985202278c5fc..1b74451a1c5b91 100644 --- a/src/tests/Interop/PInvoke/BestFitMapping/Program.cs +++ b/src/tests/Interop/PInvoke/BestFitMapping/Program.cs @@ -13,7 +13,7 @@ public class Program [Fact] [PlatformSpecific(TestPlatforms.Windows)] [SkipOnMono("Mono doesn't support interop BestFitMapping and ThrowOnUnmappableChar attributes")] - [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(Utilities), nameof(Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestEntryPoint() { if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") diff --git a/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.cs b/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.cs index 00fd022b76762c..9edf98028b6a5a 100644 --- a/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.cs +++ b/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.cs @@ -29,7 +29,7 @@ public static class CustomMarshalersTests [Fact] [PlatformSpecific(TestPlatforms.Windows)] [SkipOnMono("These custom marshallers were never built-in to the runtime on Mono")] - [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(Utilities), nameof(Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs b/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs index 46c0ec2442825a..531a9ef63da23f 100644 --- a/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs +++ b/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs @@ -40,8 +40,8 @@ public static extern void VerifyIntegerEnumeration( [PlatformSpecific(TestPlatforms.Windows)] [SkipOnMono("Requires COM support")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/37237", typeof(Utilities), nameof(Utilities.IsGCStress))] - [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(Utilities), nameof(Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/37237", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsGCStress))] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static class IEnumeratorTests { [Fact] diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs index 7639ea2d7c215e..02252520217246 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs @@ -1003,7 +1003,7 @@ public static void RunComVisibleTests() } [Fact] - public static int RunTestsInALC() + public static void RunTestsInALC() { TestLibrary.Utilities.ExecuteAndUnload(typeof(ComVisibleServer).Assembly.Location, nameof(ComVisibleServer), nameof(RunComVisibleTests)); } diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.csproj b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/ReversePassingByOutTest.csproj similarity index 100% rename from src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.csproj rename to src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/ReversePassingByOutTest.csproj diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.csproj b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/ReversePassingByRefTest.csproj similarity index 100% rename from src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.csproj rename to src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/ReversePassingByRefTest.csproj diff --git a/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs b/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs index 140db0a4c54e34..4275ef7e4c0db1 100644 --- a/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs +++ b/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs @@ -37,7 +37,7 @@ private static bool AssertEqual(string lhs, string rhs) [Fact] [PlatformSpecific(TestPlatforms.Windows)] [SkipOnMono("PInvoke Varargs/ArgIterator marshalling not supported on Mono")] - [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(Utilities), nameof(Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static int TestEntryPoint() { var passed = true; diff --git a/src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs b/src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs index 519dd2a3191e0d..6e2f062f8412df 100644 --- a/src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs +++ b/src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs @@ -11,7 +11,7 @@ public partial class Test_VariantTest { [Fact] [PlatformSpecific(TestPlatforms.Windows)] - [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(Utilities), nameof(Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static int TestEntryPoint() { bool builtInComDisabled=false; diff --git a/src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs b/src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs index 80bf4c7b1728aa..6300227887921c 100644 --- a/src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs +++ b/src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs @@ -14,7 +14,7 @@ public partial class Test_VariantTest { [Fact] [PlatformSpecific(TestPlatforms.Windows)] - [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(Utilities), nameof(Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static int TestEntryPoint() { bool testComMarshal=true; From 1821e39749c32d5776761c55e9278fc2c335d5de Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Fri, 27 Oct 2023 11:55:09 -0700 Subject: [PATCH 05/19] Update based on merged PR. --- .../Interop/PInvoke/IEnumerator/IEnumeratorNative.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorNative.cpp b/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorNative.cpp index 462720e7526c7f..a0413540382c37 100644 --- a/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorNative.cpp +++ b/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorNative.cpp @@ -99,13 +99,6 @@ extern "C" DLL_EXPORT HRESULT STDMETHODCALLTYPE VerifyIntegerEnumeration(IDispat return hr; } - hr = VariantClear(&result); - - if (FAILED(hr)) - { - return hr; - } - hr = VerifyIntegerEnumerator(pEnum, start, count); pEnum->Release(); From a85f7ed13922b775c8bcbf503835796c0da02d67 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Fri, 27 Oct 2023 12:11:13 -0700 Subject: [PATCH 06/19] Convert GenericsTest to use the merged runner. --- .../Generics/GenericsTest.IComInterfaceB.cs | 6 +- .../Generics/GenericsTest.IComInterfaceC.cs | 6 +- .../Generics/GenericsTest.IComInterfaceD.cs | 6 +- .../Generics/GenericsTest.IComInterfaceF.cs | 6 +- .../Generics/GenericsTest.IComInterfaceL.cs | 6 +- .../Generics/GenericsTest.IComInterfaceU.cs | 6 +- .../Generics/GenericsTest.NullableB.cs | 5 +- .../Generics/GenericsTest.NullableC.cs | 5 +- .../Generics/GenericsTest.NullableD.cs | 5 +- .../Generics/GenericsTest.NullableF.cs | 5 +- .../Generics/GenericsTest.NullableL.cs | 5 +- .../Generics/GenericsTest.NullableU.cs | 5 +- .../PInvoke/Generics/GenericsTest.Point1B.cs | 5 +- .../PInvoke/Generics/GenericsTest.Point1C.cs | 5 +- .../PInvoke/Generics/GenericsTest.Point1D.cs | 23 +- .../PInvoke/Generics/GenericsTest.Point1F.cs | 23 +- .../PInvoke/Generics/GenericsTest.Point1L.cs | 23 +- .../PInvoke/Generics/GenericsTest.Point1U.cs | 23 +- .../PInvoke/Generics/GenericsTest.Point2B.cs | 5 +- .../PInvoke/Generics/GenericsTest.Point2C.cs | 5 +- .../PInvoke/Generics/GenericsTest.Point2D.cs | 41 ++-- .../PInvoke/Generics/GenericsTest.Point2F.cs | 41 ++-- .../PInvoke/Generics/GenericsTest.Point2L.cs | 41 ++-- .../PInvoke/Generics/GenericsTest.Point2U.cs | 41 ++-- .../PInvoke/Generics/GenericsTest.Point3B.cs | 5 +- .../PInvoke/Generics/GenericsTest.Point3C.cs | 5 +- .../PInvoke/Generics/GenericsTest.Point3D.cs | 59 ++--- .../PInvoke/Generics/GenericsTest.Point3F.cs | 59 ++--- .../PInvoke/Generics/GenericsTest.Point3L.cs | 59 ++--- .../PInvoke/Generics/GenericsTest.Point3U.cs | 59 ++--- .../PInvoke/Generics/GenericsTest.Point4B.cs | 5 +- .../PInvoke/Generics/GenericsTest.Point4C.cs | 5 +- .../PInvoke/Generics/GenericsTest.Point4D.cs | 77 +++---- .../PInvoke/Generics/GenericsTest.Point4F.cs | 77 +++---- .../PInvoke/Generics/GenericsTest.Point4L.cs | 77 +++---- .../PInvoke/Generics/GenericsTest.Point4U.cs | 77 +++---- .../Generics/GenericsTest.ReadOnlySpanB.cs | 5 +- .../Generics/GenericsTest.ReadOnlySpanC.cs | 5 +- .../Generics/GenericsTest.ReadOnlySpanD.cs | 5 +- .../Generics/GenericsTest.ReadOnlySpanF.cs | 5 +- .../Generics/GenericsTest.ReadOnlySpanL.cs | 5 +- .../Generics/GenericsTest.ReadOnlySpanU.cs | 5 +- .../Generics/GenericsTest.SequentialClassB.cs | 5 +- .../Generics/GenericsTest.SequentialClassC.cs | 5 +- .../Generics/GenericsTest.SequentialClassD.cs | 5 +- .../Generics/GenericsTest.SequentialClassF.cs | 5 +- .../Generics/GenericsTest.SequentialClassL.cs | 5 +- .../Generics/GenericsTest.SequentialClassU.cs | 5 +- .../PInvoke/Generics/GenericsTest.SpanB.cs | 5 +- .../PInvoke/Generics/GenericsTest.SpanC.cs | 5 +- .../PInvoke/Generics/GenericsTest.SpanD.cs | 5 +- .../PInvoke/Generics/GenericsTest.SpanF.cs | 5 +- .../PInvoke/Generics/GenericsTest.SpanL.cs | 5 +- .../PInvoke/Generics/GenericsTest.SpanU.cs | 5 +- .../Generics/GenericsTest.Vector128B.cs | 69 +++--- .../Generics/GenericsTest.Vector128C.cs | 37 ++-- .../Generics/GenericsTest.Vector128D.cs | 13 +- .../Generics/GenericsTest.Vector128F.cs | 21 +- .../Generics/GenericsTest.Vector128L.cs | 13 +- .../Generics/GenericsTest.Vector128U.cs | 21 +- .../Generics/GenericsTest.Vector256B.cs | 133 ++++++------ .../Generics/GenericsTest.Vector256C.cs | 69 +++--- .../Generics/GenericsTest.Vector256D.cs | 21 +- .../Generics/GenericsTest.Vector256F.cs | 37 ++-- .../Generics/GenericsTest.Vector256L.cs | 21 +- .../Generics/GenericsTest.Vector256U.cs | 37 ++-- .../Generics/GenericsTest.Vector64B.cs | 37 ++-- .../Generics/GenericsTest.Vector64C.cs | 21 +- .../Generics/GenericsTest.Vector64D.cs | 9 +- .../Generics/GenericsTest.Vector64F.cs | 13 +- .../Generics/GenericsTest.Vector64L.cs | 9 +- .../Generics/GenericsTest.Vector64U.cs | 13 +- .../PInvoke/Generics/GenericsTest.VectorB.cs | 205 +++++++++--------- .../PInvoke/Generics/GenericsTest.VectorC.cs | 109 +++++----- .../PInvoke/Generics/GenericsTest.VectorD.cs | 37 ++-- .../PInvoke/Generics/GenericsTest.VectorF.cs | 61 +++--- .../PInvoke/Generics/GenericsTest.VectorL.cs | 37 ++-- .../PInvoke/Generics/GenericsTest.VectorU.cs | 61 +++--- .../Interop/PInvoke/Generics/GenericsTest.cs | 197 +---------------- .../PInvoke/Generics/GenericsTest.csproj | 1 - 80 files changed, 1100 insertions(+), 1198 deletions(-) diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceB.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceB.cs index 3ca01be785ae67..7134ad5432d856 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceB.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceB.cs @@ -25,9 +25,11 @@ unsafe partial class GenericsNative public static extern void GetIComInterfaceBs([MarshalAs(UnmanagedType.Interface)] ref IComInterface pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestIComInterfaceB() + [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + public static void TestIComInterfaceB() { Assert.Throws(() => GenericsNative.GetIComInterfaceB()); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceC.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceC.cs index 9259a828f88140..60b4fb1e5d22da 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceC.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceC.cs @@ -25,9 +25,11 @@ unsafe partial class GenericsNative public static extern void GetIComInterfaceCs([MarshalAs(UnmanagedType.Interface)] ref IComInterface pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestIComInterfaceC() + [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + public static void TestIComInterfaceC() { Assert.Throws(() => GenericsNative.GetIComInterfaceC()); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceD.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceD.cs index 6fa84268e34a34..99df3c1a13481b 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceD.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceD.cs @@ -25,9 +25,11 @@ unsafe partial class GenericsNative public static extern void GetIComInterfaceDs([MarshalAs(UnmanagedType.Interface)] ref IComInterface pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestIComInterfaceD() + [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + public static void TestIComInterfaceD() { Assert.Throws(() => GenericsNative.GetIComInterfaceD()); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceF.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceF.cs index 0f0e7e10e4d7a3..675d9fd9d1b41a 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceF.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceF.cs @@ -25,9 +25,11 @@ unsafe partial class GenericsNative public static extern void GetIComInterfaceFs([MarshalAs(UnmanagedType.Interface)] ref IComInterface pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestIComInterfaceF() + [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + public static void TestIComInterfaceF() { Assert.Throws(() => GenericsNative.GetIComInterfaceF()); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceL.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceL.cs index 2b8cb74006a70d..dd85ae3b2f3898 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceL.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceL.cs @@ -25,9 +25,11 @@ unsafe partial class GenericsNative public static extern void GetIComInterfaceLs([MarshalAs(UnmanagedType.Interface)] ref IComInterface pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestIComInterfaceL() + [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + public static void TestIComInterfaceL() { Assert.Throws(() => GenericsNative.GetIComInterfaceL()); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceU.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceU.cs index 365ad7a9096c4c..e3dabf1a988018 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceU.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceU.cs @@ -25,9 +25,11 @@ unsafe partial class GenericsNative public static extern void GetIComInterfaceUs([MarshalAs(UnmanagedType.Interface)] ref IComInterface pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestIComInterfaceU() + [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + public static void TestIComInterfaceU() { Assert.Throws(() => GenericsNative.GetIComInterfaceU()); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableB.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableB.cs index 83d787e613aa89..caaa4e7627133e 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableB.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableB.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern bool? AddNullableBs(in bool? pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestNullableB() + [Fact] + public static void TestNullableB() { Assert.Throws(() => GenericsNative.GetNullableB(true, false)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableC.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableC.cs index 728ef995c14b2f..ce7584e85b935b 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableC.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableC.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern char? AddNullableCs(in char? pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestNullableC() + [Fact] + public static void TestNullableC() { Assert.Throws(() => GenericsNative.GetNullableC(true, '1')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableD.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableD.cs index ef5a3264bf85ea..8bc34ce1803b9f 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableD.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableD.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern double? AddNullableDs(in double? pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestNullableD() + [Fact] + public static void TestNullableD() { Assert.Throws(() => GenericsNative.GetNullableD(true, 1.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableF.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableF.cs index f5933b1708431a..510cebaa4778df 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableF.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableF.cs @@ -25,9 +25,10 @@ unsafe partial class GenericsNative public static extern float? AddNullableFs(in float? pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestNullableF() + [Fact] + public static void TestNullableF() { Assert.Throws(() => GenericsNative.GetNullableF(true, 1.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableL.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableL.cs index 6cc2b03101307b..11c8eec55365c8 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableL.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableL.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern long? AddNullableLs(in long? pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestNullableL() + [Fact] + public static void TestNullableL() { Assert.Throws(() => GenericsNative.GetNullableL(true, 1L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableU.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableU.cs index e51e1a06f91a9f..19fd3a2d4ac55c 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableU.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableU.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern uint? AddNullableUs(in uint? pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestNullableU() + [Fact] + public static void TestNullableU() { Assert.Throws(() => GenericsNative.GetNullableU(true, 1u)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1B.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1B.cs index 726628e731c6f2..5e2e83a4f15532 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1B.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1B.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern Point1 AddPoint1Bs(in Point1 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint1B() + [Fact] + public static void TestPoint1B() { Assert.Throws(() => GenericsNative.GetPoint1B(true)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1C.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1C.cs index 4c39e0b14da361..92203e32b6c2d8 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1C.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1C.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern Point1 AddPoint1Cs(in Point1 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint1C() + [Fact] + public static void TestPoint1C() { Assert.Throws(() => GenericsNative.GetPoint1C('1')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1D.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1D.cs index 0dc19c5362173b..a5693827ded156 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1D.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1D.cs @@ -35,28 +35,29 @@ unsafe partial class GenericsNative public static extern Point1 AddPoint1Ds(in Point1 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint1D() + [Fact] + public static void TestPoint1D() { GenericsNative.Point1 value = GenericsNative.GetPoint1D(1.0); - Assert.Equal(value.e00, 1.0); + Assert.Equal(1.0, value.e00); GenericsNative.Point1 value2; GenericsNative.GetPoint1DOut(1.0, &value2); - Assert.Equal(value2.e00, 1.0); + Assert.Equal(1.0, value2.e00); GenericsNative.GetPoint1DOut(1.0, out GenericsNative.Point1 value3); - Assert.Equal(value3.e00, 1.0); + Assert.Equal(1.0, value3.e00); GenericsNative.Point1* value4 = GenericsNative.GetPoint1DPtr(1.0); - Assert.Equal(value4->e00, 1.0); + Assert.Equal(1.0, value4->e00); ref readonly GenericsNative.Point1 value5 = ref GenericsNative.GetPoint1DRef(1.0); - Assert.Equal(value5.e00, 1.0); + Assert.Equal(1.0, value5.e00); GenericsNative.Point1 result = GenericsNative.AddPoint1D(value, value); - Assert.Equal(result.e00, 2.0); + Assert.Equal(2.0, result.e00); GenericsNative.Point1[] values = new GenericsNative.Point1[] { value, @@ -69,13 +70,13 @@ private static void TestPoint1D() fixed (GenericsNative.Point1* pValues = &values[0]) { GenericsNative.Point1 result2 = GenericsNative.AddPoint1Ds(pValues, values.Length); - Assert.Equal(result2.e00, 5.0); + Assert.Equal(5.0, result2.e00); } GenericsNative.Point1 result3 = GenericsNative.AddPoint1Ds(values, values.Length); - Assert.Equal(result3.e00, 5.0); + Assert.Equal(5.0, result3.e00); GenericsNative.Point1 result4 = GenericsNative.AddPoint1Ds(in values[0], values.Length); - Assert.Equal(result4.e00, 5.0); + Assert.Equal(5.0, result4.e00); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1F.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1F.cs index 29f6acddb6d627..599106aa98ef22 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1F.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1F.cs @@ -35,28 +35,29 @@ unsafe partial class GenericsNative public static extern Point1 AddPoint1Fs(in Point1 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint1F() + [Fact] + public static void TestPoint1F() { GenericsNative.Point1 value = GenericsNative.GetPoint1F(1.0f); - Assert.Equal(value.e00, 1.0f); + Assert.Equal(1.0f, value.e00); GenericsNative.Point1 value2; GenericsNative.GetPoint1FOut(1.0f, &value2); - Assert.Equal(value2.e00, 1.0f); + Assert.Equal(1.0f, value2.e00); GenericsNative.GetPoint1FOut(1.0f, out GenericsNative.Point1 value3); - Assert.Equal(value3.e00, 1.0f); + Assert.Equal(1.0f, value3.e00); GenericsNative.Point1* value4 = GenericsNative.GetPoint1FPtr(1.0f); - Assert.Equal(value4->e00, 1.0f); + Assert.Equal(1.0f, value4->e00); ref readonly GenericsNative.Point1 value5 = ref GenericsNative.GetPoint1FRef(1.0f); - Assert.Equal(value5.e00, 1.0f); + Assert.Equal(1.0f, value5.e00); GenericsNative.Point1 result = GenericsNative.AddPoint1F(value, value); - Assert.Equal(result.e00, 2.0f); + Assert.Equal(2.0f, result.e00); GenericsNative.Point1[] values = new GenericsNative.Point1[] { value, @@ -69,13 +70,13 @@ private static void TestPoint1F() fixed (GenericsNative.Point1* pValues = &values[0]) { GenericsNative.Point1 result2 = GenericsNative.AddPoint1Fs(pValues, values.Length); - Assert.Equal(result2.e00, 5.0f); + Assert.Equal(5.0f, result2.e00); } GenericsNative.Point1 result3 = GenericsNative.AddPoint1Fs(values, values.Length); - Assert.Equal(result3.e00, 5.0f); + Assert.Equal(5.0f, result3.e00); GenericsNative.Point1 result4 = GenericsNative.AddPoint1Fs(in values[0], values.Length); - Assert.Equal(result4.e00, 5.0f); + Assert.Equal(5.0f, result4.e00); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1L.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1L.cs index d981f07d14d836..788d4d9f826e2e 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1L.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1L.cs @@ -35,28 +35,29 @@ unsafe partial class GenericsNative public static extern Point1 AddPoint1Ls(in Point1 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint1L() + [Fact] + public static void TestPoint1L() { GenericsNative.Point1 value = GenericsNative.GetPoint1L(1L); - Assert.Equal(value.e00, 1L); + Assert.Equal(1L, value.e00); GenericsNative.Point1 value2; GenericsNative.GetPoint1LOut(1L, &value2); - Assert.Equal(value2.e00, 1L); + Assert.Equal(1L, value2.e00); GenericsNative.GetPoint1LOut(1L, out GenericsNative.Point1 value3); - Assert.Equal(value3.e00, 1L); + Assert.Equal(1L, value3.e00); GenericsNative.Point1* value4 = GenericsNative.GetPoint1LPtr(1L); - Assert.Equal(value4->e00, 1L); + Assert.Equal(1L, value4->e00); ref readonly GenericsNative.Point1 value5 = ref GenericsNative.GetPoint1LRef(1L); - Assert.Equal(value5.e00, 1L); + Assert.Equal(1L, value5.e00); GenericsNative.Point1 result = GenericsNative.AddPoint1L(value, value); - Assert.Equal(result.e00, 2L); + Assert.Equal(2L, result.e00); GenericsNative.Point1[] values = new GenericsNative.Point1[] { value, @@ -69,13 +70,13 @@ private static void TestPoint1L() fixed (GenericsNative.Point1* pValues = &values[0]) { GenericsNative.Point1 result2 = GenericsNative.AddPoint1Ls(pValues, values.Length); - Assert.Equal(result2.e00, 5l); + Assert.Equal(5l, result2.e00); } GenericsNative.Point1 result3 = GenericsNative.AddPoint1Ls(values, values.Length); - Assert.Equal(result3.e00, 5l); + Assert.Equal(5l, result3.e00); GenericsNative.Point1 result4 = GenericsNative.AddPoint1Ls(in values[0], values.Length); - Assert.Equal(result4.e00, 5l); + Assert.Equal(5l, result4.e00); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1U.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1U.cs index 8aeda75880f2ca..6d9cb8c82ca5ab 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1U.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1U.cs @@ -35,28 +35,29 @@ unsafe partial class GenericsNative public static extern Point1 AddPoint1Us(in Point1 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint1U() + [Fact] + public static void TestPoint1U() { GenericsNative.Point1 value = GenericsNative.GetPoint1U(1u); - Assert.Equal(value.e00, 1u); + Assert.Equal(1u, value.e00); GenericsNative.Point1 value2; GenericsNative.GetPoint1UOut(1u, &value2); - Assert.Equal(value2.e00, 1u); + Assert.Equal(1u, value2.e00); GenericsNative.GetPoint1UOut(1u, out GenericsNative.Point1 value3); - Assert.Equal(value3.e00, 1u); + Assert.Equal(1u, value3.e00); GenericsNative.Point1* value4 = GenericsNative.GetPoint1UPtr(1u); - Assert.Equal(value4->e00, 1u); + Assert.Equal(1u, value4->e00); ref readonly GenericsNative.Point1 value5 = ref GenericsNative.GetPoint1URef(1u); - Assert.Equal(value5.e00, 1u); + Assert.Equal(1u, value5.e00); GenericsNative.Point1 result = GenericsNative.AddPoint1U(value, value); - Assert.Equal(result.e00, 2u); + Assert.Equal(2u, result.e00); GenericsNative.Point1[] values = new GenericsNative.Point1[] { value, @@ -69,13 +70,13 @@ private static void TestPoint1U() fixed (GenericsNative.Point1* pValues = &values[0]) { GenericsNative.Point1 result2 = GenericsNative.AddPoint1Us(pValues, values.Length); - Assert.Equal(result2.e00, 5u); + Assert.Equal(5u, result2.e00); } GenericsNative.Point1 result3 = GenericsNative.AddPoint1Us(values, values.Length); - Assert.Equal(result3.e00, 5u); + Assert.Equal(5u, result3.e00); GenericsNative.Point1 result4 = GenericsNative.AddPoint1Us(in values[0], values.Length); - Assert.Equal(result4.e00, 5u); + Assert.Equal(5u, result4.e00); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2B.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2B.cs index 41710f1bf1c1e8..d23b5cd9942837 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2B.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2B.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern Point2 AddPoint2Bs(in Point2 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint2B() + [Fact] + public static void TestPoint2B() { Assert.Throws(() => GenericsNative.GetPoint2B(true, false)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2C.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2C.cs index e54ff64e86e628..8f1b87f0b91e5a 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2C.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2C.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern Point2 AddPoint2Cs(in Point2 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint2C() + [Fact] + public static void TestPoint2C() { Assert.Throws(() => GenericsNative.GetPoint2C('1', '2')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2D.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2D.cs index b269a7ac0487d1..9b692e2e1c2088 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2D.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2D.cs @@ -35,34 +35,35 @@ unsafe partial class GenericsNative public static extern Point2 AddPoint2Ds(in Point2 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint2D() + [Fact] + public static void TestPoint2D() { GenericsNative.Point2 value = GenericsNative.GetPoint2D(1.0, 2.0); - Assert.Equal(value.e00, 1.0); - Assert.Equal(value.e01, 2.0); + Assert.Equal(1.0, value.e00); + Assert.Equal(2.0, value.e01); GenericsNative.Point2 value2; GenericsNative.GetPoint2DOut(1.0, 2.0, &value2); - Assert.Equal(value2.e00, 1.0); - Assert.Equal(value2.e01, 2.0); + Assert.Equal(1.0, value2.e00); + Assert.Equal(2.0, value2.e01); GenericsNative.GetPoint2DOut(1.0, 2.0, out GenericsNative.Point2 value3); - Assert.Equal(value3.e00, 1.0); - Assert.Equal(value3.e01, 2.0); + Assert.Equal(1.0, value3.e00); + Assert.Equal(2.0, value3.e01); GenericsNative.Point2* value4 = GenericsNative.GetPoint2DPtr(1.0, 2.0); - Assert.Equal(value4->e00, 1.0); - Assert.Equal(value4->e01, 2.0); + Assert.Equal(1.0, value4->e00); + Assert.Equal(2.0, value4->e01); ref readonly GenericsNative.Point2 value5 = ref GenericsNative.GetPoint2DRef(1.0, 2.0); - Assert.Equal(value5.e00, 1.0); - Assert.Equal(value5.e01, 2.0); + Assert.Equal(1.0, value5.e00); + Assert.Equal(2.0, value5.e01); GenericsNative.Point2 result = GenericsNative.AddPoint2D(value, value); - Assert.Equal(result.e00, 2.0); - Assert.Equal(result.e01, 4.0); + Assert.Equal(2.0, result.e00); + Assert.Equal(4.0, result.e01); GenericsNative.Point2[] values = new GenericsNative.Point2[] { value, @@ -75,16 +76,16 @@ private static void TestPoint2D() fixed (GenericsNative.Point2* pValues = &values[0]) { GenericsNative.Point2 result2 = GenericsNative.AddPoint2Ds(pValues, values.Length); - Assert.Equal(result2.e00, 5.0); - Assert.Equal(result2.e01, 10.0); + Assert.Equal(5.0, result2.e00); + Assert.Equal(10.0, result2.e01); } GenericsNative.Point2 result3 = GenericsNative.AddPoint2Ds(values, values.Length); - Assert.Equal(result3.e00, 5.0); - Assert.Equal(result3.e01, 10.0); + Assert.Equal(5.0, result3.e00); + Assert.Equal(10.0, result3.e01); GenericsNative.Point2 result4 = GenericsNative.AddPoint2Ds(in values[0], values.Length); - Assert.Equal(result4.e00, 5.0); - Assert.Equal(result4.e01, 10.0); + Assert.Equal(5.0, result4.e00); + Assert.Equal(10.0, result4.e01); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2F.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2F.cs index 27855458f80910..a5a52b0cf449c6 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2F.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2F.cs @@ -35,34 +35,35 @@ unsafe partial class GenericsNative public static extern Point2 AddPoint2Fs(in Point2 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint2F() + [Fact] + public static void TestPoint2F() { GenericsNative.Point2 value = GenericsNative.GetPoint2F(1.0f, 2.0f); - Assert.Equal(value.e00, 1.0f); - Assert.Equal(value.e01, 2.0f); + Assert.Equal(1.0f, value.e00); + Assert.Equal(2.0f, value.e01); GenericsNative.Point2 value2; GenericsNative.GetPoint2FOut(1.0f, 2.0f, &value2); - Assert.Equal(value2.e00, 1.0f); - Assert.Equal(value2.e01, 2.0f); + Assert.Equal(1.0f, value2.e00); + Assert.Equal(2.0f, value2.e01); GenericsNative.GetPoint2FOut(1.0f, 2.0f, out GenericsNative.Point2 value3); - Assert.Equal(value3.e00, 1.0f); - Assert.Equal(value3.e01, 2.0f); + Assert.Equal(1.0f, value3.e00); + Assert.Equal(2.0f, value3.e01); GenericsNative.Point2* value4 = GenericsNative.GetPoint2FPtr(1.0f, 2.0f); - Assert.Equal(value4->e00, 1.0f); - Assert.Equal(value4->e01, 2.0f); + Assert.Equal(1.0f, value4->e00); + Assert.Equal(2.0f, value4->e01); ref readonly GenericsNative.Point2 value5 = ref GenericsNative.GetPoint2FRef(1.0f, 2.0f); - Assert.Equal(value5.e00, 1.0f); - Assert.Equal(value5.e01, 2.0f); + Assert.Equal(1.0f, value5.e00); + Assert.Equal(2.0f, value5.e01); GenericsNative.Point2 result = GenericsNative.AddPoint2F(value, value); - Assert.Equal(result.e00, 2.0f); - Assert.Equal(result.e01, 4.0f); + Assert.Equal(2.0f, result.e00); + Assert.Equal(4.0f, result.e01); GenericsNative.Point2[] values = new GenericsNative.Point2[] { value, @@ -75,16 +76,16 @@ private static void TestPoint2F() fixed (GenericsNative.Point2* pValues = &values[0]) { GenericsNative.Point2 result2 = GenericsNative.AddPoint2Fs(pValues, values.Length); - Assert.Equal(result2.e00, 5.0f); - Assert.Equal(result2.e01, 10.0f); + Assert.Equal(5.0f, result2.e00); + Assert.Equal(10.0f, result2.e01); } GenericsNative.Point2 result3 = GenericsNative.AddPoint2Fs(values, values.Length); - Assert.Equal(result3.e00, 5.0f); - Assert.Equal(result3.e01, 10.0f); + Assert.Equal(5.0f, result3.e00); + Assert.Equal(10.0f, result3.e01); GenericsNative.Point2 result4 = GenericsNative.AddPoint2Fs(in values[0], values.Length); - Assert.Equal(result4.e00, 5.0f); - Assert.Equal(result4.e01, 10.0f); + Assert.Equal(5.0f, result4.e00); + Assert.Equal(10.0f, result4.e01); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2L.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2L.cs index 7220acb39715a6..2d76786362c91f 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2L.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2L.cs @@ -35,34 +35,35 @@ unsafe partial class GenericsNative public static extern Point2 AddPoint2Ls(in Point2 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint2L() + [Fact] + public static void TestPoint2L() { GenericsNative.Point2 value = GenericsNative.GetPoint2L(1L, 2L); - Assert.Equal(value.e00, 1L); - Assert.Equal(value.e01, 2L); + Assert.Equal(1L, value.e00); + Assert.Equal(2L, value.e01); GenericsNative.Point2 value2; GenericsNative.GetPoint2LOut(1L, 2L, &value2); - Assert.Equal(value2.e00, 1L); - Assert.Equal(value2.e01, 2L); + Assert.Equal(1L, value2.e00); + Assert.Equal(2L, value2.e01); GenericsNative.GetPoint2LOut(1L, 2L, out GenericsNative.Point2 value3); - Assert.Equal(value3.e00, 1L); - Assert.Equal(value3.e01, 2L); + Assert.Equal(1L, value3.e00); + Assert.Equal(2L, value3.e01); GenericsNative.Point2* value4 = GenericsNative.GetPoint2LPtr(1L, 2L); - Assert.Equal(value4->e00, 1L); - Assert.Equal(value4->e01, 2L); + Assert.Equal(1L, value4->e00); + Assert.Equal(2L, value4->e01); ref readonly GenericsNative.Point2 value5 = ref GenericsNative.GetPoint2LRef(1L, 2L); - Assert.Equal(value5.e00, 1L); - Assert.Equal(value5.e01, 2L); + Assert.Equal(1L, value5.e00); + Assert.Equal(2L, value5.e01); GenericsNative.Point2 result = GenericsNative.AddPoint2L(value, value); - Assert.Equal(result.e00, 2L); - Assert.Equal(result.e01, 4L); + Assert.Equal(2L, result.e00); + Assert.Equal(4L, result.e01); GenericsNative.Point2[] values = new GenericsNative.Point2[] { value, @@ -75,16 +76,16 @@ private static void TestPoint2L() fixed (GenericsNative.Point2* pValues = &values[0]) { GenericsNative.Point2 result2 = GenericsNative.AddPoint2Ls(pValues, values.Length); - Assert.Equal(result2.e00, 5l); - Assert.Equal(result2.e01, 10l); + Assert.Equal(5l, result2.e00); + Assert.Equal(10l, result2.e01); } GenericsNative.Point2 result3 = GenericsNative.AddPoint2Ls(values, values.Length); - Assert.Equal(result3.e00, 5l); - Assert.Equal(result3.e01, 10l); + Assert.Equal(5l, result3.e00); + Assert.Equal(10l, result3.e01); GenericsNative.Point2 result4 = GenericsNative.AddPoint2Ls(in values[0], values.Length); - Assert.Equal(result4.e00, 5l); - Assert.Equal(result4.e01, 10l); + Assert.Equal(5l, result4.e00); + Assert.Equal(10l, result4.e01); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2U.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2U.cs index 05d3e5f4a978a9..e3244435500f60 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2U.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2U.cs @@ -35,34 +35,35 @@ unsafe partial class GenericsNative public static extern Point2 AddPoint2Us(in Point2 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint2U() + [Fact] + public static void TestPoint2U() { GenericsNative.Point2 value = GenericsNative.GetPoint2U(1u, 2u); - Assert.Equal(value.e00, 1u); - Assert.Equal(value.e01, 2u); + Assert.Equal(1u, value.e00); + Assert.Equal(2u, value.e01); GenericsNative.Point2 value2; GenericsNative.GetPoint2UOut(1u, 2u, &value2); - Assert.Equal(value2.e00, 1u); - Assert.Equal(value2.e01, 2u); + Assert.Equal(1u, value2.e00); + Assert.Equal(2u, value2.e01); GenericsNative.GetPoint2UOut(1u, 2u, out GenericsNative.Point2 value3); - Assert.Equal(value3.e00, 1u); - Assert.Equal(value3.e01, 2u); + Assert.Equal(1u, value3.e00); + Assert.Equal(2u, value3.e01); GenericsNative.Point2* value4 = GenericsNative.GetPoint2UPtr(1u, 2u); - Assert.Equal(value4->e00, 1u); - Assert.Equal(value4->e01, 2u); + Assert.Equal(1u, value4->e00); + Assert.Equal(2u, value4->e01); ref readonly GenericsNative.Point2 value5 = ref GenericsNative.GetPoint2URef(1u, 2u); - Assert.Equal(value5.e00, 1u); - Assert.Equal(value5.e01, 2u); + Assert.Equal(1u, value5.e00); + Assert.Equal(2u, value5.e01); GenericsNative.Point2 result = GenericsNative.AddPoint2U(value, value); - Assert.Equal(result.e00, 2u); - Assert.Equal(result.e01, 4u); + Assert.Equal(2u, result.e00); + Assert.Equal(4u, result.e01); GenericsNative.Point2[] values = new GenericsNative.Point2[] { value, @@ -75,16 +76,16 @@ private static void TestPoint2U() fixed (GenericsNative.Point2* pValues = &values[0]) { GenericsNative.Point2 result2 = GenericsNative.AddPoint2Us(pValues, values.Length); - Assert.Equal(result2.e00, 5u); - Assert.Equal(result2.e01, 10u); + Assert.Equal(5u, result2.e00); + Assert.Equal(10u, result2.e01); } GenericsNative.Point2 result3 = GenericsNative.AddPoint2Us(values, values.Length); - Assert.Equal(result3.e00, 5u); - Assert.Equal(result3.e01, 10u); + Assert.Equal(5u, result3.e00); + Assert.Equal(10u, result3.e01); GenericsNative.Point2 result4 = GenericsNative.AddPoint2Us(in values[0], values.Length); - Assert.Equal(result4.e00, 5u); - Assert.Equal(result4.e01, 10u); + Assert.Equal(5u, result4.e00); + Assert.Equal(10u, result4.e01); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3B.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3B.cs index 83fd891efc1b47..6278ed536d0e8a 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3B.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3B.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern Point3 AddPoint3Bs(in Point3 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint3B() + [Fact] + public static void TestPoint3B() { Assert.Throws(() => GenericsNative.GetPoint3B(true, false, true)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3C.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3C.cs index 662b7d282c1d88..8955f26228bd3a 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3C.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3C.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern Point3 AddPoint3Cs(in Point3 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint3C() + [Fact] + public static void TestPoint3C() { Assert.Throws(() => GenericsNative.GetPoint3C('1', '2', '3')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3D.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3D.cs index 0215ce508c2c29..37af15b7b4ca5a 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3D.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3D.cs @@ -35,40 +35,41 @@ unsafe partial class GenericsNative public static extern Point3 AddPoint3Ds(in Point3 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint3D() + [Fact] + public static void TestPoint3D() { GenericsNative.Point3 value = GenericsNative.GetPoint3D(1.0, 2.0, 3.0); - Assert.Equal(value.e00, 1.0); - Assert.Equal(value.e01, 2.0); - Assert.Equal(value.e02, 3.0); + Assert.Equal(1.0, value.e00); + Assert.Equal(2.0, value.e01); + Assert.Equal(3.0, value.e02); GenericsNative.Point3 value2; GenericsNative.GetPoint3DOut(1.0, 2.0, 3.0, &value2); - Assert.Equal(value2.e00, 1.0); - Assert.Equal(value2.e01, 2.0); - Assert.Equal(value2.e02, 3.0); + Assert.Equal(1.0, value2.e00); + Assert.Equal(2.0, value2.e01); + Assert.Equal(3.0, value2.e02); GenericsNative.GetPoint3DOut(1.0, 2.0, 3.0, out GenericsNative.Point3 value3); - Assert.Equal(value3.e00, 1.0); - Assert.Equal(value3.e01, 2.0); - Assert.Equal(value3.e02, 3.0); + Assert.Equal(1.0, value3.e00); + Assert.Equal(2.0, value3.e01); + Assert.Equal(3.0, value3.e02); GenericsNative.Point3* value4 = GenericsNative.GetPoint3DPtr(1.0, 2.0, 3.0); - Assert.Equal(value4->e00, 1.0); - Assert.Equal(value4->e01, 2.0); - Assert.Equal(value4->e02, 3.0); + Assert.Equal(1.0, value4->e00); + Assert.Equal(2.0, value4->e01); + Assert.Equal(3.0, value4->e02); ref readonly GenericsNative.Point3 value5 = ref GenericsNative.GetPoint3DRef(1.0, 2.0, 3.0); - Assert.Equal(value5.e00, 1.0); - Assert.Equal(value5.e01, 2.0); - Assert.Equal(value5.e02, 3.0); + Assert.Equal(1.0, value5.e00); + Assert.Equal(2.0, value5.e01); + Assert.Equal(3.0, value5.e02); GenericsNative.Point3 result = GenericsNative.AddPoint3D(value, value); - Assert.Equal(result.e00, 2.0); - Assert.Equal(result.e01, 4.0); - Assert.Equal(result.e02, 6.0); + Assert.Equal(2.0, result.e00); + Assert.Equal(4.0, result.e01); + Assert.Equal(6.0, result.e02); GenericsNative.Point3[] values = new GenericsNative.Point3[] { value, @@ -81,19 +82,19 @@ private static void TestPoint3D() fixed (GenericsNative.Point3* pValues = &values[0]) { GenericsNative.Point3 result2 = GenericsNative.AddPoint3Ds(pValues, values.Length); - Assert.Equal(result2.e00, 5.0); - Assert.Equal(result2.e01, 10.0); - Assert.Equal(result2.e02, 15.0); + Assert.Equal(5.0, result2.e00); + Assert.Equal(10.0, result2.e01); + Assert.Equal(15.0, result2.e02); } GenericsNative.Point3 result3 = GenericsNative.AddPoint3Ds(values, values.Length); - Assert.Equal(result3.e00, 5.0); - Assert.Equal(result3.e01, 10.0); - Assert.Equal(result3.e02, 15.0); + Assert.Equal(5.0, result3.e00); + Assert.Equal(10.0, result3.e01); + Assert.Equal(15.0, result3.e02); GenericsNative.Point3 result4 = GenericsNative.AddPoint3Ds(in values[0], values.Length); - Assert.Equal(result4.e00, 5.0); - Assert.Equal(result4.e01, 10.0); - Assert.Equal(result4.e02, 15.0); + Assert.Equal(5.0, result4.e00); + Assert.Equal(10.0, result4.e01); + Assert.Equal(15.0, result4.e02); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3F.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3F.cs index bb95658a3ecec1..4058e51837d98e 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3F.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3F.cs @@ -35,40 +35,41 @@ unsafe partial class GenericsNative public static extern Point3 AddPoint3Fs(in Point3 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint3F() + [Fact] + public static void TestPoint3F() { GenericsNative.Point3 value = GenericsNative.GetPoint3F(1.0f, 2.0f, 3.0f); - Assert.Equal(value.e00, 1.0f); - Assert.Equal(value.e01, 2.0f); - Assert.Equal(value.e02, 3.0f); + Assert.Equal(1.0f, value.e00); + Assert.Equal(2.0f, value.e01); + Assert.Equal(3.0f, value.e02); GenericsNative.Point3 value2; GenericsNative.GetPoint3FOut(1.0f, 2.0f, 3.0f, &value2); - Assert.Equal(value2.e00, 1.0f); - Assert.Equal(value2.e01, 2.0f); - Assert.Equal(value2.e02, 3.0f); + Assert.Equal(1.0f, value2.e00); + Assert.Equal(2.0f, value2.e01); + Assert.Equal(3.0f, value2.e02); GenericsNative.GetPoint3FOut(1.0f, 2.0f, 3.0f, out GenericsNative.Point3 value3); - Assert.Equal(value3.e00, 1.0f); - Assert.Equal(value3.e01, 2.0f); - Assert.Equal(value3.e02, 3.0f); + Assert.Equal(1.0f, value3.e00); + Assert.Equal(2.0f, value3.e01); + Assert.Equal(3.0f, value3.e02); GenericsNative.Point3* value4 = GenericsNative.GetPoint3FPtr(1.0f, 2.0f, 3.0f); - Assert.Equal(value4->e00, 1.0f); - Assert.Equal(value4->e01, 2.0f); - Assert.Equal(value4->e02, 3.0f); + Assert.Equal(1.0f, value4->e00); + Assert.Equal(2.0f, value4->e01); + Assert.Equal(3.0f, value4->e02); ref readonly GenericsNative.Point3 value5 = ref GenericsNative.GetPoint3FRef(1.0f, 2.0f, 3.0f); - Assert.Equal(value5.e00, 1.0f); - Assert.Equal(value5.e01, 2.0f); - Assert.Equal(value5.e02, 3.0f); + Assert.Equal(1.0f, value5.e00); + Assert.Equal(2.0f, value5.e01); + Assert.Equal(3.0f, value5.e02); GenericsNative.Point3 result = GenericsNative.AddPoint3F(value, value); - Assert.Equal(result.e00, 2.0f); - Assert.Equal(result.e01, 4.0f); - Assert.Equal(result.e02, 6.0f); + Assert.Equal(2.0f, result.e00); + Assert.Equal(4.0f, result.e01); + Assert.Equal(6.0f, result.e02); GenericsNative.Point3[] values = new GenericsNative.Point3[] { value, @@ -81,19 +82,19 @@ private static void TestPoint3F() fixed (GenericsNative.Point3* pValues = &values[0]) { GenericsNative.Point3 result2 = GenericsNative.AddPoint3Fs(pValues, values.Length); - Assert.Equal(result2.e00, 5.0f); - Assert.Equal(result2.e01, 10.0f); - Assert.Equal(result2.e02, 15.0f); + Assert.Equal(5.0f, result2.e00); + Assert.Equal(10.0f, result2.e01); + Assert.Equal(15.0f, result2.e02); } GenericsNative.Point3 result3 = GenericsNative.AddPoint3Fs(values, values.Length); - Assert.Equal(result3.e00, 5.0f); - Assert.Equal(result3.e01, 10.0f); - Assert.Equal(result3.e02, 15.0f); + Assert.Equal(5.0f, result3.e00); + Assert.Equal(10.0f, result3.e01); + Assert.Equal(15.0f, result3.e02); GenericsNative.Point3 result4 = GenericsNative.AddPoint3Fs(in values[0], values.Length); - Assert.Equal(result4.e00, 5.0f); - Assert.Equal(result4.e01, 10.0f); - Assert.Equal(result4.e02, 15.0f); + Assert.Equal(5.0f, result4.e00); + Assert.Equal(10.0f, result4.e01); + Assert.Equal(15.0f, result4.e02); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3L.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3L.cs index ede3b6cbf22bb8..b40796509deb49 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3L.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3L.cs @@ -35,40 +35,41 @@ unsafe partial class GenericsNative public static extern Point3 AddPoint3Ls(in Point3 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint3L() + [Fact] + public static void TestPoint3L() { GenericsNative.Point3 value = GenericsNative.GetPoint3L(1L, 2L, 3L); - Assert.Equal(value.e00, 1L); - Assert.Equal(value.e01, 2L); - Assert.Equal(value.e02, 3L); + Assert.Equal(1L, value.e00); + Assert.Equal(2L, value.e01); + Assert.Equal(3L, value.e02); GenericsNative.Point3 value2; GenericsNative.GetPoint3LOut(1L, 2L, 3L, &value2); - Assert.Equal(value2.e00, 1L); - Assert.Equal(value2.e01, 2L); - Assert.Equal(value2.e02, 3L); + Assert.Equal(1L, value2.e00); + Assert.Equal(2L, value2.e01); + Assert.Equal(3L, value2.e02); GenericsNative.GetPoint3LOut(1L, 2L, 3L, out GenericsNative.Point3 value3); - Assert.Equal(value3.e00, 1L); - Assert.Equal(value3.e01, 2L); - Assert.Equal(value3.e02, 3L); + Assert.Equal(1L, value3.e00); + Assert.Equal(2L, value3.e01); + Assert.Equal(3L, value3.e02); GenericsNative.Point3* value4 = GenericsNative.GetPoint3LPtr(1L, 2L, 3L); - Assert.Equal(value4->e00, 1L); - Assert.Equal(value4->e01, 2L); - Assert.Equal(value4->e02, 3L); + Assert.Equal(1L, value4->e00); + Assert.Equal(2L, value4->e01); + Assert.Equal(3L, value4->e02); ref readonly GenericsNative.Point3 value5 = ref GenericsNative.GetPoint3LRef(1L, 2L, 3L); - Assert.Equal(value5.e00, 1L); - Assert.Equal(value5.e01, 2L); - Assert.Equal(value5.e02, 3L); + Assert.Equal(1L, value5.e00); + Assert.Equal(2L, value5.e01); + Assert.Equal(3L, value5.e02); GenericsNative.Point3 result = GenericsNative.AddPoint3L(value, value); - Assert.Equal(result.e00, 2L); - Assert.Equal(result.e01, 4L); - Assert.Equal(result.e02, 6l); + Assert.Equal(2L, result.e00); + Assert.Equal(4L, result.e01); + Assert.Equal(6l, result.e02); GenericsNative.Point3[] values = new GenericsNative.Point3[] { value, @@ -81,19 +82,19 @@ private static void TestPoint3L() fixed (GenericsNative.Point3* pValues = &values[0]) { GenericsNative.Point3 result2 = GenericsNative.AddPoint3Ls(pValues, values.Length); - Assert.Equal(result2.e00, 5l); - Assert.Equal(result2.e01, 10l); - Assert.Equal(result2.e02, 15l); + Assert.Equal(5l, result2.e00); + Assert.Equal(10l, result2.e01); + Assert.Equal(15l, result2.e02); } GenericsNative.Point3 result3 = GenericsNative.AddPoint3Ls(values, values.Length); - Assert.Equal(result3.e00, 5l); - Assert.Equal(result3.e01, 10l); - Assert.Equal(result3.e02, 15l); + Assert.Equal(5l, result3.e00); + Assert.Equal(10l, result3.e01); + Assert.Equal(15l, result3.e02); GenericsNative.Point3 result4 = GenericsNative.AddPoint3Ls(in values[0], values.Length); - Assert.Equal(result4.e00, 5l); - Assert.Equal(result4.e01, 10l); - Assert.Equal(result4.e02, 15l); + Assert.Equal(5l, result4.e00); + Assert.Equal(10l, result4.e01); + Assert.Equal(15l, result4.e02); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3U.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3U.cs index f7ec5528c4c83c..6c5296459c3c7f 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3U.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3U.cs @@ -35,40 +35,41 @@ unsafe partial class GenericsNative public static extern Point3 AddPoint3Us(in Point3 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint3U() + [Fact] + public static void TestPoint3U() { GenericsNative.Point3 value = GenericsNative.GetPoint3U(1u, 2u, 3u); - Assert.Equal(value.e00, 1u); - Assert.Equal(value.e01, 2u); - Assert.Equal(value.e02, 3u); + Assert.Equal(1u, value.e00); + Assert.Equal(2u, value.e01); + Assert.Equal(3u, value.e02); GenericsNative.Point3 value2; GenericsNative.GetPoint3UOut(1u, 2u, 3u, &value2); - Assert.Equal(value2.e00, 1u); - Assert.Equal(value2.e01, 2u); - Assert.Equal(value2.e02, 3u); + Assert.Equal(1u, value2.e00); + Assert.Equal(2u, value2.e01); + Assert.Equal(3u, value2.e02); GenericsNative.GetPoint3UOut(1u, 2u, 3u, out GenericsNative.Point3 value3); - Assert.Equal(value3.e00, 1u); - Assert.Equal(value3.e01, 2u); - Assert.Equal(value3.e02, 3u); + Assert.Equal(1u, value3.e00); + Assert.Equal(2u, value3.e01); + Assert.Equal(3u, value3.e02); GenericsNative.Point3* value4 = GenericsNative.GetPoint3UPtr(1u, 2u, 3u); - Assert.Equal(value4->e00, 1u); - Assert.Equal(value4->e01, 2u); - Assert.Equal(value4->e02, 3u); + Assert.Equal(1u, value4->e00); + Assert.Equal(2u, value4->e01); + Assert.Equal(3u, value4->e02); ref readonly GenericsNative.Point3 value5 = ref GenericsNative.GetPoint3URef(1u, 2u, 3u); - Assert.Equal(value5.e00, 1u); - Assert.Equal(value5.e01, 2u); - Assert.Equal(value5.e02, 3u); + Assert.Equal(1u, value5.e00); + Assert.Equal(2u, value5.e01); + Assert.Equal(3u, value5.e02); GenericsNative.Point3 result = GenericsNative.AddPoint3U(value, value); - Assert.Equal(result.e00, 2u); - Assert.Equal(result.e01, 4u); - Assert.Equal(result.e02, 6u); + Assert.Equal(2u, result.e00); + Assert.Equal(4u, result.e01); + Assert.Equal(6u, result.e02); GenericsNative.Point3[] values = new GenericsNative.Point3[] { value, @@ -81,19 +82,19 @@ private static void TestPoint3U() fixed (GenericsNative.Point3* pValues = &values[0]) { GenericsNative.Point3 result2 = GenericsNative.AddPoint3Us(pValues, values.Length); - Assert.Equal(result2.e00, 5u); - Assert.Equal(result2.e01, 10u); - Assert.Equal(result2.e02, 15u); + Assert.Equal(5u, result2.e00); + Assert.Equal(10u, result2.e01); + Assert.Equal(15u, result2.e02); } GenericsNative.Point3 result3 = GenericsNative.AddPoint3Us(values, values.Length); - Assert.Equal(result3.e00, 5u); - Assert.Equal(result3.e01, 10u); - Assert.Equal(result3.e02, 15u); + Assert.Equal(5u, result3.e00); + Assert.Equal(10u, result3.e01); + Assert.Equal(15u, result3.e02); GenericsNative.Point3 result4 = GenericsNative.AddPoint3Us(in values[0], values.Length); - Assert.Equal(result4.e00, 5u); - Assert.Equal(result4.e01, 10u); - Assert.Equal(result4.e02, 15u); + Assert.Equal(5u, result4.e00); + Assert.Equal(10u, result4.e01); + Assert.Equal(15u, result4.e02); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4B.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4B.cs index 751a02c104a573..9334b0ed61efd4 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4B.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4B.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern Point4 AddPoint4Bs(in Point4 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint4B() + [Fact] + public static void TestPoint4B() { Assert.Throws(() => GenericsNative.GetPoint4B(true, false, true, false)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4C.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4C.cs index ec39a719e3e0c8..be4766cce98e3f 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4C.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4C.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern Point4 AddPoint4Cs(in Point4 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint4C() + [Fact] + public static void TestPoint4C() { Assert.Throws(() => GenericsNative.GetPoint4C('1', '2', '3', '4')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4D.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4D.cs index 1cee797b41b0d7..d788a65b40b6a9 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4D.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4D.cs @@ -35,46 +35,47 @@ unsafe partial class GenericsNative public static extern Point4 AddPoint4Ds(in Point4 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint4D() + [Fact] + public static void TestPoint4D() { GenericsNative.Point4 value = GenericsNative.GetPoint4D(1.0, 2.0, 3.0, 4.0); - Assert.Equal(value.e00, 1.0); - Assert.Equal(value.e01, 2.0); - Assert.Equal(value.e02, 3.0); - Assert.Equal(value.e03, 4.0); + Assert.Equal(1.0, value.e00); + Assert.Equal(2.0, value.e01); + Assert.Equal(3.0, value.e02); + Assert.Equal(4.0, value.e03); GenericsNative.Point4 value2; GenericsNative.GetPoint4DOut(1.0, 2.0, 3.0, 4.0, &value2); - Assert.Equal(value2.e00, 1.0); - Assert.Equal(value2.e01, 2.0); - Assert.Equal(value2.e02, 3.0); - Assert.Equal(value2.e03, 4.0); + Assert.Equal(1.0, value2.e00); + Assert.Equal(2.0, value2.e01); + Assert.Equal(3.0, value2.e02); + Assert.Equal(4.0, value2.e03); GenericsNative.GetPoint4DOut(1.0, 2.0, 3.0, 4.0, out GenericsNative.Point4 value3); - Assert.Equal(value3.e00, 1.0); - Assert.Equal(value3.e01, 2.0); - Assert.Equal(value3.e02, 3.0); - Assert.Equal(value3.e03, 4.0); + Assert.Equal(1.0, value3.e00); + Assert.Equal(2.0, value3.e01); + Assert.Equal(3.0, value3.e02); + Assert.Equal(4.0, value3.e03); GenericsNative.Point4* value4 = GenericsNative.GetPoint4DPtr(1.0, 2.0, 3.0, 4.0); - Assert.Equal(value4->e00, 1.0); - Assert.Equal(value4->e01, 2.0); - Assert.Equal(value4->e02, 3.0); - Assert.Equal(value4->e03, 4.0); + Assert.Equal(1.0, value4->e00); + Assert.Equal(2.0, value4->e01); + Assert.Equal(3.0, value4->e02); + Assert.Equal(4.0, value4->e03); ref readonly GenericsNative.Point4 value5 = ref GenericsNative.GetPoint4DRef(1.0, 2.0, 3.0, 4.0); - Assert.Equal(value5.e00, 1.0); - Assert.Equal(value5.e01, 2.0); - Assert.Equal(value5.e02, 3.0); - Assert.Equal(value5.e03, 4.0); + Assert.Equal(1.0, value5.e00); + Assert.Equal(2.0, value5.e01); + Assert.Equal(3.0, value5.e02); + Assert.Equal(4.0, value5.e03); GenericsNative.Point4 result = GenericsNative.AddPoint4D(value, value); - Assert.Equal(result.e00, 2.0); - Assert.Equal(result.e01, 4.0); - Assert.Equal(result.e02, 6.0); - Assert.Equal(result.e03, 8.0); + Assert.Equal(2.0, result.e00); + Assert.Equal(4.0, result.e01); + Assert.Equal(6.0, result.e02); + Assert.Equal(8.0, result.e03); GenericsNative.Point4[] values = new GenericsNative.Point4[] { value, @@ -87,22 +88,22 @@ private static void TestPoint4D() fixed (GenericsNative.Point4* pValues = &values[0]) { GenericsNative.Point4 result2 = GenericsNative.AddPoint4Ds(pValues, values.Length); - Assert.Equal(result2.e00, 5.0); - Assert.Equal(result2.e01, 10.0); - Assert.Equal(result2.e02, 15.0); - Assert.Equal(result2.e03, 20.0); + Assert.Equal(5.0, result2.e00); + Assert.Equal(10.0, result2.e01); + Assert.Equal(15.0, result2.e02); + Assert.Equal(20.0, result2.e03); } GenericsNative.Point4 result3 = GenericsNative.AddPoint4Ds(values, values.Length); - Assert.Equal(result3.e00, 5.0); - Assert.Equal(result3.e01, 10.0); - Assert.Equal(result3.e02, 15.0); - Assert.Equal(result3.e03, 20.0); + Assert.Equal(5.0, result3.e00); + Assert.Equal(10.0, result3.e01); + Assert.Equal(15.0, result3.e02); + Assert.Equal(20.0, result3.e03); GenericsNative.Point4 result4 = GenericsNative.AddPoint4Ds(in values[0], values.Length); - Assert.Equal(result4.e00, 5.0); - Assert.Equal(result4.e01, 10.0); - Assert.Equal(result4.e02, 15.0); - Assert.Equal(result4.e03, 20.0); + Assert.Equal(5.0, result4.e00); + Assert.Equal(10.0, result4.e01); + Assert.Equal(15.0, result4.e02); + Assert.Equal(20.0, result4.e03); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4F.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4F.cs index 9c12cbf9604dc2..e4ffec549cd915 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4F.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4F.cs @@ -35,46 +35,47 @@ unsafe partial class GenericsNative public static extern Point4 AddPoint4Fs(in Point4 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint4F() + [Fact] + public static void TestPoint4F() { GenericsNative.Point4 value = GenericsNative.GetPoint4F(1.0f, 2.0f, 3.0f, 4.0f); - Assert.Equal(value.e00, 1.0f); - Assert.Equal(value.e01, 2.0f); - Assert.Equal(value.e02, 3.0f); - Assert.Equal(value.e03, 4.0f); + Assert.Equal(1.0f, value.e00); + Assert.Equal(2.0f, value.e01); + Assert.Equal(3.0f, value.e02); + Assert.Equal(4.0f, value.e03); GenericsNative.Point4 value2; GenericsNative.GetPoint4FOut(1.0f, 2.0f, 3.0f, 4.0f, &value2); - Assert.Equal(value2.e00, 1.0f); - Assert.Equal(value2.e01, 2.0f); - Assert.Equal(value2.e02, 3.0f); - Assert.Equal(value2.e03, 4.0f); + Assert.Equal(1.0f, value2.e00); + Assert.Equal(2.0f, value2.e01); + Assert.Equal(3.0f, value2.e02); + Assert.Equal(4.0f, value2.e03); GenericsNative.GetPoint4FOut(1.0f, 2.0f, 3.0f, 4.0f, out GenericsNative.Point4 value3); - Assert.Equal(value3.e00, 1.0f); - Assert.Equal(value3.e01, 2.0f); - Assert.Equal(value3.e02, 3.0f); - Assert.Equal(value3.e03, 4.0f); + Assert.Equal(1.0f, value3.e00); + Assert.Equal(2.0f, value3.e01); + Assert.Equal(3.0f, value3.e02); + Assert.Equal(4.0f, value3.e03); GenericsNative.Point4* value4 = GenericsNative.GetPoint4FPtr(1.0f, 2.0f, 3.0f, 4.0f); - Assert.Equal(value4->e00, 1.0f); - Assert.Equal(value4->e01, 2.0f); - Assert.Equal(value4->e02, 3.0f); - Assert.Equal(value4->e03, 4.0f); + Assert.Equal(1.0f, value4->e00); + Assert.Equal(2.0f, value4->e01); + Assert.Equal(3.0f, value4->e02); + Assert.Equal(4.0f, value4->e03); ref readonly GenericsNative.Point4 value5 = ref GenericsNative.GetPoint4FRef(1.0f, 2.0f, 3.0f, 4.0f); - Assert.Equal(value5.e00, 1.0f); - Assert.Equal(value5.e01, 2.0f); - Assert.Equal(value5.e02, 3.0f); - Assert.Equal(value5.e03, 4.0f); + Assert.Equal(1.0f, value5.e00); + Assert.Equal(2.0f, value5.e01); + Assert.Equal(3.0f, value5.e02); + Assert.Equal(4.0f, value5.e03); GenericsNative.Point4 result = GenericsNative.AddPoint4F(value, value); - Assert.Equal(result.e00, 2.0f); - Assert.Equal(result.e01, 4.0f); - Assert.Equal(result.e02, 6.0f); - Assert.Equal(result.e03, 8.0f); + Assert.Equal(2.0f, result.e00); + Assert.Equal(4.0f, result.e01); + Assert.Equal(6.0f, result.e02); + Assert.Equal(8.0f, result.e03); GenericsNative.Point4[] values = new GenericsNative.Point4[] { value, @@ -87,22 +88,22 @@ private static void TestPoint4F() fixed (GenericsNative.Point4* pValues = &values[0]) { GenericsNative.Point4 result2 = GenericsNative.AddPoint4Fs(pValues, values.Length); - Assert.Equal(result2.e00, 5.0f); - Assert.Equal(result2.e01, 10.0f); - Assert.Equal(result2.e02, 15.0f); - Assert.Equal(result2.e03, 20.0f); + Assert.Equal(5.0f, result2.e00); + Assert.Equal(10.0f, result2.e01); + Assert.Equal(15.0f, result2.e02); + Assert.Equal(20.0f, result2.e03); } GenericsNative.Point4 result3 = GenericsNative.AddPoint4Fs(values, values.Length); - Assert.Equal(result3.e00, 5.0f); - Assert.Equal(result3.e01, 10.0f); - Assert.Equal(result3.e02, 15.0f); - Assert.Equal(result3.e03, 20.0f); + Assert.Equal(5.0f, result3.e00); + Assert.Equal(10.0f, result3.e01); + Assert.Equal(15.0f, result3.e02); + Assert.Equal(20.0f, result3.e03); GenericsNative.Point4 result4 = GenericsNative.AddPoint4Fs(in values[0], values.Length); - Assert.Equal(result4.e00, 5.0f); - Assert.Equal(result4.e01, 10.0f); - Assert.Equal(result4.e02, 15.0f); - Assert.Equal(result4.e03, 20.0f); + Assert.Equal(5.0f, result4.e00); + Assert.Equal(10.0f, result4.e01); + Assert.Equal(15.0f, result4.e02); + Assert.Equal(20.0f, result4.e03); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4L.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4L.cs index d7c29248a9efe0..d5177ad7a3827b 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4L.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4L.cs @@ -35,46 +35,47 @@ unsafe partial class GenericsNative public static extern Point4 AddPoint4Ls(in Point4 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint4L() + [Fact] + public static void TestPoint4L() { GenericsNative.Point4 value = GenericsNative.GetPoint4L(1L, 2L, 3L, 4L); - Assert.Equal(value.e00, 1L); - Assert.Equal(value.e01, 2L); - Assert.Equal(value.e02, 3L); - Assert.Equal(value.e03, 4L); + Assert.Equal(1L, value.e00); + Assert.Equal(2L, value.e01); + Assert.Equal(3L, value.e02); + Assert.Equal(4L, value.e03); GenericsNative.Point4 value2; GenericsNative.GetPoint4LOut(1L, 2L, 3L, 4L, &value2); - Assert.Equal(value2.e00, 1L); - Assert.Equal(value2.e01, 2L); - Assert.Equal(value2.e02, 3L); - Assert.Equal(value2.e03, 4L); + Assert.Equal(1L, value2.e00); + Assert.Equal(2L, value2.e01); + Assert.Equal(3L, value2.e02); + Assert.Equal(4L, value2.e03); GenericsNative.GetPoint4LOut(1L, 2L, 3L, 4L, out GenericsNative.Point4 value3); - Assert.Equal(value3.e00, 1L); - Assert.Equal(value3.e01, 2L); - Assert.Equal(value3.e02, 3L); - Assert.Equal(value3.e03, 4L); + Assert.Equal(1L, value3.e00); + Assert.Equal(2L, value3.e01); + Assert.Equal(3L, value3.e02); + Assert.Equal(4L, value3.e03); GenericsNative.Point4* value4 = GenericsNative.GetPoint4LPtr(1L, 2L, 3L, 4L); - Assert.Equal(value4->e00, 1L); - Assert.Equal(value4->e01, 2L); - Assert.Equal(value4->e02, 3L); - Assert.Equal(value4->e03, 4L); + Assert.Equal(1L, value4->e00); + Assert.Equal(2L, value4->e01); + Assert.Equal(3L, value4->e02); + Assert.Equal(4L, value4->e03); ref readonly GenericsNative.Point4 value5 = ref GenericsNative.GetPoint4LRef(1L, 2L, 3L, 4L); - Assert.Equal(value5.e00, 1L); - Assert.Equal(value5.e01, 2L); - Assert.Equal(value5.e02, 3L); - Assert.Equal(value5.e03, 4L); + Assert.Equal(1L, value5.e00); + Assert.Equal(2L, value5.e01); + Assert.Equal(3L, value5.e02); + Assert.Equal(4L, value5.e03); GenericsNative.Point4 result = GenericsNative.AddPoint4L(value, value); - Assert.Equal(result.e00, 2L); - Assert.Equal(result.e01, 4L); - Assert.Equal(result.e02, 6l); - Assert.Equal(result.e03, 8l); + Assert.Equal(2L, result.e00); + Assert.Equal(4L, result.e01); + Assert.Equal(6l, result.e02); + Assert.Equal(8l, result.e03); GenericsNative.Point4[] values = new GenericsNative.Point4[] { value, @@ -87,22 +88,22 @@ private static void TestPoint4L() fixed (GenericsNative.Point4* pValues = &values[0]) { GenericsNative.Point4 result2 = GenericsNative.AddPoint4Ls(pValues, values.Length); - Assert.Equal(result2.e00, 5l); - Assert.Equal(result2.e01, 10l); - Assert.Equal(result2.e02, 15l); - Assert.Equal(result2.e03, 20l); + Assert.Equal(5l, result2.e00); + Assert.Equal(10l, result2.e01); + Assert.Equal(15l, result2.e02); + Assert.Equal(20l, result2.e03); } GenericsNative.Point4 result3 = GenericsNative.AddPoint4Ls(values, values.Length); - Assert.Equal(result3.e00, 5l); - Assert.Equal(result3.e01, 10l); - Assert.Equal(result3.e02, 15l); - Assert.Equal(result3.e03, 20l); + Assert.Equal(5l, result3.e00); + Assert.Equal(10l, result3.e01); + Assert.Equal(15l, result3.e02); + Assert.Equal(20l, result3.e03); GenericsNative.Point4 result4 = GenericsNative.AddPoint4Ls(in values[0], values.Length); - Assert.Equal(result4.e00, 5l); - Assert.Equal(result4.e01, 10l); - Assert.Equal(result4.e02, 15l); - Assert.Equal(result4.e03, 20l); + Assert.Equal(5l, result4.e00); + Assert.Equal(10l, result4.e01); + Assert.Equal(15l, result4.e02); + Assert.Equal(20l, result4.e03); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4U.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4U.cs index 6f2b08ebd20181..adf34c36ca0b87 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4U.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4U.cs @@ -35,46 +35,47 @@ unsafe partial class GenericsNative public static extern Point4 AddPoint4Us(in Point4 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestPoint4U() + [Fact] + public static void TestPoint4U() { GenericsNative.Point4 value = GenericsNative.GetPoint4U(1u, 2u, 3u, 4u); - Assert.Equal(value.e00, 1u); - Assert.Equal(value.e01, 2u); - Assert.Equal(value.e02, 3u); - Assert.Equal(value.e03, 4u); + Assert.Equal(1u, value.e00); + Assert.Equal(2u, value.e01); + Assert.Equal(3u, value.e02); + Assert.Equal(4u, value.e03); GenericsNative.Point4 value2; GenericsNative.GetPoint4UOut(1u, 2u, 3u, 4u, &value2); - Assert.Equal(value2.e00, 1u); - Assert.Equal(value2.e01, 2u); - Assert.Equal(value2.e02, 3u); - Assert.Equal(value2.e03, 4u); + Assert.Equal(1u, value2.e00); + Assert.Equal(2u, value2.e01); + Assert.Equal(3u, value2.e02); + Assert.Equal(4u, value2.e03); GenericsNative.GetPoint4UOut(1u, 2u, 3u, 4u, out GenericsNative.Point4 value3); - Assert.Equal(value3.e00, 1u); - Assert.Equal(value3.e01, 2u); - Assert.Equal(value3.e02, 3u); - Assert.Equal(value3.e03, 4u); + Assert.Equal(1u, value3.e00); + Assert.Equal(2u, value3.e01); + Assert.Equal(3u, value3.e02); + Assert.Equal(4u, value3.e03); GenericsNative.Point4* value4 = GenericsNative.GetPoint4UPtr(1u, 2u, 3u, 4u); - Assert.Equal(value4->e00, 1u); - Assert.Equal(value4->e01, 2u); - Assert.Equal(value4->e02, 3u); - Assert.Equal(value4->e03, 4u); + Assert.Equal(1u, value4->e00); + Assert.Equal(2u, value4->e01); + Assert.Equal(3u, value4->e02); + Assert.Equal(4u, value4->e03); ref readonly GenericsNative.Point4 value5 = ref GenericsNative.GetPoint4URef(1u, 2u, 3u, 4u); - Assert.Equal(value5.e00, 1u); - Assert.Equal(value5.e01, 2u); - Assert.Equal(value5.e02, 3u); - Assert.Equal(value5.e03, 4u); + Assert.Equal(1u, value5.e00); + Assert.Equal(2u, value5.e01); + Assert.Equal(3u, value5.e02); + Assert.Equal(4u, value5.e03); GenericsNative.Point4 result = GenericsNative.AddPoint4U(value, value); - Assert.Equal(result.e00, 2u); - Assert.Equal(result.e01, 4u); - Assert.Equal(result.e02, 6u); - Assert.Equal(result.e03, 8u); + Assert.Equal(2u, result.e00); + Assert.Equal(4u, result.e01); + Assert.Equal(6u, result.e02); + Assert.Equal(8u, result.e03); GenericsNative.Point4[] values = new GenericsNative.Point4[] { value, @@ -87,22 +88,22 @@ private static void TestPoint4U() fixed (GenericsNative.Point4* pValues = &values[0]) { GenericsNative.Point4 result2 = GenericsNative.AddPoint4Us(pValues, values.Length); - Assert.Equal(result2.e00, 5u); - Assert.Equal(result2.e01, 10u); - Assert.Equal(result2.e02, 15u); - Assert.Equal(result2.e03, 20u); + Assert.Equal(5u, result2.e00); + Assert.Equal(10u, result2.e01); + Assert.Equal(15u, result2.e02); + Assert.Equal(20u, result2.e03); } GenericsNative.Point4 result3 = GenericsNative.AddPoint4Us(values, values.Length); - Assert.Equal(result3.e00, 5u); - Assert.Equal(result3.e01, 10u); - Assert.Equal(result3.e02, 15u); - Assert.Equal(result3.e03, 20u); + Assert.Equal(5u, result3.e00); + Assert.Equal(10u, result3.e01); + Assert.Equal(15u, result3.e02); + Assert.Equal(20u, result3.e03); GenericsNative.Point4 result4 = GenericsNative.AddPoint4Us(in values[0], values.Length); - Assert.Equal(result4.e00, 5u); - Assert.Equal(result4.e01, 10u); - Assert.Equal(result4.e02, 15u); - Assert.Equal(result4.e03, 20u); + Assert.Equal(5u, result4.e00); + Assert.Equal(10u, result4.e01); + Assert.Equal(15u, result4.e02); + Assert.Equal(20u, result4.e03); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanB.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanB.cs index 884e7586542c04..664ececf76e9e8 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanB.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanB.cs @@ -23,9 +23,10 @@ unsafe partial class GenericsNative public static extern ReadOnlySpan AddReadOnlySpanBs(in ReadOnlySpan pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestReadOnlySpanB() + [Fact] + public static void TestReadOnlySpanB() { Assert.Throws(() => GenericsNative.GetReadOnlySpanB(true)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanC.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanC.cs index c7cc9209b5cbc2..6a0280b1fe7d0f 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanC.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanC.cs @@ -23,9 +23,10 @@ unsafe partial class GenericsNative public static extern ReadOnlySpan AddReadOnlySpanCs(in ReadOnlySpan pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestReadOnlySpanC() + [Fact] + public static void TestReadOnlySpanC() { Assert.Throws(() => GenericsNative.GetReadOnlySpanC('1')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanD.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanD.cs index 9998f2c62f5de1..77810547c6b350 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanD.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanD.cs @@ -23,9 +23,10 @@ unsafe partial class GenericsNative public static extern ReadOnlySpan AddReadOnlySpanDs(in ReadOnlySpan pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestReadOnlySpanD() + [Fact] + public static void TestReadOnlySpanD() { Assert.Throws(() => GenericsNative.GetReadOnlySpanD(1.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanF.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanF.cs index 1804dc60b1b964..ac23e97f4014d9 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanF.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanF.cs @@ -23,9 +23,10 @@ unsafe partial class GenericsNative public static extern ReadOnlySpan AddReadOnlySpanFs(in ReadOnlySpan pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestReadOnlySpanF() + [Fact] + public static void TestReadOnlySpanF() { Assert.Throws(() => GenericsNative.GetReadOnlySpanF(1.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanL.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanL.cs index 083ae48d40b8ea..61fe5e58dd0fd3 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanL.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanL.cs @@ -23,9 +23,10 @@ unsafe partial class GenericsNative public static extern ReadOnlySpan AddReadOnlySpanLs(in ReadOnlySpan pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestReadOnlySpanL() + [Fact] + public static void TestReadOnlySpanL() { Assert.Throws(() => GenericsNative.GetReadOnlySpanL(1L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanU.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanU.cs index 1fab3396d25f8e..281bf5e14f8361 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanU.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanU.cs @@ -23,9 +23,10 @@ unsafe partial class GenericsNative public static extern ReadOnlySpan AddReadOnlySpanUs(in ReadOnlySpan pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestReadOnlySpanU() + [Fact] + public static void TestReadOnlySpanU() { Assert.Throws(() => GenericsNative.GetReadOnlySpanU(1u)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassB.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassB.cs index acd49ddde4a18a..69bb14c1725c86 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassB.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassB.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern SequentialClass AddSequentialClassBs(in SequentialClass pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestSequentialClassB() + [Fact] + public static void TestSequentialClassB() { Assert.Throws(() => GenericsNative.GetSequentialClassB(true)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassC.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassC.cs index 702f2c2887b7e8..45781a6b2bc817 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassC.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassC.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern SequentialClass AddSequentialClassCs(in SequentialClass pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestSequentialClassC() + [Fact] + public static void TestSequentialClassC() { Assert.Throws(() => GenericsNative.GetSequentialClassC('1')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassD.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassD.cs index 3210f147a1a55a..fe00ec827e2fe9 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassD.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassD.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern SequentialClass AddSequentialClassDs(in SequentialClass pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestSequentialClassD() + [Fact] + public static void TestSequentialClassD() { Assert.Throws(() => GenericsNative.GetSequentialClassD(1.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassF.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassF.cs index c89724ba7ecc84..f8c83a20cf0bde 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassF.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassF.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern SequentialClass AddSequentialClassFs(in SequentialClass pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestSequentialClassF() + [Fact] + public static void TestSequentialClassF() { Assert.Throws(() => GenericsNative.GetSequentialClassF(1.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassL.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassL.cs index 5019035515f256..e7d674677ce294 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassL.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassL.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern SequentialClass AddSequentialClassLs(in SequentialClass pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestSequentialClassL() + [Fact] + public static void TestSequentialClassL() { Assert.Throws(() => GenericsNative.GetSequentialClassL(1L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassU.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassU.cs index cf33f580754dcc..80239e7c1fcaf8 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassU.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassU.cs @@ -26,9 +26,10 @@ unsafe partial class GenericsNative public static extern SequentialClass AddSequentialClassUs(in SequentialClass pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestSequentialClassU() + [Fact] + public static void TestSequentialClassU() { Assert.Throws(() => GenericsNative.GetSequentialClassU(1u)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanB.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanB.cs index 8964b3a7c5bd51..3d11f189603812 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanB.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanB.cs @@ -23,9 +23,10 @@ unsafe partial class GenericsNative public static extern Span AddSpanBs(in Span pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestSpanB() + [Fact] + public static void TestSpanB() { Assert.Throws(() => GenericsNative.GetSpanB(true)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanC.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanC.cs index 5b2a42faa95ea3..8d6ecefb8f0142 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanC.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanC.cs @@ -23,9 +23,10 @@ unsafe partial class GenericsNative public static extern Span AddSpanCs(in Span pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestSpanC() + [Fact] + public static void TestSpanC() { Assert.Throws(() => GenericsNative.GetSpanC('1')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanD.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanD.cs index ab887cb9440143..b20fa17523630f 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanD.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanD.cs @@ -23,9 +23,10 @@ unsafe partial class GenericsNative public static extern Span AddSpanDs(in Span pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestSpanD() + [Fact] + public static void TestSpanD() { Assert.Throws(() => GenericsNative.GetSpanD(1.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanF.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanF.cs index d93cf90ba833f4..00fa07c4d3a02a 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanF.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanF.cs @@ -23,9 +23,10 @@ unsafe partial class GenericsNative public static extern Span AddSpanFs(in Span pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestSpanF() + [Fact] + public static void TestSpanF() { Assert.Throws(() => GenericsNative.GetSpanF(1.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanL.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanL.cs index 99e19b6264ea18..37b50812711a79 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanL.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanL.cs @@ -23,9 +23,10 @@ unsafe partial class GenericsNative public static extern Span AddSpanLs(in Span pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestSpanL() + [Fact] + public static void TestSpanL() { Assert.Throws(() => GenericsNative.GetSpanL(1L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanU.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanU.cs index 0d7ce784caa025..8af2ec532a697d 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanU.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanU.cs @@ -23,9 +23,10 @@ unsafe partial class GenericsNative public static extern Span AddSpanUs(in Span pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestSpanU() + [Fact] + public static void TestSpanU() { Assert.Throws(() => GenericsNative.GetSpanU(1u)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128B.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128B.cs index 1542545a912ff7..156d50557d7a8e 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128B.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128B.cs @@ -36,52 +36,53 @@ unsafe partial class GenericsNative public static extern Vector128 AddVector128Bs(in Vector128 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVector128B() + [Fact] + public static void TestVector128B() { Assert.Throws(() => GenericsNative.GetVector128B(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false)); Vector128 value2; GenericsNative.GetVector128BOut(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, &value2); Vector128 tValue2 = *(Vector128*)&value2; - Assert.Equal(tValue2.GetElement(0), 1); - Assert.Equal(tValue2.GetElement(1), 0); - Assert.Equal(tValue2.GetElement(2), 1); - Assert.Equal(tValue2.GetElement(3), 0); - Assert.Equal(tValue2.GetElement(4), 1); - Assert.Equal(tValue2.GetElement(5), 0); - Assert.Equal(tValue2.GetElement(6), 1); - Assert.Equal(tValue2.GetElement(7), 0); - Assert.Equal(tValue2.GetElement(8), 1); - Assert.Equal(tValue2.GetElement(9), 0); - Assert.Equal(tValue2.GetElement(10), 1); - Assert.Equal(tValue2.GetElement(11), 0); - Assert.Equal(tValue2.GetElement(12), 1); - Assert.Equal(tValue2.GetElement(13), 0); - Assert.Equal(tValue2.GetElement(14), 1); - Assert.Equal(tValue2.GetElement(15), 0); + Assert.Equal(1, tValue2.GetElement(0)); + Assert.Equal(0, tValue2.GetElement(1)); + Assert.Equal(1, tValue2.GetElement(2)); + Assert.Equal(0, tValue2.GetElement(3)); + Assert.Equal(1, tValue2.GetElement(4)); + Assert.Equal(0, tValue2.GetElement(5)); + Assert.Equal(1, tValue2.GetElement(6)); + Assert.Equal(0, tValue2.GetElement(7)); + Assert.Equal(1, tValue2.GetElement(8)); + Assert.Equal(0, tValue2.GetElement(9)); + Assert.Equal(1, tValue2.GetElement(10)); + Assert.Equal(0, tValue2.GetElement(11)); + Assert.Equal(1, tValue2.GetElement(12)); + Assert.Equal(0, tValue2.GetElement(13)); + Assert.Equal(1, tValue2.GetElement(14)); + Assert.Equal(0, tValue2.GetElement(15)); Assert.Throws(() => GenericsNative.GetVector128BOut(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, out Vector128 value3)); Vector128* value4 = GenericsNative.GetVector128BPtr(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false); Vector128* tValue4 = (Vector128*)value4; - Assert.Equal(tValue4->GetElement(0), 1); - Assert.Equal(tValue4->GetElement(1), 0); - Assert.Equal(tValue4->GetElement(2), 1); - Assert.Equal(tValue4->GetElement(3), 0); - Assert.Equal(tValue4->GetElement(4), 1); - Assert.Equal(tValue4->GetElement(5), 0); - Assert.Equal(tValue4->GetElement(6), 1); - Assert.Equal(tValue4->GetElement(7), 0); - Assert.Equal(tValue4->GetElement(8), 1); - Assert.Equal(tValue4->GetElement(9), 0); - Assert.Equal(tValue4->GetElement(10), 1); - Assert.Equal(tValue4->GetElement(11), 0); - Assert.Equal(tValue4->GetElement(12), 1); - Assert.Equal(tValue4->GetElement(13), 0); - Assert.Equal(tValue4->GetElement(14), 1); - Assert.Equal(tValue4->GetElement(15), 0); + Assert.Equal(1, tValue4->GetElement(0)); + Assert.Equal(0, tValue4->GetElement(1)); + Assert.Equal(1, tValue4->GetElement(2)); + Assert.Equal(0, tValue4->GetElement(3)); + Assert.Equal(1, tValue4->GetElement(4)); + Assert.Equal(0, tValue4->GetElement(5)); + Assert.Equal(1, tValue4->GetElement(6)); + Assert.Equal(0, tValue4->GetElement(7)); + Assert.Equal(1, tValue4->GetElement(8)); + Assert.Equal(0, tValue4->GetElement(9)); + Assert.Equal(1, tValue4->GetElement(10)); + Assert.Equal(0, tValue4->GetElement(11)); + Assert.Equal(1, tValue4->GetElement(12)); + Assert.Equal(0, tValue4->GetElement(13)); + Assert.Equal(1, tValue4->GetElement(14)); + Assert.Equal(0, tValue4->GetElement(15)); Assert.Throws(() => GenericsNative.GetVector128BRef(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128C.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128C.cs index eab8feb30aa327..b93286d5a85268 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128C.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128C.cs @@ -36,36 +36,37 @@ unsafe partial class GenericsNative public static extern Vector128 AddVector128Cs(in Vector128 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVector128C() + [Fact] + public static void TestVector128C() { Assert.Throws(() => GenericsNative.GetVector128C('0', '1', '2', '3', '4', '5', '6', '7')); Vector128 value2; GenericsNative.GetVector128COut('0', '1', '2', '3', '4', '5', '6', '7', &value2); Vector128 tValue2 = *(Vector128*)&value2; - Assert.Equal(tValue2.GetElement(0), (short)'0'); - Assert.Equal(tValue2.GetElement(1), (short)'1'); - Assert.Equal(tValue2.GetElement(2), (short)'2'); - Assert.Equal(tValue2.GetElement(3), (short)'3'); - Assert.Equal(tValue2.GetElement(4), (short)'4'); - Assert.Equal(tValue2.GetElement(5), (short)'5'); - Assert.Equal(tValue2.GetElement(6), (short)'6'); - Assert.Equal(tValue2.GetElement(7), (short)'7'); + Assert.Equal((short)'0', tValue2.GetElement(0)); + Assert.Equal((short)'1', tValue2.GetElement(1)); + Assert.Equal((short)'2', tValue2.GetElement(2)); + Assert.Equal((short)'3', tValue2.GetElement(3)); + Assert.Equal((short)'4', tValue2.GetElement(4)); + Assert.Equal((short)'5', tValue2.GetElement(5)); + Assert.Equal((short)'6', tValue2.GetElement(6)); + Assert.Equal((short)'7', tValue2.GetElement(7)); Assert.Throws(() => GenericsNative.GetVector128COut('0', '1', '2', '3', '4', '5', '6', '7', out Vector128 value3)); Vector128* value4 = GenericsNative.GetVector128CPtr('0', '1', '2', '3', '4', '5', '6', '7'); Vector128* tValue4 = (Vector128*)value4; - Assert.Equal(tValue4->GetElement(0), (short)'0'); - Assert.Equal(tValue4->GetElement(1), (short)'1'); - Assert.Equal(tValue4->GetElement(2), (short)'2'); - Assert.Equal(tValue4->GetElement(3), (short)'3'); - Assert.Equal(tValue4->GetElement(4), (short)'4'); - Assert.Equal(tValue4->GetElement(5), (short)'5'); - Assert.Equal(tValue4->GetElement(6), (short)'6'); - Assert.Equal(tValue4->GetElement(7), (short)'7'); + Assert.Equal((short)'0', tValue4->GetElement(0)); + Assert.Equal((short)'1', tValue4->GetElement(1)); + Assert.Equal((short)'2', tValue4->GetElement(2)); + Assert.Equal((short)'3', tValue4->GetElement(3)); + Assert.Equal((short)'4', tValue4->GetElement(4)); + Assert.Equal((short)'5', tValue4->GetElement(5)); + Assert.Equal((short)'6', tValue4->GetElement(6)); + Assert.Equal((short)'7', tValue4->GetElement(7)); Assert.Throws(() => GenericsNative.GetVector128CRef('0', '1', '2', '3', '4', '5', '6', '7')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128D.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128D.cs index 553f6ec184aad1..04093dcf4907a5 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128D.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128D.cs @@ -36,22 +36,23 @@ unsafe partial class GenericsNative public static extern Vector128 AddVector128Ds(in Vector128 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVector128D() + [Fact] + public static void TestVector128D() { Assert.Throws(() => GenericsNative.GetVector128D(1.0, 2.0)); Vector128 value2; GenericsNative.GetVector128DOut(1.0, 2.0, &value2); - Assert.Equal(value2.GetElement(0), 1.0); - Assert.Equal(value2.GetElement(1), 2.0); + Assert.Equal(1.0, value2.GetElement(0)); + Assert.Equal(2.0, value2.GetElement(1)); Assert.Throws(() => GenericsNative.GetVector128DOut(1.0, 2.0, out Vector128 value3)); Vector128* value4 = GenericsNative.GetVector128DPtr(1.0, 2.0); - Assert.Equal(value4->GetElement(0), 1.0); - Assert.Equal(value4->GetElement(1), 2.0); + Assert.Equal(1.0, value4->GetElement(0)); + Assert.Equal(2.0, value4->GetElement(1)); Assert.Throws(() => GenericsNative.GetVector128DRef(1.0, 2.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128F.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128F.cs index 52585f3caba268..e209ccbfffdf7b 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128F.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128F.cs @@ -36,26 +36,27 @@ unsafe partial class GenericsNative public static extern Vector128 AddVector128Fs(in Vector128 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVector128F() + [Fact] + public static void TestVector128F() { Assert.Throws(() => GenericsNative.GetVector128F(1.0f, 2.0f, 3.0f, 4.0f)); Vector128 value2; GenericsNative.GetVector128FOut(1.0f, 2.0f, 3.0f, 4.0f, &value2); - Assert.Equal(value2.GetElement(0), 1.0f); - Assert.Equal(value2.GetElement(1), 2.0f); - Assert.Equal(value2.GetElement(2), 3.0f); - Assert.Equal(value2.GetElement(3), 4.0f); + Assert.Equal(1.0f, value2.GetElement(0)); + Assert.Equal(2.0f, value2.GetElement(1)); + Assert.Equal(3.0f, value2.GetElement(2)); + Assert.Equal(4.0f, value2.GetElement(3)); Assert.Throws(() => GenericsNative.GetVector128FOut(1.0f, 2.0f, 3.0f, 4.0f, out Vector128 value3)); Vector128* value4 = GenericsNative.GetVector128FPtr(1.0f, 2.0f, 3.0f, 4.0f); - Assert.Equal(value4->GetElement(0), 1.0f); - Assert.Equal(value4->GetElement(1), 2.0f); - Assert.Equal(value4->GetElement(2), 3.0f); - Assert.Equal(value4->GetElement(3), 4.0f); + Assert.Equal(1.0f, value4->GetElement(0)); + Assert.Equal(2.0f, value4->GetElement(1)); + Assert.Equal(3.0f, value4->GetElement(2)); + Assert.Equal(4.0f, value4->GetElement(3)); Assert.Throws(() => GenericsNative.GetVector128FRef(1.0f, 2.0f, 3.0f, 4.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128L.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128L.cs index 4cda095a857a5a..0fc48ca8dfd26c 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128L.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128L.cs @@ -36,22 +36,23 @@ unsafe partial class GenericsNative public static extern Vector128 AddVector128Ls(in Vector128 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVector128L() + [Fact] + public static void TestVector128L() { Assert.Throws(() => GenericsNative.GetVector128L(1L, 2L)); Vector128 value2; GenericsNative.GetVector128LOut(1L, 2L, &value2); - Assert.Equal(value2.GetElement(0), 1L); - Assert.Equal(value2.GetElement(1), 2L); + Assert.Equal(1L, value2.GetElement(0)); + Assert.Equal(2L, value2.GetElement(1)); Assert.Throws(() => GenericsNative.GetVector128LOut(1L, 2L, out Vector128 value3)); Vector128* value4 = GenericsNative.GetVector128LPtr(1L, 2L); - Assert.Equal(value4->GetElement(0), 1L); - Assert.Equal(value4->GetElement(1), 2L); + Assert.Equal(1L, value4->GetElement(0)); + Assert.Equal(2L, value4->GetElement(1)); Assert.Throws(() => GenericsNative.GetVector128LRef(1L, 2L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128U.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128U.cs index f0b8893fdb61e3..e27896e53c4849 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128U.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128U.cs @@ -36,26 +36,27 @@ unsafe partial class GenericsNative public static extern Vector128 AddVector128Us(in Vector128 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVector128U() + [Fact] + public static void TestVector128U() { Assert.Throws(() => GenericsNative.GetVector128U(1u, 2u, 3u, 4u)); Vector128 value2; GenericsNative.GetVector128UOut(1u, 2u, 3u, 4u, &value2); - Assert.Equal(value2.GetElement(0), 1u); - Assert.Equal(value2.GetElement(1), 2u); - Assert.Equal(value2.GetElement(2), 3u); - Assert.Equal(value2.GetElement(3), 4u); + Assert.Equal(1u, value2.GetElement(0)); + Assert.Equal(2u, value2.GetElement(1)); + Assert.Equal(3u, value2.GetElement(2)); + Assert.Equal(4u, value2.GetElement(3)); Assert.Throws(() => GenericsNative.GetVector128UOut(1u, 2u, 3u, 4u, out Vector128 value3)); Vector128* value4 = GenericsNative.GetVector128UPtr(1u, 2u, 3u, 4u); - Assert.Equal(value4->GetElement(0), 1u); - Assert.Equal(value4->GetElement(1), 2u); - Assert.Equal(value4->GetElement(2), 3u); - Assert.Equal(value4->GetElement(3), 4u); + Assert.Equal(1u, value4->GetElement(0)); + Assert.Equal(2u, value4->GetElement(1)); + Assert.Equal(3u, value4->GetElement(2)); + Assert.Equal(4u, value4->GetElement(3)); Assert.Throws(() => GenericsNative.GetVector128URef(1u, 2u, 3u, 4u)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs index a4bfd5874e7aa2..3a95b82ebfe209 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs @@ -36,84 +36,85 @@ unsafe partial class GenericsNative public static extern Vector256 AddVector256Bs(in Vector256 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVector256B() + [Fact] + public static void TestVector256B() { Assert.Throws(() => GenericsNative.GetVector256B(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false)); Vector256 value2; GenericsNative.GetVector256BOut(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, &value2); Vector256 tValue2 = *(Vector256*)&value2; - Assert.Equal(tValue2.GetElement(0), 1); - Assert.Equal(tValue2.GetElement(1), 0); - Assert.Equal(tValue2.GetElement(2), 1); - Assert.Equal(tValue2.GetElement(3), 0); - Assert.Equal(tValue2.GetElement(4), 1); - Assert.Equal(tValue2.GetElement(5), 0); - Assert.Equal(tValue2.GetElement(6), 1); - Assert.Equal(tValue2.GetElement(7), 0); - Assert.Equal(tValue2.GetElement(8), 1); - Assert.Equal(tValue2.GetElement(9), 0); - Assert.Equal(tValue2.GetElement(10), 1); - Assert.Equal(tValue2.GetElement(11), 0); - Assert.Equal(tValue2.GetElement(12), 1); - Assert.Equal(tValue2.GetElement(13), 0); - Assert.Equal(tValue2.GetElement(14), 1); - Assert.Equal(tValue2.GetElement(15), 0); - Assert.Equal(tValue2.GetElement(16), 1); - Assert.Equal(tValue2.GetElement(17), 0); - Assert.Equal(tValue2.GetElement(18), 1); - Assert.Equal(tValue2.GetElement(19), 0); - Assert.Equal(tValue2.GetElement(20), 1); - Assert.Equal(tValue2.GetElement(21), 0); - Assert.Equal(tValue2.GetElement(22), 1); - Assert.Equal(tValue2.GetElement(23), 0); - Assert.Equal(tValue2.GetElement(24), 1); - Assert.Equal(tValue2.GetElement(25), 0); - Assert.Equal(tValue2.GetElement(26), 1); - Assert.Equal(tValue2.GetElement(27), 0); - Assert.Equal(tValue2.GetElement(28), 1); - Assert.Equal(tValue2.GetElement(29), 0); - Assert.Equal(tValue2.GetElement(30), 1); - Assert.Equal(tValue2.GetElement(31), 0); + Assert.Equal(1, tValue2.GetElement(0)); + Assert.Equal(0, tValue2.GetElement(1)); + Assert.Equal(1, tValue2.GetElement(2)); + Assert.Equal(0, tValue2.GetElement(3)); + Assert.Equal(1, tValue2.GetElement(4)); + Assert.Equal(0, tValue2.GetElement(5)); + Assert.Equal(1, tValue2.GetElement(6)); + Assert.Equal(0, tValue2.GetElement(7)); + Assert.Equal(1, tValue2.GetElement(8)); + Assert.Equal(0, tValue2.GetElement(9)); + Assert.Equal(1, tValue2.GetElement(10)); + Assert.Equal(0, tValue2.GetElement(11)); + Assert.Equal(1, tValue2.GetElement(12)); + Assert.Equal(0, tValue2.GetElement(13)); + Assert.Equal(1, tValue2.GetElement(14)); + Assert.Equal(0, tValue2.GetElement(15)); + Assert.Equal(1, tValue2.GetElement(16)); + Assert.Equal(0, tValue2.GetElement(17)); + Assert.Equal(1, tValue2.GetElement(18)); + Assert.Equal(0, tValue2.GetElement(19)); + Assert.Equal(1, tValue2.GetElement(20)); + Assert.Equal(0, tValue2.GetElement(21)); + Assert.Equal(1, tValue2.GetElement(22)); + Assert.Equal(0, tValue2.GetElement(23)); + Assert.Equal(1, tValue2.GetElement(24)); + Assert.Equal(0, tValue2.GetElement(25)); + Assert.Equal(1, tValue2.GetElement(26)); + Assert.Equal(0, tValue2.GetElement(27)); + Assert.Equal(1, tValue2.GetElement(28)); + Assert.Equal(0, tValue2.GetElement(29)); + Assert.Equal(1, tValue2.GetElement(30)); + Assert.Equal(0, tValue2.GetElement(31)); Assert.Throws(() => GenericsNative.GetVector256BOut(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, out Vector256 value3)); Vector256* value4 = GenericsNative.GetVector256BPtr(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false); Vector256* tValue4 = (Vector256*)value4; - Assert.Equal(tValue4->GetElement(0), 1); - Assert.Equal(tValue4->GetElement(1), 0); - Assert.Equal(tValue4->GetElement(2), 1); - Assert.Equal(tValue4->GetElement(3), 0); - Assert.Equal(tValue4->GetElement(4), 1); - Assert.Equal(tValue4->GetElement(5), 0); - Assert.Equal(tValue4->GetElement(6), 1); - Assert.Equal(tValue4->GetElement(7), 0); - Assert.Equal(tValue4->GetElement(8), 1); - Assert.Equal(tValue4->GetElement(9), 0); - Assert.Equal(tValue4->GetElement(10), 1); - Assert.Equal(tValue4->GetElement(11), 0); - Assert.Equal(tValue4->GetElement(12), 1); - Assert.Equal(tValue4->GetElement(13), 0); - Assert.Equal(tValue4->GetElement(14), 1); - Assert.Equal(tValue4->GetElement(15), 0); - Assert.Equal(tValue4->GetElement(16), 1); - Assert.Equal(tValue4->GetElement(17), 0); - Assert.Equal(tValue4->GetElement(18), 1); - Assert.Equal(tValue4->GetElement(19), 0); - Assert.Equal(tValue4->GetElement(20), 1); - Assert.Equal(tValue4->GetElement(21), 0); - Assert.Equal(tValue4->GetElement(22), 1); - Assert.Equal(tValue4->GetElement(23), 0); - Assert.Equal(tValue4->GetElement(24), 1); - Assert.Equal(tValue4->GetElement(25), 0); - Assert.Equal(tValue4->GetElement(26), 1); - Assert.Equal(tValue4->GetElement(27), 0); - Assert.Equal(tValue4->GetElement(28), 1); - Assert.Equal(tValue4->GetElement(29), 0); - Assert.Equal(tValue4->GetElement(30), 1); - Assert.Equal(tValue4->GetElement(31), 0); + Assert.Equal(1, tValue4->GetElement(0)); + Assert.Equal(0, tValue4->GetElement(1)); + Assert.Equal(1, tValue4->GetElement(2)); + Assert.Equal(0, tValue4->GetElement(3)); + Assert.Equal(1, tValue4->GetElement(4)); + Assert.Equal(0, tValue4->GetElement(5)); + Assert.Equal(1, tValue4->GetElement(6)); + Assert.Equal(0, tValue4->GetElement(7)); + Assert.Equal(1, tValue4->GetElement(8)); + Assert.Equal(0, tValue4->GetElement(9)); + Assert.Equal(1, tValue4->GetElement(10)); + Assert.Equal(0, tValue4->GetElement(11)); + Assert.Equal(1, tValue4->GetElement(12)); + Assert.Equal(0, tValue4->GetElement(13)); + Assert.Equal(1, tValue4->GetElement(14)); + Assert.Equal(0, tValue4->GetElement(15)); + Assert.Equal(1, tValue4->GetElement(16)); + Assert.Equal(0, tValue4->GetElement(17)); + Assert.Equal(1, tValue4->GetElement(18)); + Assert.Equal(0, tValue4->GetElement(19)); + Assert.Equal(1, tValue4->GetElement(20)); + Assert.Equal(0, tValue4->GetElement(21)); + Assert.Equal(1, tValue4->GetElement(22)); + Assert.Equal(0, tValue4->GetElement(23)); + Assert.Equal(1, tValue4->GetElement(24)); + Assert.Equal(0, tValue4->GetElement(25)); + Assert.Equal(1, tValue4->GetElement(26)); + Assert.Equal(0, tValue4->GetElement(27)); + Assert.Equal(1, tValue4->GetElement(28)); + Assert.Equal(0, tValue4->GetElement(29)); + Assert.Equal(1, tValue4->GetElement(30)); + Assert.Equal(0, tValue4->GetElement(31)); Assert.Throws(() => GenericsNative.GetVector256BRef(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs index 37a6119e719d1f..13b99e3c018c1f 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs @@ -36,52 +36,53 @@ unsafe partial class GenericsNative public static extern Vector256 AddVector256Cs(in Vector256 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVector256C() + [Fact] + public static void TestVector256C() { Assert.Throws(() => GenericsNative.GetVector256C('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F')); Vector256 value2; GenericsNative.GetVector256COut('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', &value2); Vector256 tValue2 = *(Vector256*)&value2; - Assert.Equal(tValue2.GetElement(0), (short)'0'); - Assert.Equal(tValue2.GetElement(1), (short)'1'); - Assert.Equal(tValue2.GetElement(2), (short)'2'); - Assert.Equal(tValue2.GetElement(3), (short)'3'); - Assert.Equal(tValue2.GetElement(4), (short)'4'); - Assert.Equal(tValue2.GetElement(5), (short)'5'); - Assert.Equal(tValue2.GetElement(6), (short)'6'); - Assert.Equal(tValue2.GetElement(7), (short)'7'); - Assert.Equal(tValue2.GetElement(8), (short)'8'); - Assert.Equal(tValue2.GetElement(9), (short)'9'); - Assert.Equal(tValue2.GetElement(10), (short)'A'); - Assert.Equal(tValue2.GetElement(11), (short)'B'); - Assert.Equal(tValue2.GetElement(12), (short)'C'); - Assert.Equal(tValue2.GetElement(13), (short)'D'); - Assert.Equal(tValue2.GetElement(14), (short)'E'); - Assert.Equal(tValue2.GetElement(15), (short)'F'); + Assert.Equal((short)'0', tValue2.GetElement(0)); + Assert.Equal((short)'1', tValue2.GetElement(1)); + Assert.Equal((short)'2', tValue2.GetElement(2)); + Assert.Equal((short)'3', tValue2.GetElement(3)); + Assert.Equal((short)'4', tValue2.GetElement(4)); + Assert.Equal((short)'5', tValue2.GetElement(5)); + Assert.Equal((short)'6', tValue2.GetElement(6)); + Assert.Equal((short)'7', tValue2.GetElement(7)); + Assert.Equal((short)'8', tValue2.GetElement(8)); + Assert.Equal((short)'9', tValue2.GetElement(9)); + Assert.Equal((short)'A', tValue2.GetElement(10)); + Assert.Equal((short)'B', tValue2.GetElement(11)); + Assert.Equal((short)'C', tValue2.GetElement(12)); + Assert.Equal((short)'D', tValue2.GetElement(13)); + Assert.Equal((short)'E', tValue2.GetElement(14)); + Assert.Equal((short)'F', tValue2.GetElement(15)); Assert.Throws(() => GenericsNative.GetVector256COut('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', out Vector256 value3)); Vector256* value4 = GenericsNative.GetVector256CPtr('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'); Vector256* tValue4 = (Vector256*)value4; - Assert.Equal(tValue4->GetElement(0), (short)'0'); - Assert.Equal(tValue4->GetElement(1), (short)'1'); - Assert.Equal(tValue4->GetElement(2), (short)'2'); - Assert.Equal(tValue4->GetElement(3), (short)'3'); - Assert.Equal(tValue4->GetElement(4), (short)'4'); - Assert.Equal(tValue4->GetElement(5), (short)'5'); - Assert.Equal(tValue4->GetElement(6), (short)'6'); - Assert.Equal(tValue4->GetElement(7), (short)'7'); - Assert.Equal(tValue4->GetElement(8), (short)'8'); - Assert.Equal(tValue4->GetElement(9), (short)'9'); - Assert.Equal(tValue4->GetElement(10), (short)'A'); - Assert.Equal(tValue4->GetElement(11), (short)'B'); - Assert.Equal(tValue4->GetElement(12), (short)'C'); - Assert.Equal(tValue4->GetElement(13), (short)'D'); - Assert.Equal(tValue4->GetElement(14), (short)'E'); - Assert.Equal(tValue4->GetElement(15), (short)'F'); + Assert.Equal((short)'0', tValue4->GetElement(0)); + Assert.Equal((short)'1', tValue4->GetElement(1)); + Assert.Equal((short)'2', tValue4->GetElement(2)); + Assert.Equal((short)'3', tValue4->GetElement(3)); + Assert.Equal((short)'4', tValue4->GetElement(4)); + Assert.Equal((short)'5', tValue4->GetElement(5)); + Assert.Equal((short)'6', tValue4->GetElement(6)); + Assert.Equal((short)'7', tValue4->GetElement(7)); + Assert.Equal((short)'8', tValue4->GetElement(8)); + Assert.Equal((short)'9', tValue4->GetElement(9)); + Assert.Equal((short)'A', tValue4->GetElement(10)); + Assert.Equal((short)'B', tValue4->GetElement(11)); + Assert.Equal((short)'C', tValue4->GetElement(12)); + Assert.Equal((short)'D', tValue4->GetElement(13)); + Assert.Equal((short)'E', tValue4->GetElement(14)); + Assert.Equal((short)'F', tValue4->GetElement(15)); Assert.Throws(() => GenericsNative.GetVector256CRef('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs index 527ce2319b7bbf..b4aba2fb36b954 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs @@ -36,26 +36,27 @@ unsafe partial class GenericsNative public static extern Vector256 AddVector256Ds(in Vector256 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVector256D() + [Fact] + public static void TestVector256D() { Assert.Throws(() => GenericsNative.GetVector256D(1.0, 2.0, 3.0, 4.0)); Vector256 value2; GenericsNative.GetVector256DOut(1.0, 2.0, 3.0, 4.0, &value2); - Assert.Equal(value2.GetElement(0), 1.0); - Assert.Equal(value2.GetElement(1), 2.0); - Assert.Equal(value2.GetElement(2), 3.0); - Assert.Equal(value2.GetElement(3), 4.0); + Assert.Equal(1.0, value2.GetElement(0)); + Assert.Equal(2.0, value2.GetElement(1)); + Assert.Equal(3.0, value2.GetElement(2)); + Assert.Equal(4.0, value2.GetElement(3)); Assert.Throws(() => GenericsNative.GetVector256DOut(1.0, 2.0, 3.0, 4.0, out Vector256 value3)); Vector256* value4 = GenericsNative.GetVector256DPtr(1.0, 2.0, 3.0, 4.0); - Assert.Equal(value4->GetElement(0), 1.0); - Assert.Equal(value4->GetElement(1), 2.0); - Assert.Equal(value4->GetElement(2), 3.0); - Assert.Equal(value4->GetElement(3), 4.0); + Assert.Equal(1.0, value4->GetElement(0)); + Assert.Equal(2.0, value4->GetElement(1)); + Assert.Equal(3.0, value4->GetElement(2)); + Assert.Equal(4.0, value4->GetElement(3)); Assert.Throws(() => GenericsNative.GetVector256DRef(1.0, 2.0, 3.0, 4.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs index 601f400316ac99..92e5c3e86f164f 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs @@ -36,34 +36,35 @@ unsafe partial class GenericsNative public static extern Vector256 AddVector256Fs(in Vector256 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVector256F() + [Fact] + public static void TestVector256F() { Assert.Throws(() => GenericsNative.GetVector256F(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f)); Vector256 value2; GenericsNative.GetVector256FOut(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, &value2); - Assert.Equal(value2.GetElement(0), 1.0f); - Assert.Equal(value2.GetElement(1), 2.0f); - Assert.Equal(value2.GetElement(2), 3.0f); - Assert.Equal(value2.GetElement(3), 4.0f); - Assert.Equal(value2.GetElement(4), 5.0f); - Assert.Equal(value2.GetElement(5), 6.0f); - Assert.Equal(value2.GetElement(6), 7.0f); - Assert.Equal(value2.GetElement(7), 8.0f); + Assert.Equal(1.0f, value2.GetElement(0)); + Assert.Equal(2.0f, value2.GetElement(1)); + Assert.Equal(3.0f, value2.GetElement(2)); + Assert.Equal(4.0f, value2.GetElement(3)); + Assert.Equal(5.0f, value2.GetElement(4)); + Assert.Equal(6.0f, value2.GetElement(5)); + Assert.Equal(7.0f, value2.GetElement(6)); + Assert.Equal(8.0f, value2.GetElement(7)); Assert.Throws(() => GenericsNative.GetVector256FOut(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, out Vector256 value3)); Vector256* value4 = GenericsNative.GetVector256FPtr(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f); - Assert.Equal(value4->GetElement(0), 1.0f); - Assert.Equal(value4->GetElement(1), 2.0f); - Assert.Equal(value4->GetElement(2), 3.0f); - Assert.Equal(value4->GetElement(3), 4.0f); - Assert.Equal(value4->GetElement(4), 5.0f); - Assert.Equal(value4->GetElement(5), 6.0f); - Assert.Equal(value4->GetElement(6), 7.0f); - Assert.Equal(value4->GetElement(7), 8.0f); + Assert.Equal(1.0f, value4->GetElement(0)); + Assert.Equal(2.0f, value4->GetElement(1)); + Assert.Equal(3.0f, value4->GetElement(2)); + Assert.Equal(4.0f, value4->GetElement(3)); + Assert.Equal(5.0f, value4->GetElement(4)); + Assert.Equal(6.0f, value4->GetElement(5)); + Assert.Equal(7.0f, value4->GetElement(6)); + Assert.Equal(8.0f, value4->GetElement(7)); Assert.Throws(() => GenericsNative.GetVector256FRef(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs index a1ff3223f526c0..d8172cde1c4da9 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs @@ -36,26 +36,27 @@ unsafe partial class GenericsNative public static extern Vector256 AddVector256Ls(in Vector256 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVector256L() + [Fact] + public static void TestVector256L() { Assert.Throws(() => GenericsNative.GetVector256L(1L, 2L, 3L, 4L)); Vector256 value2; GenericsNative.GetVector256LOut(1L, 2L, 3L, 4L, &value2); - Assert.Equal(value2.GetElement(0), 1L); - Assert.Equal(value2.GetElement(1), 2L); - Assert.Equal(value2.GetElement(2), 3L); - Assert.Equal(value2.GetElement(3), 4L); + Assert.Equal(1L, value2.GetElement(0)); + Assert.Equal(2L, value2.GetElement(1)); + Assert.Equal(3L, value2.GetElement(2)); + Assert.Equal(4L, value2.GetElement(3)); Assert.Throws(() => GenericsNative.GetVector256LOut(1L, 2L, 3L, 4L, out Vector256 value3)); Vector256* value4 = GenericsNative.GetVector256LPtr(1L, 2L, 3L, 4L); - Assert.Equal(value4->GetElement(0), 1L); - Assert.Equal(value4->GetElement(1), 2L); - Assert.Equal(value4->GetElement(2), 3L); - Assert.Equal(value4->GetElement(3), 4L); + Assert.Equal(1L, value4->GetElement(0)); + Assert.Equal(2L, value4->GetElement(1)); + Assert.Equal(3L, value4->GetElement(2)); + Assert.Equal(4L, value4->GetElement(3)); Assert.Throws(() => GenericsNative.GetVector256LRef(1L, 2L, 3L, 4L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs index c4b468ae67ff60..b05e7d6fc92a4f 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs @@ -36,34 +36,35 @@ unsafe partial class GenericsNative public static extern Vector256 AddVector256Us(in Vector256 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVector256U() + [Fact] + public static void TestVector256U() { Assert.Throws(() => GenericsNative.GetVector256U(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u)); Vector256 value2; GenericsNative.GetVector256UOut(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, &value2); - Assert.Equal(value2.GetElement(0), 1u); - Assert.Equal(value2.GetElement(1), 2u); - Assert.Equal(value2.GetElement(2), 3u); - Assert.Equal(value2.GetElement(3), 4u); - Assert.Equal(value2.GetElement(4), 5u); - Assert.Equal(value2.GetElement(5), 6u); - Assert.Equal(value2.GetElement(6), 7u); - Assert.Equal(value2.GetElement(7), 8u); + Assert.Equal(1u, value2.GetElement(0)); + Assert.Equal(2u, value2.GetElement(1)); + Assert.Equal(3u, value2.GetElement(2)); + Assert.Equal(4u, value2.GetElement(3)); + Assert.Equal(5u, value2.GetElement(4)); + Assert.Equal(6u, value2.GetElement(5)); + Assert.Equal(7u, value2.GetElement(6)); + Assert.Equal(8u, value2.GetElement(7)); Assert.Throws(() => GenericsNative.GetVector256UOut(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, out Vector256 value3)); Vector256* value4 = GenericsNative.GetVector256UPtr(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u); - Assert.Equal(value4->GetElement(0), 1u); - Assert.Equal(value4->GetElement(1), 2u); - Assert.Equal(value4->GetElement(2), 3u); - Assert.Equal(value4->GetElement(3), 4u); - Assert.Equal(value4->GetElement(4), 5u); - Assert.Equal(value4->GetElement(5), 6u); - Assert.Equal(value4->GetElement(6), 7u); - Assert.Equal(value4->GetElement(7), 8u); + Assert.Equal(1u, value4->GetElement(0)); + Assert.Equal(2u, value4->GetElement(1)); + Assert.Equal(3u, value4->GetElement(2)); + Assert.Equal(4u, value4->GetElement(3)); + Assert.Equal(5u, value4->GetElement(4)); + Assert.Equal(6u, value4->GetElement(5)); + Assert.Equal(7u, value4->GetElement(6)); + Assert.Equal(8u, value4->GetElement(7)); Assert.Throws(() => GenericsNative.GetVector256URef(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64B.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64B.cs index d0961cb506a325..6d273129eff3f8 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64B.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64B.cs @@ -36,36 +36,37 @@ unsafe partial class GenericsNative public static extern Vector64 AddVector64Bs(in Vector64 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVector64B() + [Fact] + public static void TestVector64B() { Assert.Throws(() => GenericsNative.GetVector64B(true, false, true, false, true, false, true, false)); Vector64 value2; GenericsNative.GetVector64BOut(true, false, true, false, true, false, true, false, &value2); Vector64 tValue2 = *(Vector64*)&value2; - Assert.Equal(tValue2.GetElement(0), 1); - Assert.Equal(tValue2.GetElement(1), 0); - Assert.Equal(tValue2.GetElement(2), 1); - Assert.Equal(tValue2.GetElement(3), 0); - Assert.Equal(tValue2.GetElement(4), 1); - Assert.Equal(tValue2.GetElement(5), 0); - Assert.Equal(tValue2.GetElement(6), 1); - Assert.Equal(tValue2.GetElement(7), 0); + Assert.Equal(1, tValue2.GetElement(0)); + Assert.Equal(0, tValue2.GetElement(1)); + Assert.Equal(1, tValue2.GetElement(2)); + Assert.Equal(0, tValue2.GetElement(3)); + Assert.Equal(1, tValue2.GetElement(4)); + Assert.Equal(0, tValue2.GetElement(5)); + Assert.Equal(1, tValue2.GetElement(6)); + Assert.Equal(0, tValue2.GetElement(7)); Assert.Throws(() => GenericsNative.GetVector64BOut(true, false, true, false, true, false, true, false, out Vector64 value3)); Vector64* value4 = GenericsNative.GetVector64BPtr(true, false, true, false, true, false, true, false); Vector64* tValue4 = (Vector64*)value4; - Assert.Equal(tValue4->GetElement(0), 1); - Assert.Equal(tValue4->GetElement(1), 0); - Assert.Equal(tValue4->GetElement(2), 1); - Assert.Equal(tValue4->GetElement(3), 0); - Assert.Equal(tValue4->GetElement(4), 1); - Assert.Equal(tValue4->GetElement(5), 0); - Assert.Equal(tValue4->GetElement(6), 1); - Assert.Equal(tValue4->GetElement(7), 0); + Assert.Equal(1, tValue4->GetElement(0)); + Assert.Equal(0, tValue4->GetElement(1)); + Assert.Equal(1, tValue4->GetElement(2)); + Assert.Equal(0, tValue4->GetElement(3)); + Assert.Equal(1, tValue4->GetElement(4)); + Assert.Equal(0, tValue4->GetElement(5)); + Assert.Equal(1, tValue4->GetElement(6)); + Assert.Equal(0, tValue4->GetElement(7)); Assert.Throws(() => GenericsNative.GetVector64BRef(true, false, true, false, true, false, true, false)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64C.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64C.cs index 265e5a90e305c9..a7121ca77670cf 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64C.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64C.cs @@ -36,28 +36,29 @@ unsafe partial class GenericsNative public static extern Vector64 AddVector64Cs(in Vector64 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVector64C() + [Fact] + public static void TestVector64C() { Assert.Throws(() => GenericsNative.GetVector64C('0', '1', '2', '3')); Vector64 value2; GenericsNative.GetVector64COut('0', '1', '2', '3', &value2); Vector64 tValue2 = *(Vector64*)&value2; - Assert.Equal(tValue2.GetElement(0), (short)'0'); - Assert.Equal(tValue2.GetElement(1), (short)'1'); - Assert.Equal(tValue2.GetElement(2), (short)'2'); - Assert.Equal(tValue2.GetElement(3), (short)'3'); + Assert.Equal((short)'0', tValue2.GetElement(0)); + Assert.Equal((short)'1', tValue2.GetElement(1)); + Assert.Equal((short)'2', tValue2.GetElement(2)); + Assert.Equal((short)'3', tValue2.GetElement(3)); Assert.Throws(() => GenericsNative.GetVector64COut('0', '1', '2', '3', out Vector64 value3)); Vector64* value4 = GenericsNative.GetVector64CPtr('0', '1', '2', '3'); Vector64* tValue4 = (Vector64*)value4; - Assert.Equal(tValue4->GetElement(0), (short)'0'); - Assert.Equal(tValue4->GetElement(1), (short)'1'); - Assert.Equal(tValue4->GetElement(2), (short)'2'); - Assert.Equal(tValue4->GetElement(3), (short)'3'); + Assert.Equal((short)'0', tValue4->GetElement(0)); + Assert.Equal((short)'1', tValue4->GetElement(1)); + Assert.Equal((short)'2', tValue4->GetElement(2)); + Assert.Equal((short)'3', tValue4->GetElement(3)); Assert.Throws(() => GenericsNative.GetVector64CRef('0', '1', '2', '3')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64D.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64D.cs index 2be39f93bdb4c4..193be2bdcaccb4 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64D.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64D.cs @@ -36,20 +36,21 @@ unsafe partial class GenericsNative public static extern Vector64 AddVector64Ds(in Vector64 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVector64D() + [Fact] + public static void TestVector64D() { Assert.Throws(() => GenericsNative.GetVector64D(1.0)); Vector64 value2; GenericsNative.GetVector64DOut(1.0, &value2); - Assert.Equal(value2.GetElement(0), 1.0); + Assert.Equal(1.0, value2.GetElement(0)); Assert.Throws(() => GenericsNative.GetVector64DOut(1.0, out Vector64 value3)); Vector64* value4 = GenericsNative.GetVector64DPtr(1.0); - Assert.Equal(value4->GetElement(0), 1.0); + Assert.Equal(1.0, value4->GetElement(0)); Assert.Throws(() => GenericsNative.GetVector64DRef(1.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64F.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64F.cs index 54a3cadbd93ec6..15ca6abe2d1145 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64F.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64F.cs @@ -36,22 +36,23 @@ unsafe partial class GenericsNative public static extern Vector64 AddVector64Fs(in Vector64 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVector64F() + [Fact] + public static void TestVector64F() { Assert.Throws(() => GenericsNative.GetVector64F(1.0f, 2.0f)); Vector64 value2; GenericsNative.GetVector64FOut(1.0f, 2.0f, &value2); - Assert.Equal(value2.GetElement(0), 1.0f); - Assert.Equal(value2.GetElement(1), 2.0f); + Assert.Equal(1.0f, value2.GetElement(0)); + Assert.Equal(2.0f, value2.GetElement(1)); Assert.Throws(() => GenericsNative.GetVector64FOut(1.0f, 2.0f, out Vector64 value3)); Vector64* value4 = GenericsNative.GetVector64FPtr(1.0f, 2.0f); - Assert.Equal(value4->GetElement(0), 1.0f); - Assert.Equal(value4->GetElement(1), 2.0f); + Assert.Equal(1.0f, value4->GetElement(0)); + Assert.Equal(2.0f, value4->GetElement(1)); Assert.Throws(() => GenericsNative.GetVector64FRef(1.0f, 2.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64L.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64L.cs index cb215a0515b02d..4a15a4bed2492c 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64L.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64L.cs @@ -36,20 +36,21 @@ unsafe partial class GenericsNative public static extern Vector64 AddVector64Ls(in Vector64 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVector64L() + [Fact] + public static void TestVector64L() { Assert.Throws(() => GenericsNative.GetVector64L(1L)); Vector64 value2; GenericsNative.GetVector64LOut(1L, &value2); - Assert.Equal(value2.GetElement(0), 1L); + Assert.Equal(1L, value2.GetElement(0)); Assert.Throws(() => GenericsNative.GetVector64LOut(1L, out Vector64 value3)); Vector64* value4 = GenericsNative.GetVector64LPtr(1L); - Assert.Equal(value4->GetElement(0), 1L); + Assert.Equal(1L, value4->GetElement(0)); Assert.Throws(() => GenericsNative.GetVector64LRef(1L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64U.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64U.cs index 20be15fca9cf14..d0531e5864fcce 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64U.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64U.cs @@ -36,22 +36,23 @@ unsafe partial class GenericsNative public static extern Vector64 AddVector64Us(in Vector64 pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVector64U() + [Fact] + public static void TestVector64U() { Assert.Throws(() => GenericsNative.GetVector64U(1u, 2u)); Vector64 value2; GenericsNative.GetVector64UOut(1u, 2u, &value2); - Assert.Equal(value2.GetElement(0), 1u); - Assert.Equal(value2.GetElement(1), 2u); + Assert.Equal(1u, value2.GetElement(0)); + Assert.Equal(2u, value2.GetElement(1)); Assert.Throws(() => GenericsNative.GetVector64UOut(1u, 2u, out Vector64 value3)); Vector64* value4 = GenericsNative.GetVector64UPtr(1u, 2u); - Assert.Equal(value4->GetElement(0), 1u); - Assert.Equal(value4->GetElement(1), 2u); + Assert.Equal(1u, value4->GetElement(0)); + Assert.Equal(2u, value4->GetElement(1)); Assert.Throws(() => GenericsNative.GetVector64URef(1u, 2u)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorB.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorB.cs index 16d6d42882d7b0..d21ee9eddb3ea4 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorB.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorB.cs @@ -63,9 +63,10 @@ unsafe partial class GenericsNative public static extern Vector AddVectorB256s(in Vector pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVectorB() + [Fact] + public static void TestVectorB() { if (Vector.Count == 32) { @@ -73,55 +74,56 @@ private static void TestVectorB() } else { - Assert.Equal(Vector.Count, 16); + Assert.Equal(16, Vector.Count); TestVectorB128(); } } - private static void TestVectorB128() + [Fact] + public static void TestVectorB128() { Assert.Throws(() => GenericsNative.GetVectorB128(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false)); Vector value2; GenericsNative.GetVectorB128Out(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, &value2); Vector tValue2 = *(Vector*)&value2; - Assert.Equal(tValue2[0], 1); - Assert.Equal(tValue2[1], 0); - Assert.Equal(tValue2[2], 1); - Assert.Equal(tValue2[3], 0); - Assert.Equal(tValue2[4], 1); - Assert.Equal(tValue2[5], 0); - Assert.Equal(tValue2[6], 1); - Assert.Equal(tValue2[7], 0); - Assert.Equal(tValue2[8], 1); - Assert.Equal(tValue2[9], 0); - Assert.Equal(tValue2[10], 1); - Assert.Equal(tValue2[11], 0); - Assert.Equal(tValue2[12], 1); - Assert.Equal(tValue2[13], 0); - Assert.Equal(tValue2[14], 1); - Assert.Equal(tValue2[15], 0); + Assert.Equal(1, tValue2[0]); + Assert.Equal(0, tValue2[1]); + Assert.Equal(1, tValue2[2]); + Assert.Equal(0, tValue2[3]); + Assert.Equal(1, tValue2[4]); + Assert.Equal(0, tValue2[5]); + Assert.Equal(1, tValue2[6]); + Assert.Equal(0, tValue2[7]); + Assert.Equal(1, tValue2[8]); + Assert.Equal(0, tValue2[9]); + Assert.Equal(1, tValue2[10]); + Assert.Equal(0, tValue2[11]); + Assert.Equal(1, tValue2[12]); + Assert.Equal(0, tValue2[13]); + Assert.Equal(1, tValue2[14]); + Assert.Equal(0, tValue2[15]); Assert.Throws(() => GenericsNative.GetVectorB128Out(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, out Vector value3)); Vector* value4 = GenericsNative.GetVectorB128Ptr(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false); Vector* tValue4 = (Vector*)value4; - Assert.Equal((*tValue4)[0], 1); - Assert.Equal((*tValue4)[1], 0); - Assert.Equal((*tValue4)[2], 1); - Assert.Equal((*tValue4)[3], 0); - Assert.Equal((*tValue4)[4], 1); - Assert.Equal((*tValue4)[5], 0); - Assert.Equal((*tValue4)[6], 1); - Assert.Equal((*tValue4)[7], 0); - Assert.Equal((*tValue4)[8], 1); - Assert.Equal((*tValue4)[9], 0); - Assert.Equal((*tValue4)[10], 1); - Assert.Equal((*tValue4)[11], 0); - Assert.Equal((*tValue4)[12], 1); - Assert.Equal((*tValue4)[13], 0); - Assert.Equal((*tValue4)[14], 1); - Assert.Equal((*tValue4)[15], 0); + Assert.Equal(1, (*tValue4)[0]); + Assert.Equal(0, (*tValue4)[1]); + Assert.Equal(1, (*tValue4)[2]); + Assert.Equal(0, (*tValue4)[3]); + Assert.Equal(1, (*tValue4)[4]); + Assert.Equal(0, (*tValue4)[5]); + Assert.Equal(1, (*tValue4)[6]); + Assert.Equal(0, (*tValue4)[7]); + Assert.Equal(1, (*tValue4)[8]); + Assert.Equal(0, (*tValue4)[9]); + Assert.Equal(1, (*tValue4)[10]); + Assert.Equal(0, (*tValue4)[11]); + Assert.Equal(1, (*tValue4)[12]); + Assert.Equal(0, (*tValue4)[13]); + Assert.Equal(1, (*tValue4)[14]); + Assert.Equal(0, (*tValue4)[15]); Assert.Throws(() => GenericsNative.GetVectorB128Ref(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false)); @@ -147,82 +149,83 @@ private static void TestVectorB128() Assert.Throws(() => GenericsNative.AddVectorB128s(in values[0], values.Length)); } - private static void TestVectorB256() + [Fact] + public static void TestVectorB256() { Assert.Throws(() => GenericsNative.GetVectorB256(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false)); Vector value2; GenericsNative.GetVectorB256Out(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, &value2); Vector tValue2 = *(Vector*)&value2; - Assert.Equal(tValue2[0], 1); - Assert.Equal(tValue2[1], 0); - Assert.Equal(tValue2[2], 1); - Assert.Equal(tValue2[3], 0); - Assert.Equal(tValue2[4], 1); - Assert.Equal(tValue2[5], 0); - Assert.Equal(tValue2[6], 1); - Assert.Equal(tValue2[7], 0); - Assert.Equal(tValue2[8], 1); - Assert.Equal(tValue2[9], 0); - Assert.Equal(tValue2[10], 1); - Assert.Equal(tValue2[11], 0); - Assert.Equal(tValue2[12], 1); - Assert.Equal(tValue2[13], 0); - Assert.Equal(tValue2[14], 1); - Assert.Equal(tValue2[15], 0); - Assert.Equal(tValue2[16], 1); - Assert.Equal(tValue2[17], 0); - Assert.Equal(tValue2[18], 1); - Assert.Equal(tValue2[19], 0); - Assert.Equal(tValue2[20], 1); - Assert.Equal(tValue2[21], 0); - Assert.Equal(tValue2[22], 1); - Assert.Equal(tValue2[23], 0); - Assert.Equal(tValue2[24], 1); - Assert.Equal(tValue2[25], 0); - Assert.Equal(tValue2[26], 1); - Assert.Equal(tValue2[27], 0); - Assert.Equal(tValue2[28], 1); - Assert.Equal(tValue2[29], 0); - Assert.Equal(tValue2[30], 1); - Assert.Equal(tValue2[31], 0); + Assert.Equal(1, tValue2[0]); + Assert.Equal(0, tValue2[1]); + Assert.Equal(1, tValue2[2]); + Assert.Equal(0, tValue2[3]); + Assert.Equal(1, tValue2[4]); + Assert.Equal(0, tValue2[5]); + Assert.Equal(1, tValue2[6]); + Assert.Equal(0, tValue2[7]); + Assert.Equal(1, tValue2[8]); + Assert.Equal(0, tValue2[9]); + Assert.Equal(1, tValue2[10]); + Assert.Equal(0, tValue2[11]); + Assert.Equal(1, tValue2[12]); + Assert.Equal(0, tValue2[13]); + Assert.Equal(1, tValue2[14]); + Assert.Equal(0, tValue2[15]); + Assert.Equal(1, tValue2[16]); + Assert.Equal(0, tValue2[17]); + Assert.Equal(1, tValue2[18]); + Assert.Equal(0, tValue2[19]); + Assert.Equal(1, tValue2[20]); + Assert.Equal(0, tValue2[21]); + Assert.Equal(1, tValue2[22]); + Assert.Equal(0, tValue2[23]); + Assert.Equal(1, tValue2[24]); + Assert.Equal(0, tValue2[25]); + Assert.Equal(1, tValue2[26]); + Assert.Equal(0, tValue2[27]); + Assert.Equal(1, tValue2[28]); + Assert.Equal(0, tValue2[29]); + Assert.Equal(1, tValue2[30]); + Assert.Equal(0, tValue2[31]); Assert.Throws(() => GenericsNative.GetVectorB256Out(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, out Vector value3)); Vector* value4 = GenericsNative.GetVectorB256Ptr(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false); Vector* tValue4 = (Vector*)value4; - Assert.Equal((*tValue4)[0], 1); - Assert.Equal((*tValue4)[1], 0); - Assert.Equal((*tValue4)[2], 1); - Assert.Equal((*tValue4)[3], 0); - Assert.Equal((*tValue4)[4], 1); - Assert.Equal((*tValue4)[5], 0); - Assert.Equal((*tValue4)[6], 1); - Assert.Equal((*tValue4)[7], 0); - Assert.Equal((*tValue4)[8], 1); - Assert.Equal((*tValue4)[9], 0); - Assert.Equal((*tValue4)[10], 1); - Assert.Equal((*tValue4)[11], 0); - Assert.Equal((*tValue4)[12], 1); - Assert.Equal((*tValue4)[13], 0); - Assert.Equal((*tValue4)[14], 1); - Assert.Equal((*tValue4)[15], 0); - Assert.Equal((*tValue4)[16], 1); - Assert.Equal((*tValue4)[17], 0); - Assert.Equal((*tValue4)[18], 1); - Assert.Equal((*tValue4)[19], 0); - Assert.Equal((*tValue4)[20], 1); - Assert.Equal((*tValue4)[21], 0); - Assert.Equal((*tValue4)[22], 1); - Assert.Equal((*tValue4)[23], 0); - Assert.Equal((*tValue4)[24], 1); - Assert.Equal((*tValue4)[25], 0); - Assert.Equal((*tValue4)[26], 1); - Assert.Equal((*tValue4)[27], 0); - Assert.Equal((*tValue4)[28], 1); - Assert.Equal((*tValue4)[29], 0); - Assert.Equal((*tValue4)[30], 1); - Assert.Equal((*tValue4)[31], 0); + Assert.Equal(1, (*tValue4)[0]); + Assert.Equal(0, (*tValue4)[1]); + Assert.Equal(1, (*tValue4)[2]); + Assert.Equal(0, (*tValue4)[3]); + Assert.Equal(1, (*tValue4)[4]); + Assert.Equal(0, (*tValue4)[5]); + Assert.Equal(1, (*tValue4)[6]); + Assert.Equal(0, (*tValue4)[7]); + Assert.Equal(1, (*tValue4)[8]); + Assert.Equal(0, (*tValue4)[9]); + Assert.Equal(1, (*tValue4)[10]); + Assert.Equal(0, (*tValue4)[11]); + Assert.Equal(1, (*tValue4)[12]); + Assert.Equal(0, (*tValue4)[13]); + Assert.Equal(1, (*tValue4)[14]); + Assert.Equal(0, (*tValue4)[15]); + Assert.Equal(1, (*tValue4)[16]); + Assert.Equal(0, (*tValue4)[17]); + Assert.Equal(1, (*tValue4)[18]); + Assert.Equal(0, (*tValue4)[19]); + Assert.Equal(1, (*tValue4)[20]); + Assert.Equal(0, (*tValue4)[21]); + Assert.Equal(1, (*tValue4)[22]); + Assert.Equal(0, (*tValue4)[23]); + Assert.Equal(1, (*tValue4)[24]); + Assert.Equal(0, (*tValue4)[25]); + Assert.Equal(1, (*tValue4)[26]); + Assert.Equal(0, (*tValue4)[27]); + Assert.Equal(1, (*tValue4)[28]); + Assert.Equal(0, (*tValue4)[29]); + Assert.Equal(1, (*tValue4)[30]); + Assert.Equal(0, (*tValue4)[31]); Assert.Throws(() => GenericsNative.GetVectorB256Ref(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorC.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorC.cs index 44ca102a3dffb1..4515096ddc6654 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorC.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorC.cs @@ -63,9 +63,10 @@ unsafe partial class GenericsNative public static extern Vector AddVectorC256s(in Vector pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVectorC() + [Fact] + public static void TestVectorC() { if (Vector.Count == 16) { @@ -73,39 +74,40 @@ private static void TestVectorC() } else { - Assert.Equal(Vector.Count, 8); + Assert.Equal(8, Vector.Count); TestVectorC128(); } } - private static void TestVectorC128() + [Fact] + public static void TestVectorC128() { Assert.Throws(() => GenericsNative.GetVectorC128('0', '1', '2', '3', '4', '5', '6', '7')); Vector value2; GenericsNative.GetVectorC128Out('0', '1', '2', '3', '4', '5', '6', '7', &value2); Vector tValue2 = *(Vector*)&value2; - Assert.Equal(tValue2[0], (short)'0'); - Assert.Equal(tValue2[1], (short)'1'); - Assert.Equal(tValue2[2], (short)'2'); - Assert.Equal(tValue2[3], (short)'3'); - Assert.Equal(tValue2[4], (short)'4'); - Assert.Equal(tValue2[5], (short)'5'); - Assert.Equal(tValue2[6], (short)'6'); - Assert.Equal(tValue2[7], (short)'7'); + Assert.Equal((short)'0', tValue2[0]); + Assert.Equal((short)'1', tValue2[1]); + Assert.Equal((short)'2', tValue2[2]); + Assert.Equal((short)'3', tValue2[3]); + Assert.Equal((short)'4', tValue2[4]); + Assert.Equal((short)'5', tValue2[5]); + Assert.Equal((short)'6', tValue2[6]); + Assert.Equal((short)'7', tValue2[7]); Assert.Throws(() => GenericsNative.GetVectorC128Out('0', '1', '2', '3', '4', '5', '6', '7', out Vector value3)); Vector* value4 = GenericsNative.GetVectorC128Ptr('0', '1', '2', '3', '4', '5', '6', '7'); Vector* tValue4 = (Vector*)value4; - Assert.Equal((*tValue4)[0], (short)'0'); - Assert.Equal((*tValue4)[1], (short)'1'); - Assert.Equal((*tValue4)[2], (short)'2'); - Assert.Equal((*tValue4)[3], (short)'3'); - Assert.Equal((*tValue4)[4], (short)'4'); - Assert.Equal((*tValue4)[5], (short)'5'); - Assert.Equal((*tValue4)[6], (short)'6'); - Assert.Equal((*tValue4)[7], (short)'7'); + Assert.Equal((short)'0', (*tValue4)[0]); + Assert.Equal((short)'1', (*tValue4)[1]); + Assert.Equal((short)'2', (*tValue4)[2]); + Assert.Equal((short)'3', (*tValue4)[3]); + Assert.Equal((short)'4', (*tValue4)[4]); + Assert.Equal((short)'5', (*tValue4)[5]); + Assert.Equal((short)'6', (*tValue4)[6]); + Assert.Equal((short)'7', (*tValue4)[7]); Assert.Throws(() => GenericsNative.GetVectorC128Ref('0', '1', '2', '3', '4', '5', '6', '7')); @@ -131,50 +133,51 @@ private static void TestVectorC128() Assert.Throws(() => GenericsNative.AddVectorC128s(in values[0], values.Length)); } - private static void TestVectorC256() + [Fact] + public static void TestVectorC256() { Assert.Throws(() => GenericsNative.GetVectorC256('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F')); Vector value2; GenericsNative.GetVectorC256Out('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', &value2); Vector tValue2 = *(Vector*)&value2; - Assert.Equal(tValue2[0], (short)'0'); - Assert.Equal(tValue2[1], (short)'1'); - Assert.Equal(tValue2[2], (short)'2'); - Assert.Equal(tValue2[3], (short)'3'); - Assert.Equal(tValue2[4], (short)'4'); - Assert.Equal(tValue2[5], (short)'5'); - Assert.Equal(tValue2[6], (short)'6'); - Assert.Equal(tValue2[7], (short)'7'); - Assert.Equal(tValue2[8], (short)'8'); - Assert.Equal(tValue2[9], (short)'9'); - Assert.Equal(tValue2[10], (short)'A'); - Assert.Equal(tValue2[11], (short)'B'); - Assert.Equal(tValue2[12], (short)'C'); - Assert.Equal(tValue2[13], (short)'D'); - Assert.Equal(tValue2[14], (short)'E'); - Assert.Equal(tValue2[15], (short)'F'); + Assert.Equal((short)'0', tValue2[0]); + Assert.Equal((short)'1', tValue2[1]); + Assert.Equal((short)'2', tValue2[2]); + Assert.Equal((short)'3', tValue2[3]); + Assert.Equal((short)'4', tValue2[4]); + Assert.Equal((short)'5', tValue2[5]); + Assert.Equal((short)'6', tValue2[6]); + Assert.Equal((short)'7', tValue2[7]); + Assert.Equal((short)'8', tValue2[8]); + Assert.Equal((short)'9', tValue2[9]); + Assert.Equal((short)'A', tValue2[10]); + Assert.Equal((short)'B', tValue2[11]); + Assert.Equal((short)'C', tValue2[12]); + Assert.Equal((short)'D', tValue2[13]); + Assert.Equal((short)'E', tValue2[14]); + Assert.Equal((short)'F', tValue2[15]); Assert.Throws(() => GenericsNative.GetVectorC256Out('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', out Vector value3)); Vector* value4 = GenericsNative.GetVectorC256Ptr('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'); Vector* tValue4 = (Vector*)value4; - Assert.Equal((*tValue4)[0], (short)'0'); - Assert.Equal((*tValue4)[1], (short)'1'); - Assert.Equal((*tValue4)[2], (short)'2'); - Assert.Equal((*tValue4)[3], (short)'3'); - Assert.Equal((*tValue4)[4], (short)'4'); - Assert.Equal((*tValue4)[5], (short)'5'); - Assert.Equal((*tValue4)[6], (short)'6'); - Assert.Equal((*tValue4)[7], (short)'7'); - Assert.Equal((*tValue4)[8], (short)'8'); - Assert.Equal((*tValue4)[9], (short)'9'); - Assert.Equal((*tValue4)[10], (short)'A'); - Assert.Equal((*tValue4)[11], (short)'B'); - Assert.Equal((*tValue4)[12], (short)'C'); - Assert.Equal((*tValue4)[13], (short)'D'); - Assert.Equal((*tValue4)[14], (short)'E'); - Assert.Equal((*tValue4)[15], (short)'F'); + Assert.Equal((short)'0', (*tValue4)[0]); + Assert.Equal((short)'1', (*tValue4)[1]); + Assert.Equal((short)'2', (*tValue4)[2]); + Assert.Equal((short)'3', (*tValue4)[3]); + Assert.Equal((short)'4', (*tValue4)[4]); + Assert.Equal((short)'5', (*tValue4)[5]); + Assert.Equal((short)'6', (*tValue4)[6]); + Assert.Equal((short)'7', (*tValue4)[7]); + Assert.Equal((short)'8', (*tValue4)[8]); + Assert.Equal((short)'9', (*tValue4)[9]); + Assert.Equal((short)'A', (*tValue4)[10]); + Assert.Equal((short)'B', (*tValue4)[11]); + Assert.Equal((short)'C', (*tValue4)[12]); + Assert.Equal((short)'D', (*tValue4)[13]); + Assert.Equal((short)'E', (*tValue4)[14]); + Assert.Equal((short)'F', (*tValue4)[15]); Assert.Throws(() => GenericsNative.GetVectorC256Ref('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorD.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorD.cs index 40f7228d20d559..5d641eca27e7f9 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorD.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorD.cs @@ -63,9 +63,10 @@ unsafe partial class GenericsNative public static extern Vector AddVectorD256s(in Vector pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVectorD() + [Fact] + public static void TestVectorD() { if (Vector.Count == 4) { @@ -73,25 +74,26 @@ private static void TestVectorD() } else { - Assert.Equal(Vector.Count, 2); + Assert.Equal(2, Vector.Count); TestVectorD128(); } } - private static void TestVectorD128() + [Fact] + public static void TestVectorD128() { Assert.Throws(() => GenericsNative.GetVectorD128(1.0, 2.0)); Vector value2; GenericsNative.GetVectorD128Out(1.0, 2.0, &value2); - Assert.Equal(value2[0], 1.0); - Assert.Equal(value2[1], 2.0); + Assert.Equal(1.0, value2[0]); + Assert.Equal(2.0, value2[1]); Assert.Throws(() => GenericsNative.GetVectorD128Out(1.0, 2.0, out Vector value3)); Vector* value4 = GenericsNative.GetVectorD128Ptr(1.0, 2.0); - Assert.Equal((*value4)[0], 1.0); - Assert.Equal((*value4)[1], 2.0); + Assert.Equal(1.0, (*value4)[0]); + Assert.Equal(2.0, (*value4)[1]); Assert.Throws(() => GenericsNative.GetVectorD128Ref(1.0, 2.0)); @@ -117,24 +119,25 @@ private static void TestVectorD128() Assert.Throws(() => GenericsNative.AddVectorD128s(in values[0], values.Length)); } - private static void TestVectorD256() + [Fact] + public static void TestVectorD256() { Assert.Throws(() => GenericsNative.GetVectorD256(1.0, 2.0, 3.0, 4.0)); Vector value2; GenericsNative.GetVectorD256Out(1.0, 2.0, 3.0, 4.0, &value2); - Assert.Equal(value2[0], 1.0); - Assert.Equal(value2[1], 2.0); - Assert.Equal(value2[2], 3.0); - Assert.Equal(value2[3], 4.0); + Assert.Equal(1.0, value2[0]); + Assert.Equal(2.0, value2[1]); + Assert.Equal(3.0, value2[2]); + Assert.Equal(4.0, value2[3]); Assert.Throws(() => GenericsNative.GetVectorD256Out(1.0, 2.0, 3.0, 4.0, out Vector value3)); Vector* value4 = GenericsNative.GetVectorD256Ptr(1.0, 2.0, 3.0, 4.0); - Assert.Equal((*value4)[0], 1.0); - Assert.Equal((*value4)[1], 2.0); - Assert.Equal((*value4)[2], 3.0); - Assert.Equal((*value4)[3], 4.0); + Assert.Equal(1.0, (*value4)[0]); + Assert.Equal(2.0, (*value4)[1]); + Assert.Equal(3.0, (*value4)[2]); + Assert.Equal(4.0, (*value4)[3]); Assert.Throws(() => GenericsNative.GetVectorD256Ref(1.0, 2.0, 3.0, 4.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorF.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorF.cs index 2919f3cf49d7ad..904ce4443860a7 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorF.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorF.cs @@ -63,9 +63,10 @@ unsafe partial class GenericsNative public static extern Vector AddVectorF256s(in Vector pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVectorF() + [Fact] + public static void TestVectorF() { if (Vector.Count == 8) { @@ -73,29 +74,30 @@ private static void TestVectorF() } else { - Assert.Equal(Vector.Count, 4); + Assert.Equal(4, Vector.Count); TestVectorF128(); } } - private static void TestVectorF128() + [Fact] + public static void TestVectorF128() { Assert.Throws(() => GenericsNative.GetVectorF128(1.0f, 2.0f, 3.0f, 4.0f)); Vector value2; GenericsNative.GetVectorF128Out(1.0f, 2.0f, 3.0f, 4.0f, &value2); - Assert.Equal(value2[0], 1.0f); - Assert.Equal(value2[1], 2.0f); - Assert.Equal(value2[2], 3.0f); - Assert.Equal(value2[3], 4.0f); + Assert.Equal(1.0f, value2[0]); + Assert.Equal(2.0f, value2[1]); + Assert.Equal(3.0f, value2[2]); + Assert.Equal(4.0f, value2[3]); Assert.Throws(() => GenericsNative.GetVectorF128Out(1.0f, 2.0f, 3.0f, 4.0f, out Vector value3)); Vector* value4 = GenericsNative.GetVectorF128Ptr(1.0f, 2.0f, 3.0f, 4.0f); - Assert.Equal((*value4)[0], 1.0f); - Assert.Equal((*value4)[1], 2.0f); - Assert.Equal((*value4)[2], 3.0f); - Assert.Equal((*value4)[3], 4.0f); + Assert.Equal(1.0f, (*value4)[0]); + Assert.Equal(2.0f, (*value4)[1]); + Assert.Equal(3.0f, (*value4)[2]); + Assert.Equal(4.0f, (*value4)[3]); Assert.Throws(() => GenericsNative.GetVectorF128Ref(1.0f, 2.0f, 3.0f, 4.0f)); @@ -121,32 +123,33 @@ private static void TestVectorF128() Assert.Throws(() => GenericsNative.AddVectorF128s(in values[0], values.Length)); } - private static void TestVectorF256() + [Fact] + public static void TestVectorF256() { Assert.Throws(() => GenericsNative.GetVectorF256(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f)); Vector value2; GenericsNative.GetVectorF256Out(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, &value2); - Assert.Equal(value2[0], 1.0f); - Assert.Equal(value2[1], 2.0f); - Assert.Equal(value2[2], 3.0f); - Assert.Equal(value2[3], 4.0f); - Assert.Equal(value2[4], 5.0f); - Assert.Equal(value2[5], 6.0f); - Assert.Equal(value2[6], 7.0f); - Assert.Equal(value2[7], 8.0f); + Assert.Equal(1.0f, value2[0]); + Assert.Equal(2.0f, value2[1]); + Assert.Equal(3.0f, value2[2]); + Assert.Equal(4.0f, value2[3]); + Assert.Equal(5.0f, value2[4]); + Assert.Equal(6.0f, value2[5]); + Assert.Equal(7.0f, value2[6]); + Assert.Equal(8.0f, value2[7]); Assert.Throws(() => GenericsNative.GetVectorF256Out(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, out Vector value3)); Vector* value4 = GenericsNative.GetVectorF256Ptr(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f); - Assert.Equal((*value4)[0], 1.0f); - Assert.Equal((*value4)[1], 2.0f); - Assert.Equal((*value4)[2], 3.0f); - Assert.Equal((*value4)[3], 4.0f); - Assert.Equal((*value4)[4], 5.0f); - Assert.Equal((*value4)[5], 6.0f); - Assert.Equal((*value4)[6], 7.0f); - Assert.Equal((*value4)[7], 8.0f); + Assert.Equal(1.0f, (*value4)[0]); + Assert.Equal(2.0f, (*value4)[1]); + Assert.Equal(3.0f, (*value4)[2]); + Assert.Equal(4.0f, (*value4)[3]); + Assert.Equal(5.0f, (*value4)[4]); + Assert.Equal(6.0f, (*value4)[5]); + Assert.Equal(7.0f, (*value4)[6]); + Assert.Equal(8.0f, (*value4)[7]); Assert.Throws(() => GenericsNative.GetVectorF256Ref(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorL.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorL.cs index 69070238f54fad..d5a8cf4a9fc56e 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorL.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorL.cs @@ -63,9 +63,10 @@ unsafe partial class GenericsNative public static extern Vector AddVectorL256s(in Vector pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVectorL() + [Fact] + public static void TestVectorL() { if (Vector.Count == 4) { @@ -73,25 +74,26 @@ private static void TestVectorL() } else { - Assert.Equal(Vector.Count, 2); + Assert.Equal(2, Vector.Count); TestVectorL128(); } } - private static void TestVectorL128() + [Fact] + public static void TestVectorL128() { Assert.Throws(() => GenericsNative.GetVectorL128(1L, 2L)); Vector value2; GenericsNative.GetVectorL128Out(1L, 2L, &value2); - Assert.Equal(value2[0], 1L); - Assert.Equal(value2[1], 2L); + Assert.Equal(1L, value2[0]); + Assert.Equal(2L, value2[1]); Assert.Throws(() => GenericsNative.GetVectorL128Out(1L, 2L, out Vector value3)); Vector* value4 = GenericsNative.GetVectorL128Ptr(1L, 2L); - Assert.Equal((*value4)[0], 1L); - Assert.Equal((*value4)[1], 2L); + Assert.Equal(1L, (*value4)[0]); + Assert.Equal(2L, (*value4)[1]); Assert.Throws(() => GenericsNative.GetVectorL128Ref(1L, 2L)); @@ -117,24 +119,25 @@ private static void TestVectorL128() Assert.Throws(() => GenericsNative.AddVectorL128s(in values[0], values.Length)); } - private static void TestVectorL256() + [Fact] + public static void TestVectorL256() { Assert.Throws(() => GenericsNative.GetVectorL256(1L, 2L, 3L, 4L)); Vector value2; GenericsNative.GetVectorL256Out(1L, 2L, 3L, 4L, &value2); - Assert.Equal(value2[0], 1L); - Assert.Equal(value2[1], 2L); - Assert.Equal(value2[2], 3L); - Assert.Equal(value2[3], 4L); + Assert.Equal(1L, value2[0]); + Assert.Equal(2L, value2[1]); + Assert.Equal(3L, value2[2]); + Assert.Equal(4L, value2[3]); Assert.Throws(() => GenericsNative.GetVectorL256Out(1L, 2L, 3L, 4L, out Vector value3)); Vector* value4 = GenericsNative.GetVectorL256Ptr(1L, 2L, 3L, 4L); - Assert.Equal((*value4)[0], 1L); - Assert.Equal((*value4)[1], 2L); - Assert.Equal((*value4)[2], 3L); - Assert.Equal((*value4)[3], 4L); + Assert.Equal(1L, (*value4)[0]); + Assert.Equal(2L, (*value4)[1]); + Assert.Equal(3L, (*value4)[2]); + Assert.Equal(4L, (*value4)[3]); Assert.Throws(() => GenericsNative.GetVectorL256Ref(1L, 2L, 3L, 4L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorU.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorU.cs index 2bfc5d8578bdef..13d297b4d5f834 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorU.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorU.cs @@ -63,9 +63,10 @@ unsafe partial class GenericsNative public static extern Vector AddVectorU256s(in Vector pValues, int count); } -unsafe partial class GenericsTest +public unsafe partial class GenericsTest { - private static void TestVectorU() + [Fact] + public static void TestVectorU() { if (Vector.Count == 8) { @@ -73,29 +74,30 @@ private static void TestVectorU() } else { - Assert.Equal(Vector.Count, 4); + Assert.Equal(4, Vector.Count); TestVectorU128(); } } - private static void TestVectorU128() + [Fact] + public static void TestVectorU128() { Assert.Throws(() => GenericsNative.GetVectorU128(1u, 2u, 3u, 4u)); Vector value2; GenericsNative.GetVectorU128Out(1u, 2u, 3u, 4u, &value2); - Assert.Equal(value2[0], 1u); - Assert.Equal(value2[1], 2u); - Assert.Equal(value2[2], 3u); - Assert.Equal(value2[3], 4u); + Assert.Equal(1u, value2[0]); + Assert.Equal(2u, value2[1]); + Assert.Equal(3u, value2[2]); + Assert.Equal(4u, value2[3]); Assert.Throws(() => GenericsNative.GetVectorU128Out(1u, 2u, 3u, 4u, out Vector value3)); Vector* value4 = GenericsNative.GetVectorU128Ptr(1u, 2u, 3u, 4u); - Assert.Equal((*value4)[0], 1u); - Assert.Equal((*value4)[1], 2u); - Assert.Equal((*value4)[2], 3u); - Assert.Equal((*value4)[3], 4u); + Assert.Equal(1u, (*value4)[0]); + Assert.Equal(2u, (*value4)[1]); + Assert.Equal(3u, (*value4)[2]); + Assert.Equal(4u, (*value4)[3]); Assert.Throws(() => GenericsNative.GetVectorU128Ref(1u, 2u, 3u, 4u)); @@ -121,32 +123,33 @@ private static void TestVectorU128() Assert.Throws(() => GenericsNative.AddVectorU128s(in values[0], values.Length)); } - private static void TestVectorU256() + [Fact] + public static void TestVectorU256() { Assert.Throws(() => GenericsNative.GetVectorU256(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u)); Vector value2; GenericsNative.GetVectorU256Out(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, &value2); - Assert.Equal(value2[0], 1u); - Assert.Equal(value2[1], 2u); - Assert.Equal(value2[2], 3u); - Assert.Equal(value2[3], 4u); - Assert.Equal(value2[4], 5u); - Assert.Equal(value2[5], 6u); - Assert.Equal(value2[6], 7u); - Assert.Equal(value2[7], 8u); + Assert.Equal(1u, value2[0]); + Assert.Equal(2u, value2[1]); + Assert.Equal(3u, value2[2]); + Assert.Equal(4u, value2[3]); + Assert.Equal(5u, value2[4]); + Assert.Equal(6u, value2[5]); + Assert.Equal(7u, value2[6]); + Assert.Equal(8u, value2[7]); Assert.Throws(() => GenericsNative.GetVectorU256Out(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, out Vector value3)); Vector* value4 = GenericsNative.GetVectorU256Ptr(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u); - Assert.Equal((*value4)[0], 1u); - Assert.Equal((*value4)[1], 2u); - Assert.Equal((*value4)[2], 3u); - Assert.Equal((*value4)[3], 4u); - Assert.Equal((*value4)[4], 5u); - Assert.Equal((*value4)[5], 6u); - Assert.Equal((*value4)[6], 7u); - Assert.Equal((*value4)[7], 8u); + Assert.Equal(1u, (*value4)[0]); + Assert.Equal(2u, (*value4)[1]); + Assert.Equal(3u, (*value4)[2]); + Assert.Equal(4u, (*value4)[3]); + Assert.Equal(5u, (*value4)[4]); + Assert.Equal(6u, (*value4)[5]); + Assert.Equal(7u, (*value4)[6]); + Assert.Equal(8u, (*value4)[7]); Assert.Throws(() => GenericsNative.GetVectorU256Ref(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.cs index c2502d8c447ea9..d169741aae241f 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.cs @@ -45,200 +45,7 @@ public class SequentialClass where T : struct } } -public unsafe partial class GenericsTest +[SkipOnMono("needs triage")] +public partial class GenericsTest { - [Fact] - public static int TestEntryPoint() - { - try - { - Console.WriteLine("Testing IComInterface"); - TestIComInterfaceB(); - Console.WriteLine("Testing IComInterface"); - TestIComInterfaceC(); - Console.WriteLine("Testing IComInterface"); - TestIComInterfaceD(); - Console.WriteLine("Testing IComInterface"); - TestIComInterfaceF(); - Console.WriteLine("Testing IComInterface"); - TestIComInterfaceL(); - Console.WriteLine("Testing IComInterface"); - TestIComInterfaceU(); - Console.WriteLine(); - - Console.WriteLine("Testing Nullable"); - TestNullableB(); - Console.WriteLine("Testing Nullable"); - TestNullableC(); - Console.WriteLine("Testing Nullable"); - TestNullableD(); - Console.WriteLine("Testing Nullable"); - TestNullableF(); - Console.WriteLine("Testing Nullable"); - TestNullableL(); - Console.WriteLine("Testing Nullable"); - TestNullableU(); - Console.WriteLine(); - - Console.WriteLine("Testing Point1"); - TestPoint1B(); - Console.WriteLine("Testing Point1"); - TestPoint1C(); - Console.WriteLine("Testing Point1"); - TestPoint1D(); - Console.WriteLine("Testing Point1"); - TestPoint1F(); - Console.WriteLine("Testing Point1"); - TestPoint1L(); - Console.WriteLine("Testing Point1"); - TestPoint1U(); - Console.WriteLine(); - - Console.WriteLine("Testing Point2"); - TestPoint2B(); - Console.WriteLine("Testing Point2"); - TestPoint2C(); - Console.WriteLine("Testing Point2"); - TestPoint2D(); - Console.WriteLine("Testing Point2"); - TestPoint2F(); - Console.WriteLine("Testing Point2"); - TestPoint2L(); - Console.WriteLine("Testing Point2"); - TestPoint2U(); - Console.WriteLine(); - - Console.WriteLine("Testing Point3"); - TestPoint3B(); - Console.WriteLine("Testing Point3"); - TestPoint3C(); - Console.WriteLine("Testing Point3"); - TestPoint3D(); - Console.WriteLine("Testing Point3"); - TestPoint3F(); - Console.WriteLine("Testing Point3"); - TestPoint3L(); - Console.WriteLine("Testing Point3"); - TestPoint3U(); - Console.WriteLine(); - - Console.WriteLine("Testing Point4"); - TestPoint4B(); - Console.WriteLine("Testing Point4"); - TestPoint4C(); - Console.WriteLine("Testing Point4"); - TestPoint4D(); - Console.WriteLine("Testing Point4"); - TestPoint4F(); - Console.WriteLine("Testing Point4"); - TestPoint4L(); - Console.WriteLine("Testing Point4"); - TestPoint4U(); - Console.WriteLine(); - - Console.WriteLine("Testing ReadOnlySpan"); - TestReadOnlySpanB(); - Console.WriteLine("Testing ReadOnlySpan"); - TestReadOnlySpanC(); - Console.WriteLine("Testing ReadOnlySpan"); - TestReadOnlySpanD(); - Console.WriteLine("Testing ReadOnlySpan"); - TestReadOnlySpanF(); - Console.WriteLine("Testing ReadOnlySpan"); - TestReadOnlySpanL(); - Console.WriteLine("Testing ReadOnlySpan"); - TestReadOnlySpanU(); - Console.WriteLine(); - - Console.WriteLine("Testing SequentialClass"); - TestSequentialClassB(); - Console.WriteLine("Testing SequentialClass"); - TestSequentialClassC(); - Console.WriteLine("Testing SequentialClass"); - TestSequentialClassD(); - Console.WriteLine("Testing SequentialClass"); - TestSequentialClassF(); - Console.WriteLine("Testing SequentialClass"); - TestSequentialClassL(); - Console.WriteLine("Testing SequentialClass"); - TestSequentialClassU(); - Console.WriteLine(); - - Console.WriteLine("Testing Span"); - TestSpanB(); - Console.WriteLine("Testing Span"); - TestSpanC(); - Console.WriteLine("Testing Span"); - TestSpanD(); - Console.WriteLine("Testing Span"); - TestSpanF(); - Console.WriteLine("Testing Span"); - TestSpanL(); - Console.WriteLine("Testing Span"); - TestSpanU(); - Console.WriteLine(); - - Console.WriteLine("Testing Vector64"); - TestVector64B(); - Console.WriteLine("Testing Vector64"); - TestVector64C(); - Console.WriteLine("Testing Vector64"); - TestVector64D(); - Console.WriteLine("Testing Vector64"); - TestVector64F(); - Console.WriteLine("Testing Vector64"); - TestVector64L(); - Console.WriteLine("Testing Vector64"); - TestVector64U(); - Console.WriteLine(); - - Console.WriteLine("Testing Vector128"); - TestVector128B(); - Console.WriteLine("Testing Vector128"); - TestVector128C(); - Console.WriteLine("Testing Vector128"); - TestVector128D(); - Console.WriteLine("Testing Vector128"); - TestVector128F(); - Console.WriteLine("Testing Vector128"); - TestVector128L(); - Console.WriteLine("Testing Vector128"); - TestVector128U(); - Console.WriteLine(); - - Console.WriteLine("Testing Vector256"); - TestVector256B(); - Console.WriteLine("Testing Vector256"); - TestVector256C(); - Console.WriteLine("Testing Vector256"); - TestVector256D(); - Console.WriteLine("Testing Vector256"); - TestVector256F(); - Console.WriteLine("Testing Vector256"); - TestVector256L(); - Console.WriteLine("Testing Vector256"); - TestVector256U(); - Console.WriteLine(); - - Console.WriteLine("Testing Vector"); - TestVectorB(); - Console.WriteLine("Testing Vector"); - TestVectorC(); - Console.WriteLine("Testing Vector"); - TestVectorD(); - Console.WriteLine("Testing Vector"); - TestVectorF(); - Console.WriteLine("Testing Vector"); - TestVectorL(); - Console.WriteLine("Testing Vector"); - TestVectorU(); - Console.WriteLine(); - } - catch (System.Exception ex) - { - Console.WriteLine(ex); - return 0; - } - return 100; - } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.csproj b/src/tests/Interop/PInvoke/Generics/GenericsTest.csproj index fa74de71fc97f3..52ade9d2fd9bb5 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.csproj +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.csproj @@ -2,7 +2,6 @@ true - $(NoWarn);xUnit2000 From c603638f079dfb02ea0400cfbc4b3883564dbee0 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Fri, 27 Oct 2023 12:57:39 -0700 Subject: [PATCH 07/19] Move most of Interop/PInvoke in-assembly to reduce the number of assemblies we build. Also convert more of the tests to be more xunit-like. --- src/tests/Interop/Interop.csproj | 27 ++++++++++++-- .../AsByValArray/AsByValArrayTest.cs | 2 + .../AsByValArray/AsByValArrayTest.csproj | 8 ---- .../AsByValArray/FldDef_DefaultArray.cs | 1 + .../AsLPArray/AsLPArrayTest.cs | 1 + .../AsLPArray/AsLPArrayTest.csproj | 8 ---- .../AsLPArray/FldDef_LPArray.cs | 2 + .../AsDefault/AsDefaultTest.cs | 2 + .../AsDefault/AsDefaultTest.csproj | 8 ---- .../AsLPArray/AsLPArrayTest.cs | 2 + .../AsLPArray/ParamAsLPArrayTest.csproj | 8 ---- .../ArrayWithOffsetTest.csproj | 11 ------ .../Interop/PInvoke/AsAny/AsAnyTest.csproj | 8 ---- .../PInvoke/Attributes/LCID/LCIDTest.csproj | 8 ---- .../CustomMarshalersTest.csproj | 11 ------ .../Interop/PInvoke/Decimal/DecimalTest.cs | 1 + .../PInvoke/Decimal/DecimalTest.csproj | 11 ------ .../Interop/PInvoke/Delegate/DelegateTest.cs | 26 ++----------- .../PInvoke/Delegate/DelegateTest.csproj | 8 ---- .../PInvoke/Delegate/DelegateTestNative.cs | 2 +- .../PInvoke/Generics/GenericsTest.csproj | 12 ------ .../PInvoke/IEnumerator/IEnumeratorTest.cs | 6 +-- .../IEnumerator/IEnumeratorTest.csproj | 11 ------ .../Interop/PInvoke/Int128/Int128Test.cs | 6 ++- .../Interop/PInvoke/Int128/Int128Test.csproj | 15 -------- .../Int128/Int128TestFieldLayout.csproj | 14 ------- src/tests/Interop/PInvoke/Int128/Program.cs | 28 -------------- .../PInvoke/Int128/ProgramFieldLayout.cs | 25 ------------- .../Interop/PInvoke/Int128/UInt128Test.cs | 3 +- .../Miscellaneous/CopyCtor/CopyCtorTest.cs | 6 ++- .../CopyCtor/CopyCtorTest.csproj | 11 ------ .../Miscellaneous/CopyCtor/CopyCtorUtil.il | 26 ++++++------- .../HandleRef/HandleRefTest.csproj | 13 ------- .../MAWSPITest.csproj | 10 ----- .../Primitives/Int/PInvokeIntTest.csproj | 8 ---- .../Pointer/NonBlittablePointer.csproj | 12 ------ .../RuntimeHandles/RuntimeHandlesTest.cs | 15 ++++---- .../RuntimeHandles/RuntimeHandlesTest.csproj | 8 ---- .../InvalidSafeHandleMarshallingTests.cs | 1 + .../Interop/PInvoke/SafeHandles/Program.cs | 37 ------------------- .../SafeHandles/ReliableUnmarshalTest.cs | 1 + .../SafeHandles/SafeHandleLifetimeTests.cs | 2 + .../PInvoke/SafeHandles/SafeHandleTests.cs | 2 + .../SafeHandles/SafeHandleTests.csproj | 8 ---- .../SetLastError/SetLastErrorTest.csproj | 9 ----- .../PInvoke/Invalid/InvalidParamIndex.csproj | 5 --- .../PInvoke/PassingByOut/PassingByOutTest.cs | 3 +- .../PassingByOut/PassingByOutTest.csproj | 9 ----- .../PInvoke/PassingByRef/PassingByRefTest.cs | 4 +- .../PassingByRef/PassingByRefTest.csproj | 9 ----- .../PInvoke/SizeParamIndex/PInvoke/helper.cs | 2 + .../PassingByOut/PassingByOutTest.cs | 3 +- .../ReversePassingByOutTest.csproj | 9 ----- .../PassingByRef/PassingByRefTest.cs | 3 +- .../ReversePassingByRefTest.csproj | 9 ----- .../SizeParamIndex/ReversePInvoke/helper.cs | 2 + .../PInvoke/Varargs/VarargsTest.csproj | 12 ------ .../PInvoke/Vector2_3_4/Vector2_3_4.csproj | 8 ---- 58 files changed, 93 insertions(+), 429 deletions(-) delete mode 100644 src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.csproj delete mode 100644 src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.csproj delete mode 100644 src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.csproj delete mode 100644 src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/ParamAsLPArrayTest.csproj delete mode 100644 src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.csproj delete mode 100644 src/tests/Interop/PInvoke/AsAny/AsAnyTest.csproj delete mode 100644 src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.csproj delete mode 100644 src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.csproj delete mode 100644 src/tests/Interop/PInvoke/Decimal/DecimalTest.csproj delete mode 100644 src/tests/Interop/PInvoke/Delegate/DelegateTest.csproj delete mode 100644 src/tests/Interop/PInvoke/Generics/GenericsTest.csproj delete mode 100644 src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.csproj delete mode 100644 src/tests/Interop/PInvoke/Int128/Int128Test.csproj delete mode 100644 src/tests/Interop/PInvoke/Int128/Int128TestFieldLayout.csproj delete mode 100644 src/tests/Interop/PInvoke/Int128/Program.cs delete mode 100644 src/tests/Interop/PInvoke/Int128/ProgramFieldLayout.cs delete mode 100644 src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.csproj delete mode 100644 src/tests/Interop/PInvoke/Miscellaneous/HandleRef/HandleRefTest.csproj delete mode 100644 src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/MAWSPITest.csproj delete mode 100644 src/tests/Interop/PInvoke/Primitives/Int/PInvokeIntTest.csproj delete mode 100644 src/tests/Interop/PInvoke/Primitives/Pointer/NonBlittablePointer.csproj delete mode 100644 src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.csproj delete mode 100644 src/tests/Interop/PInvoke/SafeHandles/Program.cs delete mode 100644 src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.csproj delete mode 100644 src/tests/Interop/PInvoke/SetLastError/SetLastErrorTest.csproj delete mode 100644 src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.csproj delete mode 100644 src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.csproj delete mode 100644 src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.csproj delete mode 100644 src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/ReversePassingByOutTest.csproj delete mode 100644 src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/ReversePassingByRefTest.csproj delete mode 100644 src/tests/Interop/PInvoke/Varargs/VarargsTest.csproj delete mode 100644 src/tests/Interop/PInvoke/Vector2_3_4/Vector2_3_4.csproj diff --git a/src/tests/Interop/Interop.csproj b/src/tests/Interop/Interop.csproj index b6d5ee1f8b91f7..250fdcbdd15239 100644 --- a/src/tests/Interop/Interop.csproj +++ b/src/tests/Interop/Interop.csproj @@ -3,7 +3,12 @@ true - + + + + + @@ -16,6 +21,23 @@ + + + + + + + + + + + + + + + + + @@ -23,12 +45,11 @@ + - - diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.cs b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.cs index 8d471ca06565a9..d64e6570f117c0 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.cs +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.cs @@ -5,6 +5,8 @@ using System.Runtime.InteropServices; using Xunit; +namespace MarshalArrayAsField.ByValArray; + #region Sequential #region sequential struct definition [StructLayout(LayoutKind.Sequential)] diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.csproj b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.csproj deleted file mode 100644 index c250b2f8bb1822..00000000000000 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/FldDef_DefaultArray.cs b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/FldDef_DefaultArray.cs index 15f0130f447bc4..6e3fa60a8a7e55 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/FldDef_DefaultArray.cs +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/FldDef_DefaultArray.cs @@ -4,6 +4,7 @@ using System; using System.Runtime.InteropServices; +namespace MarshalArrayAsField.ByValArray; #pragma warning disable 618 #region Struct Definition diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs index a661d6541cddb2..fab355ba2d4fa2 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs @@ -5,6 +5,7 @@ using System.Runtime.InteropServices; using Xunit; +namespace MarshalArrayAsField.LPArray; public class Test { [DllImport("MarshalArrayByValArrayNative", CallingConvention = CallingConvention.Cdecl)] diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.csproj b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.csproj deleted file mode 100644 index c250b2f8bb1822..00000000000000 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/FldDef_LPArray.cs b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/FldDef_LPArray.cs index 2b844dea5d8f8e..c78d11266b8204 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/FldDef_LPArray.cs +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/FldDef_LPArray.cs @@ -4,6 +4,8 @@ using System; using System.Runtime.InteropServices; +namespace MarshalArrayAsField.LPArray; + #region Sequential #region sequential struct definition [StructLayout(LayoutKind.Sequential)] diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs index 81ef77e8f5f519..9a19e64fe7f67b 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs @@ -5,6 +5,8 @@ using System.Runtime.InteropServices; using Xunit; +namespace MarshalArrayAsParam.Default; + public class ArrayMarshal { public struct TestStruct diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.csproj b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.csproj deleted file mode 100644 index c250b2f8bb1822..00000000000000 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs index ad090128388f84..33a1e2bc4bf5dd 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs @@ -6,6 +6,8 @@ using TestLibrary; using Xunit; +namespace MarshalArrayAsParam.LPArray; + public class ArrayMarshal { private static int NumArrOfStructElements1 = 10; diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/ParamAsLPArrayTest.csproj b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/ParamAsLPArrayTest.csproj deleted file mode 100644 index c250b2f8bb1822..00000000000000 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/ParamAsLPArrayTest.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.csproj b/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.csproj deleted file mode 100644 index eff1d00c75351d..00000000000000 --- a/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/AsAny/AsAnyTest.csproj b/src/tests/Interop/PInvoke/AsAny/AsAnyTest.csproj deleted file mode 100644 index 2cdc971285f649..00000000000000 --- a/src/tests/Interop/PInvoke/AsAny/AsAnyTest.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.csproj b/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.csproj deleted file mode 100644 index 21e1b2cac1a75c..00000000000000 --- a/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.csproj b/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.csproj deleted file mode 100644 index eff1d00c75351d..00000000000000 --- a/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/Decimal/DecimalTest.cs b/src/tests/Interop/PInvoke/Decimal/DecimalTest.cs index 40afd032ab1b67..2bbc975212f7a5 100644 --- a/src/tests/Interop/PInvoke/Decimal/DecimalTest.cs +++ b/src/tests/Interop/PInvoke/Decimal/DecimalTest.cs @@ -39,6 +39,7 @@ public static void RunDecimalTests() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/175", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void RunLPDecimalTests() { Assert.Equal((decimal)StartingIntValue, DecimalTestNative.CreateLPDecimalFromInt(StartingIntValue)); diff --git a/src/tests/Interop/PInvoke/Decimal/DecimalTest.csproj b/src/tests/Interop/PInvoke/Decimal/DecimalTest.csproj deleted file mode 100644 index c1617788bf4cd3..00000000000000 --- a/src/tests/Interop/PInvoke/Decimal/DecimalTest.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/Delegate/DelegateTest.cs b/src/tests/Interop/PInvoke/Delegate/DelegateTest.cs index df507d23cb5fea..ba31cb3cab7ae9 100644 --- a/src/tests/Interop/PInvoke/Delegate/DelegateTest.cs +++ b/src/tests/Interop/PInvoke/Delegate/DelegateTest.cs @@ -5,12 +5,12 @@ using System.Text; using System.Runtime.InteropServices; using Xunit; - using static DelegateTestNative; public class DelegateTest { - private static void TestFunctionPointer() + [Fact] + public static void TestFunctionPointer() { int expectedValue = 987654; int TestFunction() => expectedValue; @@ -60,7 +60,8 @@ private static void TestFunctionPointer() } } - private static void TestIDispatch() + [ConditionalFact(typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.IsBuiltInComEnabled))] + public static void TestIDispatch() { int expectedValue = 987654; int TestFunction() => expectedValue; @@ -118,23 +119,4 @@ private static void TestIDispatch() Assert.Throws(() => MarshalDelegateAsInterface(TestFunction)); } - - [Fact] - public static int TestEntryPoint() - { - try - { - TestFunctionPointer(); - if (OperatingSystem.IsWindows()) - { - TestIDispatch(); - } - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - return 100; - } } diff --git a/src/tests/Interop/PInvoke/Delegate/DelegateTest.csproj b/src/tests/Interop/PInvoke/Delegate/DelegateTest.csproj deleted file mode 100644 index 2cdc971285f649..00000000000000 --- a/src/tests/Interop/PInvoke/Delegate/DelegateTest.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/tests/Interop/PInvoke/Delegate/DelegateTestNative.cs b/src/tests/Interop/PInvoke/Delegate/DelegateTestNative.cs index 8aed37a08efb9d..a9984d53b4ad03 100644 --- a/src/tests/Interop/PInvoke/Delegate/DelegateTestNative.cs +++ b/src/tests/Interop/PInvoke/Delegate/DelegateTestNative.cs @@ -18,7 +18,7 @@ public struct DispatchDelegateWithExpectedValue { public int expectedValue; [MarshalAs(UnmanagedType.IDispatch)] - + public TestDelegate del; } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.csproj b/src/tests/Interop/PInvoke/Generics/GenericsTest.csproj deleted file mode 100644 index 52ade9d2fd9bb5..00000000000000 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs b/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs index 531a9ef63da23f..2129b7b7eaf899 100644 --- a/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs +++ b/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; +using TestLibrary; using Xunit; namespace PInvokeTests @@ -38,10 +39,7 @@ public static extern void VerifyIntegerEnumeration( public static extern IEnumerator PassThroughEnumerator(IEnumerator enumerator); } - [PlatformSpecific(TestPlatforms.Windows)] - [SkipOnMono("Requires COM support")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/37237", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsGCStress))] - [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltInComEnabled))] public static class IEnumeratorTests { [Fact] diff --git a/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.csproj b/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.csproj deleted file mode 100644 index eff1d00c75351d..00000000000000 --- a/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/Int128/Int128Test.cs b/src/tests/Interop/PInvoke/Int128/Int128Test.cs index f911232dd04697..46123ef00e31f8 100644 --- a/src/tests/Interop/PInvoke/Int128/Int128Test.cs +++ b/src/tests/Interop/PInvoke/Int128/Int128Test.cs @@ -99,8 +99,9 @@ unsafe partial class Int128Native public static extern Int128 AddInt128s(in Int128 pValues, int count); } -unsafe partial class Int128Native +public unsafe partial class Int128Native { + [Fact] public static void TestInt128FieldLayout() { // This test checks that the alignment rules of Int128 structs match the native compiler @@ -133,7 +134,8 @@ public static void TestInt128FieldLayout() Assert.Throws(() => GetInt128Lower_S(default(StructJustInt128))); } - private static void TestInt128() + [Fact] + public static void TestInt128() { Int128 value1 = Int128Native.GetInt128(1, 2); Assert.Equal(new Int128(1, 2), value1); diff --git a/src/tests/Interop/PInvoke/Int128/Int128Test.csproj b/src/tests/Interop/PInvoke/Int128/Int128Test.csproj deleted file mode 100644 index f3ad7390614c2b..00000000000000 --- a/src/tests/Interop/PInvoke/Int128/Int128Test.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - true - embedded - - - - - - - - - - diff --git a/src/tests/Interop/PInvoke/Int128/Int128TestFieldLayout.csproj b/src/tests/Interop/PInvoke/Int128/Int128TestFieldLayout.csproj deleted file mode 100644 index 659b364d133a83..00000000000000 --- a/src/tests/Interop/PInvoke/Int128/Int128TestFieldLayout.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - true - embedded - - - - - - - - - diff --git a/src/tests/Interop/PInvoke/Int128/Program.cs b/src/tests/Interop/PInvoke/Int128/Program.cs deleted file mode 100644 index 27857c547e79f9..00000000000000 --- a/src/tests/Interop/PInvoke/Int128/Program.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -public unsafe partial class Int128Native -{ - [Fact] - public static int TestEntryPoint() - { - try - { - Console.WriteLine("Testing Int128"); - TestInt128(); - - Console.WriteLine("Testing UInt128"); - TestUInt128(); - } - catch (System.Exception ex) - { - Console.WriteLine(ex); - return 0; - } - return 100; - } -} diff --git a/src/tests/Interop/PInvoke/Int128/ProgramFieldLayout.cs b/src/tests/Interop/PInvoke/Int128/ProgramFieldLayout.cs deleted file mode 100644 index 6de35ef54abf06..00000000000000 --- a/src/tests/Interop/PInvoke/Int128/ProgramFieldLayout.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; -using Xunit; - -public unsafe partial class Int128NativeFieldLayout -{ - [Fact] - public static int TestEntryPoint() - { - try - { - Console.WriteLine("Testing Int128"); - Int128Native.TestInt128FieldLayout(); - } - catch (System.Exception ex) - { - Console.WriteLine(ex); - return 0; - } - return 100; - } -} diff --git a/src/tests/Interop/PInvoke/Int128/UInt128Test.cs b/src/tests/Interop/PInvoke/Int128/UInt128Test.cs index 6398a77ea57907..1b3af752e7fb83 100644 --- a/src/tests/Interop/PInvoke/Int128/UInt128Test.cs +++ b/src/tests/Interop/PInvoke/Int128/UInt128Test.cs @@ -37,7 +37,8 @@ unsafe partial class Int128Native unsafe partial class Int128Native { - private static void TestUInt128() + [Fact] + public static void TestUInt128() { UInt128 value1 = Int128Native.GetUInt128(1, 2); Assert.Equal(new UInt128(1, 2), value1); diff --git a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs index f5b3feff4b6c63..8a3c0b7ba0f98a 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs +++ b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs @@ -8,6 +8,8 @@ using System.Runtime.InteropServices; using Xunit; +namespace Miscellaneous; + public static unsafe class CopyCtor { public static unsafe int StructWithCtorTest(StructWithCtor* ptrStruct, ref StructWithCtor refStruct) @@ -27,9 +29,11 @@ public static unsafe int StructWithCtorTest(StructWithCtor* ptrStruct, ref Struc } [Fact] + [SkipOnMono("Not supported on Mono")] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static unsafe void ValidateCopyConstructorAndDestructorCalled() { - TestDelegate del = (TestDelegate)Delegate.CreateDelegate(typeof(TestDelegate), typeof(CopyCtor).GetMethod("StructWithCtorTest")); + CopyCtorUtil.TestDelegate del = (CopyCtorUtil.TestDelegate)Delegate.CreateDelegate(typeof(CopyCtorUtil.TestDelegate), typeof(CopyCtor).GetMethod("StructWithCtorTest")); StructWithCtor s1 = new StructWithCtor(); StructWithCtor s2 = new StructWithCtor(); s1._instanceField = 1; diff --git a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.csproj b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.csproj deleted file mode 100644 index 1324109b83119e..00000000000000 --- a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - True - - - - - - - - diff --git a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorUtil.il b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorUtil.il index 495bcf7d34a95f..ce4819fc06124f 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorUtil.il +++ b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorUtil.il @@ -5,38 +5,38 @@ .assembly extern System.Runtime.CompilerServices.VisualC { } .assembly CopyCtorUtil { } -.class auto ansi sealed public TestDelegate +.class auto ansi sealed public CopyCtorUtil.TestDelegate extends [mscorlib]System.MulticastDelegate { - .custom instance void [mscorlib]System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.CallingConvention) = ( 01 00 03 00 00 00 00 00 ) - .method public hidebysig specialname rtspecialname + .custom instance void [mscorlib]System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.CallingConvention) = ( 01 00 03 00 00 00 00 00 ) + .method public hidebysig specialname rtspecialname instance void .ctor(object 'object', native int 'method') runtime managed { - } // end of method TestDelegate::.ctor + } // end of method CopyCtorUtil.TestDelegate::.ctor - .method public hidebysig newslot virtual + .method public hidebysig newslot virtual instance int32 Invoke(valuetype [CopyCtorUtil]StructWithCtor modreq([mscorlib]System.Runtime.CompilerServices.IsCopyConstructed)* ptrStruct, valuetype [CopyCtorUtil]StructWithCtor modreq([mscorlib]System.Runtime.CompilerServices.IsCopyConstructed)& refStruct) runtime managed { - } // end of method TestDelegate::Invoke + } // end of method CopyCtorUtil.TestDelegate::Invoke - .method public hidebysig newslot virtual - instance class [mscorlib]System.IAsyncResult + .method public hidebysig newslot virtual + instance class [mscorlib]System.IAsyncResult BeginInvoke(valuetype [CopyCtorUtil]StructWithCtor modreq([mscorlib]System.Runtime.CompilerServices.IsCopyConstructed)* ptrStruct, valuetype [CopyCtorUtil]StructWithCtor modreq([mscorlib]System.Runtime.CompilerServices.IsCopyConstructed)& refStruct, class [mscorlib]System.AsyncCallback callback, object 'object') runtime managed { - } // end of method TestDelegate::BeginInvoke + } // end of method CopyCtorUtil.TestDelegate::BeginInvoke - .method public hidebysig newslot virtual + .method public hidebysig newslot virtual instance int32 EndInvoke(valuetype [CopyCtorUtil]StructWithCtor modreq([mscorlib]System.Runtime.CompilerServices.IsCopyConstructed)& refStruct, class [mscorlib]System.IAsyncResult result) runtime managed { - } // end of method TestDelegate::EndInvoke + } // end of method CopyCtorUtil.TestDelegate::EndInvoke -} // end of class TestDelegate +} // end of classCopyCtorUtil. TestDelegate .class public sealed sequential ansi beforefieldinit StructWithCtor extends [mscorlib]System.ValueType @@ -73,7 +73,7 @@ .class public auto ansi beforefieldinit FunctionPointer extends [mscorlib]System.Object { - .method hidebysig specialname rtspecialname + .method hidebysig specialname rtspecialname instance void .ctor() cil managed { ldarg.0 diff --git a/src/tests/Interop/PInvoke/Miscellaneous/HandleRef/HandleRefTest.csproj b/src/tests/Interop/PInvoke/Miscellaneous/HandleRef/HandleRefTest.csproj deleted file mode 100644 index d9a2574d9520a7..00000000000000 --- a/src/tests/Interop/PInvoke/Miscellaneous/HandleRef/HandleRefTest.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - true - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/MAWSPITest.csproj b/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/MAWSPITest.csproj deleted file mode 100644 index 55fb397907d01d..00000000000000 --- a/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/MAWSPITest.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/tests/Interop/PInvoke/Primitives/Int/PInvokeIntTest.csproj b/src/tests/Interop/PInvoke/Primitives/Int/PInvokeIntTest.csproj deleted file mode 100644 index 5bf46810eb6de7..00000000000000 --- a/src/tests/Interop/PInvoke/Primitives/Int/PInvokeIntTest.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/tests/Interop/PInvoke/Primitives/Pointer/NonBlittablePointer.csproj b/src/tests/Interop/PInvoke/Primitives/Pointer/NonBlittablePointer.csproj deleted file mode 100644 index a2b72af406a968..00000000000000 --- a/src/tests/Interop/PInvoke/Primitives/Pointer/NonBlittablePointer.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.cs b/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.cs index 4d6d96f79d77b0..fec823c81f9d8f 100644 --- a/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.cs +++ b/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.cs @@ -6,17 +6,18 @@ using System.Reflection; using Xunit; -class TestClass -{ - public int field; - public void Method() +public class RuntimeHandlesTest +{ + class TestClass { + public int field; + + public void Method() + { + } } -} -public class RuntimeHandlesTest -{ [DllImport("RuntimeHandlesNative")] private static extern bool Marshal_In(RuntimeMethodHandle expected, IntPtr handle); [DllImport("RuntimeHandlesNative")] diff --git a/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.csproj b/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.csproj deleted file mode 100644 index bf386f2ede0aa2..00000000000000 --- a/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs b/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs index a0478363f057af..fe678d93ceb76f 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs @@ -10,6 +10,7 @@ namespace SafeHandleTests { public class InvalidSafeHandleMarshallingTests { + [Fact] public static void RunTest() { if (TestLibrary.Utilities.IsWindows) diff --git a/src/tests/Interop/PInvoke/SafeHandles/Program.cs b/src/tests/Interop/PInvoke/SafeHandles/Program.cs deleted file mode 100644 index e017fd612e2d52..00000000000000 --- a/src/tests/Interop/PInvoke/SafeHandles/Program.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; -using System.Text; -using System.Collections.Generic; -using Xunit; - -namespace SafeHandleTests -{ - public class Test - { - [Fact] - public static int TestEntryPoint() - { - try - { - Console.WriteLine("Running SafeHandleTest tests"); - SafeHandleTest.RunTest(); - Console.WriteLine("Running ReliableUnmarshal test"); - ReliableUnmarshalTest.RunTest(); - Console.WriteLine("Running InvalidSafeHandleMarshalling tests"); - InvalidSafeHandleMarshallingTests.RunTest(); - Console.WriteLine("Running SafeHandleLifetime tests"); - SafeHandleLifetimeTests.RunTest(); - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); - return 101; - } - - return 100; - } - } -} diff --git a/src/tests/Interop/PInvoke/SafeHandles/ReliableUnmarshalTest.cs b/src/tests/Interop/PInvoke/SafeHandles/ReliableUnmarshalTest.cs index d2ee3a3b21f8ef..40d120036c51e7 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/ReliableUnmarshalTest.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/ReliableUnmarshalTest.cs @@ -10,6 +10,7 @@ namespace SafeHandleTests { public class ReliableUnmarshalTest { + [Fact] public static void RunTest() { // Test that our SafeHandle-derived object has its underlying handle set after a P/Invoke diff --git a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs index 0295671dea6c57..583bf7940e0eb4 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs @@ -12,6 +12,8 @@ public class SafeHandleLifetimeTests { private static readonly IntPtr initialValue = new IntPtr(458613); private static readonly IntPtr newValue = new IntPtr(987185); + + [Fact] public static void RunTest() { var testHandle = new TestSafeHandle(initialValue); diff --git a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs index b0b3aaa88b8419..70669521dd8b8f 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs @@ -12,6 +12,8 @@ public class SafeHandleTest { private static readonly IntPtr initialValue = new IntPtr(458613); private static readonly IntPtr newValue = new IntPtr(987185); + + [Fact] public static void RunTest() { var testHandle = new TestSafeHandle(initialValue); diff --git a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.csproj b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.csproj deleted file mode 100644 index 2cdc971285f649..00000000000000 --- a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/tests/Interop/PInvoke/SetLastError/SetLastErrorTest.csproj b/src/tests/Interop/PInvoke/SetLastError/SetLastErrorTest.csproj deleted file mode 100644 index 3136cccdfb5e23..00000000000000 --- a/src/tests/Interop/PInvoke/SetLastError/SetLastErrorTest.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.csproj b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.csproj deleted file mode 100644 index 4cbe50a9d167b3..00000000000000 --- a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.csproj +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs index 054e1c6b6c4ee0..85c38a98c3edea 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs @@ -5,10 +5,11 @@ using System.Runtime.InteropServices; using Xunit; +namespace SizeParamIndex.PInvoke; /// /// Pass Array Size by out keyword using SizeParamIndex Attributes /// -public class ClientMarshalArrayAsSizeParamIndexByOutTest +public class PassingByOutTest { #region ByOut diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.csproj b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.csproj deleted file mode 100644 index 1ea7b7c1d8044d..00000000000000 --- a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.cs b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.cs index 14425d30223323..fae40cb01ec1e0 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.cs @@ -5,11 +5,13 @@ using System.Runtime.InteropServices; using Xunit; +namespace SizeParamIndex.PInvoke; + /// /// Pass LPArray Size by ref keyword using SizeParamIndex Attributes /// -public class ClientMarshalArrayAsSizeParamIndexByRefTest +public class PassingByRefTest { #region ByRef diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.csproj b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.csproj deleted file mode 100644 index f0aedf2467dfd9..00000000000000 --- a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/helper.cs b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/helper.cs index bf691dd16dd2ce..027f2df7a2e4e8 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/helper.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/helper.cs @@ -4,6 +4,8 @@ using System; using System.Runtime.InteropServices; +namespace SizeParamIndex.PInvoke; + public class Helper { diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs index 61fca5a2c00094..57bc837e360cf4 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs @@ -5,7 +5,8 @@ using System.Runtime.InteropServices; using Xunit; -public class ReversePInvoke_MashalArrayByOut_AsManagedTest +namespace SizeParamIndex.ReversePInvoke; +public class PassingByOutTest { public static int arrSize = 10; diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/ReversePassingByOutTest.csproj b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/ReversePassingByOutTest.csproj deleted file mode 100644 index 1ea7b7c1d8044d..00000000000000 --- a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/ReversePassingByOutTest.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs index bd43abb35236c0..2c1e4717d52460 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs @@ -5,7 +5,8 @@ using System.Runtime.InteropServices; using Xunit; -public class ReversePInvoke_MashalArrayByRef_AsManagedTest +namespace SizeParamIndex.ReversePInvoke; +public class PassingByRefTest { public static int arrSize = 10; diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/ReversePassingByRefTest.csproj b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/ReversePassingByRefTest.csproj deleted file mode 100644 index f0aedf2467dfd9..00000000000000 --- a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/ReversePassingByRefTest.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/helper.cs b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/helper.cs index 51e56773c49e19..e3ae0358084c4a 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/helper.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/helper.cs @@ -4,6 +4,8 @@ using System; using System.Runtime.InteropServices; +namespace SizeParamIndex.ReversePInvoke; + public class Helper { #region General method diff --git a/src/tests/Interop/PInvoke/Varargs/VarargsTest.csproj b/src/tests/Interop/PInvoke/Varargs/VarargsTest.csproj deleted file mode 100644 index e57929398922fa..00000000000000 --- a/src/tests/Interop/PInvoke/Varargs/VarargsTest.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - true - - - - - - - - - diff --git a/src/tests/Interop/PInvoke/Vector2_3_4/Vector2_3_4.csproj b/src/tests/Interop/PInvoke/Vector2_3_4/Vector2_3_4.csproj deleted file mode 100644 index 2cdc971285f649..00000000000000 --- a/src/tests/Interop/PInvoke/Vector2_3_4/Vector2_3_4.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - From 97605a36c94489c6e1e81f67a352a4d8f3fbcf54 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Fri, 27 Oct 2023 13:05:09 -0700 Subject: [PATCH 08/19] Remove duplicate CMake project reference. --- src/tests/Interop/Interop.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tests/Interop/Interop.csproj b/src/tests/Interop/Interop.csproj index 250fdcbdd15239..401f5dc6a11fe0 100644 --- a/src/tests/Interop/Interop.csproj +++ b/src/tests/Interop/Interop.csproj @@ -49,7 +49,6 @@ - From b14beee293ff8f0293b60eea12d30ecd2128707a Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Fri, 27 Oct 2023 14:38:26 -0700 Subject: [PATCH 09/19] Handle building tests with native assets that are excluded on non-Windows in the merged runner and don't build the native assets on non-Windows. --- src/tests/Interop/Interop.csproj | 17 +++++++++++++++++ .../AutoReleaseTest/AutoReleaseTest.csproj | 2 +- .../BestFitMapping/Directory.Build.props | 3 ++- .../AssemblyTrue/AssemblyTrueTest.csproj | 3 ++- .../AssemblyWithoutComVisibleTest.csproj | 3 ++- .../Default/DefaultTest.csproj | 3 ++- .../Interop/PInvoke/Variant/VariantTest.csproj | 3 ++- .../VariantTestBuiltInComDisabled.csproj | 3 ++- .../Variant/VariantTestComWrappers.csproj | 3 ++- 9 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/tests/Interop/Interop.csproj b/src/tests/Interop/Interop.csproj index 401f5dc6a11fe0..2e3983f281930b 100644 --- a/src/tests/Interop/Interop.csproj +++ b/src/tests/Interop/Interop.csproj @@ -47,6 +47,23 @@ + + + + + + + + + + + + + diff --git a/src/tests/Interop/ObjectiveC/AutoReleaseTest/AutoReleaseTest.csproj b/src/tests/Interop/ObjectiveC/AutoReleaseTest/AutoReleaseTest.csproj index 57c94cf9015e6f..f614ddc54174ed 100644 --- a/src/tests/Interop/ObjectiveC/AutoReleaseTest/AutoReleaseTest.csproj +++ b/src/tests/Interop/ObjectiveC/AutoReleaseTest/AutoReleaseTest.csproj @@ -1,6 +1,6 @@ - + true true true diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Directory.Build.props b/src/tests/Interop/PInvoke/BestFitMapping/Directory.Build.props index b61cb104484cac..4d7f34bd20dbb7 100644 --- a/src/tests/Interop/PInvoke/BestFitMapping/Directory.Build.props +++ b/src/tests/Interop/PInvoke/BestFitMapping/Directory.Build.props @@ -23,7 +23,8 @@ - + + diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.csproj b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.csproj index 2797157d39f4e5..10f009ada0b484 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.csproj +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.csproj @@ -3,7 +3,8 @@ - + + diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.csproj b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.csproj index 0dfa89286d11f1..f62f9a89a4c595 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.csproj +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.csproj @@ -3,7 +3,8 @@ - + + diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.csproj b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.csproj index 379fd31e0dcdaa..a5486bdfa7211e 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.csproj +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.csproj @@ -3,7 +3,8 @@ - + + diff --git a/src/tests/Interop/PInvoke/Variant/VariantTest.csproj b/src/tests/Interop/PInvoke/Variant/VariantTest.csproj index 99b74f484f5293..4e509b8ead5627 100644 --- a/src/tests/Interop/PInvoke/Variant/VariantTest.csproj +++ b/src/tests/Interop/PInvoke/Variant/VariantTest.csproj @@ -7,7 +7,8 @@ - + + diff --git a/src/tests/Interop/PInvoke/Variant/VariantTestBuiltInComDisabled.csproj b/src/tests/Interop/PInvoke/Variant/VariantTestBuiltInComDisabled.csproj index b26e4cafd218ee..3802763ef020ce 100644 --- a/src/tests/Interop/PInvoke/Variant/VariantTestBuiltInComDisabled.csproj +++ b/src/tests/Interop/PInvoke/Variant/VariantTestBuiltInComDisabled.csproj @@ -11,7 +11,8 @@ - + + diff --git a/src/tests/Interop/PInvoke/Variant/VariantTestComWrappers.csproj b/src/tests/Interop/PInvoke/Variant/VariantTestComWrappers.csproj index 71ecf6fbf36968..1b66c08aefb02d 100644 --- a/src/tests/Interop/PInvoke/Variant/VariantTestComWrappers.csproj +++ b/src/tests/Interop/PInvoke/Variant/VariantTestComWrappers.csproj @@ -13,7 +13,8 @@ - + + From 30379bf63d4cf2996b8d0ed066ad4fad27fc5240 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Fri, 27 Oct 2023 14:43:01 -0700 Subject: [PATCH 10/19] Add ActiveIssues --- src/tests/Interop/PInvoke/Int128/Int128Test.cs | 3 +++ src/tests/Interop/PInvoke/Int128/UInt128Test.cs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/tests/Interop/PInvoke/Int128/Int128Test.cs b/src/tests/Interop/PInvoke/Int128/Int128Test.cs index 46123ef00e31f8..428fb9a11f6570 100644 --- a/src/tests/Interop/PInvoke/Int128/Int128Test.cs +++ b/src/tests/Interop/PInvoke/Int128/Int128Test.cs @@ -102,6 +102,7 @@ unsafe partial class Int128Native public unsafe partial class Int128Native { [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/69399", TestRuntimes.Mono)] public static void TestInt128FieldLayout() { // This test checks that the alignment rules of Int128 structs match the native compiler @@ -135,6 +136,8 @@ public static void TestInt128FieldLayout() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/74209")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/69531", TestRuntimes.Mono)] public static void TestInt128() { Int128 value1 = Int128Native.GetInt128(1, 2); diff --git a/src/tests/Interop/PInvoke/Int128/UInt128Test.cs b/src/tests/Interop/PInvoke/Int128/UInt128Test.cs index 1b3af752e7fb83..e6eae5b82fe0ee 100644 --- a/src/tests/Interop/PInvoke/Int128/UInt128Test.cs +++ b/src/tests/Interop/PInvoke/Int128/UInt128Test.cs @@ -38,6 +38,8 @@ unsafe partial class Int128Native unsafe partial class Int128Native { [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/74209")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/69531", TestRuntimes.Mono)] public static void TestUInt128() { UInt128 value1 = Int128Native.GetUInt128(1, 2); From 52e54857a0b4218ff11ec836378907d38124d6cd Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Wed, 22 Nov 2023 11:46:22 -0800 Subject: [PATCH 11/19] Port over more test disables from issues.targets to try to get more tests running so we see where we actually have failures. --- src/tests/Common/CoreCLRTestLibrary/Utilities.cs | 1 + src/tests/Interop/LayoutClass/LayoutClassTest.cs | 2 ++ src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs | 2 +- src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs | 2 +- src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs | 2 +- src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs | 2 +- src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs | 2 +- src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs | 2 +- src/tests/Interop/StructPacking/StructPacking.cs | 2 ++ src/tests/Interop/WinRT/Program.cs | 2 ++ 10 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/tests/Common/CoreCLRTestLibrary/Utilities.cs b/src/tests/Common/CoreCLRTestLibrary/Utilities.cs index 782ff3e72fe808..5126e7462e7716 100644 --- a/src/tests/Common/CoreCLRTestLibrary/Utilities.cs +++ b/src/tests/Common/CoreCLRTestLibrary/Utilities.cs @@ -63,6 +63,7 @@ public static bool Verbose public static bool IsX64 => (RuntimeInformation.ProcessArchitecture == Architecture.X64); public static bool IsArm => (RuntimeInformation.ProcessArchitecture == Architecture.Arm); public static bool IsArm64 => (RuntimeInformation.ProcessArchitecture == Architecture.Arm64); + public static bool IsXArch => IsX86 || IsX64; public static bool IsWindows => OperatingSystem.IsWindows(); public static bool IsLinux => OperatingSystem.IsLinux(); diff --git a/src/tests/Interop/LayoutClass/LayoutClassTest.cs b/src/tests/Interop/LayoutClass/LayoutClassTest.cs index 2e9c76cd5ce8cf..ad6ee3a396e7c0 100644 --- a/src/tests/Interop/LayoutClass/LayoutClassTest.cs +++ b/src/tests/Interop/LayoutClass/LayoutClassTest.cs @@ -137,6 +137,8 @@ public struct RecursiveTestStruct public RecursiveTestClass c; } + [SkipOnMono("needs triage")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/81673", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public class LayoutClassTest { private const string SimpleBlittableSeqLayoutClass_UpdateField = nameof(SimpleBlittableSeqLayoutClass_UpdateField); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs index 3a95b82ebfe209..31062afce95fda 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs @@ -38,7 +38,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { - [Fact] + [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsXArch))] public static void TestVector256B() { Assert.Throws(() => GenericsNative.GetVector256B(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs index 13b99e3c018c1f..70c5196bdc34d7 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs @@ -38,7 +38,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { - [Fact] + [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsXArch))] public static void TestVector256C() { Assert.Throws(() => GenericsNative.GetVector256C('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs index b4aba2fb36b954..b2dc10980e9973 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs @@ -38,7 +38,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { - [Fact] + [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsXArch))] public static void TestVector256D() { Assert.Throws(() => GenericsNative.GetVector256D(1.0, 2.0, 3.0, 4.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs index 92e5c3e86f164f..151dc915edb542 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs @@ -38,7 +38,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { - [Fact] + [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsXArch))] public static void TestVector256F() { Assert.Throws(() => GenericsNative.GetVector256F(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs index d8172cde1c4da9..79c5a6dd12b391 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs @@ -38,7 +38,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { - [Fact] + [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsXArch))] public static void TestVector256L() { Assert.Throws(() => GenericsNative.GetVector256L(1L, 2L, 3L, 4L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs index b05e7d6fc92a4f..2b5d5f2c467f25 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs @@ -38,7 +38,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { - [Fact] + [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsXArch))] public static void TestVector256U() { Assert.Throws(() => GenericsNative.GetVector256U(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u)); diff --git a/src/tests/Interop/StructPacking/StructPacking.cs b/src/tests/Interop/StructPacking/StructPacking.cs index e7ff357b33330b..0a2c0bd86c04f5 100644 --- a/src/tests/Interop/StructPacking/StructPacking.cs +++ b/src/tests/Interop/StructPacking/StructPacking.cs @@ -106,6 +106,8 @@ public unsafe partial class Program const int Fail = 0; [Fact] + [SkipOnMono("needs triage")] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/181", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static int TestEntryPoint() { bool succeeded = true; diff --git a/src/tests/Interop/WinRT/Program.cs b/src/tests/Interop/WinRT/Program.cs index 39b31b4a0926b6..0de4f2d6bcbe54 100644 --- a/src/tests/Interop/WinRT/Program.cs +++ b/src/tests/Interop/WinRT/Program.cs @@ -17,6 +17,8 @@ public class Program private static bool ObjectIsI(object o) => o is I; [Fact] + [SkipOnMono("WinRT interop was never supported on Mono, so blocking loading WinRT types was never added.")] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/182", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void CannotLoadWinRTType() { Assert.Throws(() => ObjectIsI(new object())); From 1af19cdbbb67319717c00dec57c038b9133c6429 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Mon, 27 Nov 2023 11:55:47 -0800 Subject: [PATCH 12/19] Fix OuterLoop attribute handling --- .../XUnitWrapperGenerator/XUnitWrapperGenerator.cs | 11 ++++++++--- .../XUnitWrapperGenerator.csproj | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs index edff22c88da84d..c5a94972b7098f 100644 --- a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs +++ b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs @@ -683,7 +683,7 @@ private static IEnumerable GetTestMethodInfosForMethod(IMethodSymbol case "Xunit.ConditionalClassAttribute": case "Xunit.SkipOnPlatformAttribute": case "Xunit.ActiveIssueAttribute": - case "Xunit.OuterloopAttribute": + case "Xunit.OuterLoopAttribute": case "Xunit.PlatformSpecificAttribute": case "Xunit.SkipOnMonoAttribute": case "Xunit.SkipOnTargetFrameworkAttribute": @@ -749,10 +749,15 @@ private static IEnumerable GetTestMethodInfosForMethod(IMethodSymbol false /* do not negate the condition, as this attribute indicates that a test will be run */); break; } - case "Xunit.OuterloopAttribute": + case "Xunit.OuterLoopAttribute": if (options.GlobalOptions.Priority() == 0) { - // If we aren't building the outerloop/Pri 1 test suite, then this attribute acts like an + if (filterAttribute.AttributeConstructor!.Parameters.Length < 2) + { + // If this test is always outerloop, then we can just skip it. + return ImmutableArray.Empty; + } + // The remaining constructors for the attribute can share handling with the // [ActiveIssue] attribute (it has the same shape). goto case "Xunit.ActiveIssueAttribute"; } diff --git a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj index 997daae2c43f25..875bf5044da9e9 100644 --- a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj +++ b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj @@ -5,6 +5,7 @@ enable true true + Debug;Release;Checked From 0e495937e206d220408d892e512434004415e056 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Mon, 27 Nov 2023 11:55:54 -0800 Subject: [PATCH 13/19] Fix ActiveIssue entries for NativeAOT --- .../SafeArray/SafeArrayTest.cs | 5 +- src/tests/Interop/Interop.csproj | 5 +- .../FunctionPointer/FunctionPointer.cs | 25 ++----- .../FunctionPointer/SingleMulticastTest.cs | 1 + .../AsByValArray/AsByValArrayTest.cs | 1 + .../AsLPArray/AsLPArrayTest.cs | 1 + .../AsDefault/AsDefaultTest.cs | 10 +-- .../AsLPArray/AsLPArrayTest.cs | 2 + .../ArrayWithOffset/ArrayWithOffsetTest.cs | 2 + src/tests/Interop/PInvoke/AsAny/AsAnyTest.cs | 2 + .../Interop/PInvoke/DateTime/DateTimeTest.cs | 24 +++---- .../PInvoke/DateTime/DateTimeTest.csproj | 8 --- .../Interop/PInvoke/Decimal/DecimalTest.cs | 2 + .../Interop/PInvoke/Delegate/DelegateTest.cs | 1 + .../Generics/GenericsTest.ReadOnlySpanD.cs | 1 + .../Generics/GenericsTest.ReadOnlySpanF.cs | 1 + .../Generics/GenericsTest.ReadOnlySpanL.cs | 1 + .../Generics/GenericsTest.ReadOnlySpanU.cs | 1 + .../PInvoke/Generics/GenericsTest.SpanD.cs | 1 + .../PInvoke/Generics/GenericsTest.SpanF.cs | 1 + .../PInvoke/Generics/GenericsTest.SpanL.cs | 1 + .../PInvoke/Generics/GenericsTest.SpanU.cs | 1 + .../Generics/GenericsTest.Vector128B.cs | 1 + .../Generics/GenericsTest.Vector128C.cs | 1 + .../Generics/GenericsTest.Vector128D.cs | 1 + .../Generics/GenericsTest.Vector128F.cs | 1 + .../Generics/GenericsTest.Vector128L.cs | 1 + .../Generics/GenericsTest.Vector128U.cs | 1 + .../Generics/GenericsTest.Vector256B.cs | 1 + .../Generics/GenericsTest.Vector256C.cs | 1 + .../Generics/GenericsTest.Vector256D.cs | 1 + .../Generics/GenericsTest.Vector256F.cs | 1 + .../Generics/GenericsTest.Vector256L.cs | 1 + .../Generics/GenericsTest.Vector256U.cs | 1 + .../Generics/GenericsTest.Vector64B.cs | 1 + .../Generics/GenericsTest.Vector64C.cs | 1 + .../Generics/GenericsTest.Vector64D.cs | 1 + .../Generics/GenericsTest.Vector64F.cs | 1 + .../Generics/GenericsTest.Vector64L.cs | 1 + .../Generics/GenericsTest.Vector64U.cs | 1 + .../PInvoke/Generics/GenericsTest.VectorB.cs | 3 +- .../PInvoke/Generics/GenericsTest.VectorC.cs | 3 +- .../PInvoke/Generics/GenericsTest.VectorD.cs | 3 +- .../PInvoke/Generics/GenericsTest.VectorF.cs | 3 +- .../PInvoke/Generics/GenericsTest.VectorL.cs | 3 +- .../PInvoke/Generics/GenericsTest.VectorU.cs | 3 +- .../Interop/PInvoke/Generics/GenericsTest.cs | 1 + .../InvalidSafeHandleMarshallingTests.cs | 5 +- .../SafeHandles/SafeHandleLifetimeTests.cs | 1 + .../PInvoke/SafeHandles/SafeHandleTests.cs | 1 + .../PInvoke/Invalid/InvalidParamIndex.cs | 2 + .../PInvoke/PassingByOut/PassingByOutTest.cs | 1 + .../PInvoke/PassingByRef/PassingByRefTest.cs | 1 + .../PassingByOut/PassingByOutTest.cs | 2 + .../PassingByRef/PassingByRefTest.cs | 2 + .../StringMarshalling/LPTSTR/LPTSTRTest.cs | 4 ++ src/tests/issues.targets | 69 ------------------- 57 files changed, 86 insertions(+), 136 deletions(-) delete mode 100644 src/tests/Interop/PInvoke/DateTime/DateTimeTest.csproj diff --git a/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.cs b/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.cs index 77de22fb8264b4..1935e223b35c8c 100644 --- a/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.cs +++ b/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.cs @@ -9,10 +9,9 @@ #pragma warning disable CS0612, CS0618 -public class Tester +public class SafeArrayMarshallingTest { - [Fact] - [PlatformSpecific(TestPlatforms.Windows)] + [ConditionalFact(typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.IsBuiltInComEnabled))] [SkipOnMono("Requires COM support")] public static int TestEntryPoint() { diff --git a/src/tests/Interop/Interop.csproj b/src/tests/Interop/Interop.csproj index 2e3983f281930b..bbf2be1ba01734 100644 --- a/src/tests/Interop/Interop.csproj +++ b/src/tests/Interop/Interop.csproj @@ -1,13 +1,13 @@ true + Debug;Release;Checked - + @@ -26,6 +26,7 @@ + diff --git a/src/tests/Interop/MarshalAPI/FunctionPointer/FunctionPointer.cs b/src/tests/Interop/MarshalAPI/FunctionPointer/FunctionPointer.cs index 65f1957790a080..f78d8511a06e15 100644 --- a/src/tests/Interop/MarshalAPI/FunctionPointer/FunctionPointer.cs +++ b/src/tests/Interop/MarshalAPI/FunctionPointer/FunctionPointer.cs @@ -4,6 +4,7 @@ using System.Runtime.InteropServices; using Xunit; +[SkipOnMono("needs triage")] public partial class FunctionPtr { static class FunctionPointerNative @@ -23,6 +24,9 @@ static class FunctionPointerNative delegate void VoidDelegate(); + [Fact] + + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/164", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void RunGetDelForFcnPtrTest() { Console.WriteLine($"Running {nameof(RunGetDelForFcnPtrTest)}..."); @@ -68,6 +72,7 @@ void VoidVoidMethod() private unsafe delegate void DelegateToFillOutPtr([Out] IntPtr* p); + [Fact] public static void RunGetDelForOutPtrTest() { Console.WriteLine($"Running {nameof(RunGetDelForOutPtrTest)}..."); @@ -89,6 +94,7 @@ public static void RunGetDelForOutPtrTest() private unsafe delegate void DelegateToFillOutIntParameter(out IntPtr p); + [Fact] public static void RunGetDelForOutIntTest() { Console.WriteLine($"Running {nameof(RunGetDelForOutIntTest)}..."); @@ -104,23 +110,4 @@ public static void RunGetDelForOutIntTest() } Assert.Equal(expectedValue, outVar); } - - [Fact] - public static int TestEntryPoint() - { - try - { - RunGetDelForFcnPtrTest(); - RunGetFcnPtrSingleMulticastTest(); - RunGetDelForOutPtrTest(); - RunGetDelForOutIntTest(); - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - - return 100; - } } diff --git a/src/tests/Interop/MarshalAPI/FunctionPointer/SingleMulticastTest.cs b/src/tests/Interop/MarshalAPI/FunctionPointer/SingleMulticastTest.cs index e5b913e8f09987..89a801850f6295 100644 --- a/src/tests/Interop/MarshalAPI/FunctionPointer/SingleMulticastTest.cs +++ b/src/tests/Interop/MarshalAPI/FunctionPointer/SingleMulticastTest.cs @@ -12,6 +12,7 @@ partial class FunctionPtr public static DelegateWithLong s_DelWithLongBool = new DelegateWithLong(MethodWithLongBool); public static MultiDelegateWithLong s_MultidelWithLong = new MultiDelegateWithLong(MethodWithLong); + [Fact] public static void RunGetFcnPtrSingleMulticastTest() { Console.WriteLine($"Running {nameof(RunGetFcnPtrSingleMulticastTest)}..."); diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.cs b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.cs index d64e6570f117c0..4c6b7421251d1d 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.cs +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.cs @@ -1179,6 +1179,7 @@ static void RunTest6(string report) } [Fact] + [SkipOnMono("needs triage")] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs index fab355ba2d4fa2..6fc009e995f780 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs @@ -423,6 +423,7 @@ static void RunTest4(string report) } [Fact] + [SkipOnMono("needs triage")] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs index 9a19e64fe7f67b..5d5860c49b9f2a 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs @@ -336,7 +336,7 @@ private static void TestMarshalByVal_NoAttributes() Assert.True(CStyle_Array_Bool(InitBoolArray(ARRAY_SIZE), ARRAY_SIZE)); - if (OperatingSystem.IsWindows()) + if (TestLibrary.PlatformDetection.IsBuiltInComEnabled) { object[] oArr = InitArray(ARRAY_SIZE); // Test nesting null value scenario @@ -368,7 +368,7 @@ private static void TestMarshalByVal_In() Assert.True(CStyle_Array_LPSTR_In(strArr, ARRAY_SIZE)); Assert.True(CStyle_Array_Struct_In(InitStructArray(ARRAY_SIZE), ARRAY_SIZE)); Assert.True(CStyle_Array_Bool_In(InitBoolArray(ARRAY_SIZE), ARRAY_SIZE)); - if (OperatingSystem.IsWindows()) + if (TestLibrary.PlatformDetection.IsBuiltInComEnabled) { object[] oArr = InitArray(ARRAY_SIZE); // Test nesting null value scenario @@ -463,7 +463,7 @@ private static void TestMarshalInOut_ByVal() Assert.True(CStyle_Array_Bool_InOut(boolArr, ARRAY_SIZE)); Assert.True(Equals(boolArr, GetExpectedOutBoolArray(ARRAY_SIZE))); - if (OperatingSystem.IsWindows()) + if (TestLibrary.PlatformDetection.IsBuiltInComEnabled) { Console.WriteLine("CStyle_Array_Object_InOut"); object[] oArr = InitArray(ARRAY_SIZE); @@ -626,7 +626,7 @@ private static void TestMarshalOut_ByVal() Assert.True(CStyle_Array_Bool_Out(boolArr, ARRAY_SIZE)); Assert.True(Equals(boolArr, GetExpectedOutBoolArray(ARRAY_SIZE))); - if (OperatingSystem.IsWindows()) + if (TestLibrary.PlatformDetection.IsBuiltInComEnabled) { Console.WriteLine("CStyle_Array_Object_Out"); object[] oArr = new object[ARRAY_SIZE]; @@ -655,6 +655,8 @@ private static void TestMultidimensional() } [Fact] + [SkipOnMono("needs triage")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/81674", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs index 33a1e2bc4bf5dd..7685d6db23ccde 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs @@ -633,6 +633,8 @@ public static bool IsCorrect(S2[] actual, S2[] expected) #endregion [Fact] + [SkipOnMono("needs triage")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/81674", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static int TestEntryPoint() { try{ diff --git a/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.cs b/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.cs index 8516cb2a47cb3c..2dd83f9d331dc9 100644 --- a/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.cs +++ b/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.cs @@ -9,6 +9,8 @@ public unsafe class ArrayWithOffsetTest { [Fact] + [SkipOnMono("needs triage")] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/170", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/PInvoke/AsAny/AsAnyTest.cs b/src/tests/Interop/PInvoke/AsAny/AsAnyTest.cs index 006f59af7c1c4e..c22dc8039fadf4 100644 --- a/src/tests/Interop/PInvoke/AsAny/AsAnyTest.cs +++ b/src/tests/Interop/PInvoke/AsAny/AsAnyTest.cs @@ -296,6 +296,8 @@ public static extern bool PassAnsiCharArrayFF( public static extern bool PassMixStruct(AsAnyField mix); [Fact] + [SkipOnMono("needs triage")] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/169", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/PInvoke/DateTime/DateTimeTest.cs b/src/tests/Interop/PInvoke/DateTime/DateTimeTest.cs index 679d9578c6e1fe..d6b0dccef2fcfa 100644 --- a/src/tests/Interop/PInvoke/DateTime/DateTimeTest.cs +++ b/src/tests/Interop/PInvoke/DateTime/DateTimeTest.cs @@ -26,27 +26,19 @@ class NativeDateTime public class DateTimeTest { [Fact] - public static int TestEntryPoint() + [SkipOnMono("needs triage")] + public static void TestEntryPoint() { - try - { - DateTime currentDate = new DateTime(2019, 5, 2); + DateTime currentDate = new DateTime(2019, 5, 2); - Assert.Equal(currentDate.AddDays(1), NativeDateTime.GetTomorrow(currentDate)); + Assert.Equal(currentDate.AddDays(1), NativeDateTime.GetTomorrow(currentDate)); - NativeDateTime.GetTomorrowByRef(currentDate, out DateTime nextDay); + NativeDateTime.GetTomorrowByRef(currentDate, out DateTime nextDay); - Assert.Equal(currentDate.AddDays(1), nextDay); + Assert.Equal(currentDate.AddDays(1), nextDay); - DateWrapper wrapper = new DateWrapper { date = currentDate }; + DateWrapper wrapper = new DateWrapper { date = currentDate }; - Assert.Equal(currentDate.AddDays(1), NativeDateTime.GetTomorrowWrapped(wrapper).date); - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - return 100; + Assert.Equal(currentDate.AddDays(1), NativeDateTime.GetTomorrowWrapped(wrapper).date); } } diff --git a/src/tests/Interop/PInvoke/DateTime/DateTimeTest.csproj b/src/tests/Interop/PInvoke/DateTime/DateTimeTest.csproj deleted file mode 100644 index b1cb7830a007e1..00000000000000 --- a/src/tests/Interop/PInvoke/DateTime/DateTimeTest.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/tests/Interop/PInvoke/Decimal/DecimalTest.cs b/src/tests/Interop/PInvoke/Decimal/DecimalTest.cs index 2bbc975212f7a5..bcb9b27073a92c 100644 --- a/src/tests/Interop/PInvoke/Decimal/DecimalTest.cs +++ b/src/tests/Interop/PInvoke/Decimal/DecimalTest.cs @@ -5,6 +5,7 @@ using System.Runtime.InteropServices; using Xunit; +[SkipOnMono("needs triage")] public class DecimalTest { private const int StartingIntValue = 42; @@ -58,6 +59,7 @@ public static void RunLPDecimalTests() [Fact] [PlatformSpecific(TestPlatforms.Windows)] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/175", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void RunCurrencyTests() { Assert.Throws(() => DecimalTestNative.CreateCurrencyFromInt(StartingIntValue)); diff --git a/src/tests/Interop/PInvoke/Delegate/DelegateTest.cs b/src/tests/Interop/PInvoke/Delegate/DelegateTest.cs index ba31cb3cab7ae9..dac92476fa0bc3 100644 --- a/src/tests/Interop/PInvoke/Delegate/DelegateTest.cs +++ b/src/tests/Interop/PInvoke/Delegate/DelegateTest.cs @@ -7,6 +7,7 @@ using Xunit; using static DelegateTestNative; +[SkipOnMono("needs triage")] public class DelegateTest { [Fact] diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanD.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanD.cs index 77810547c6b350..eeb9bb35a69f9b 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanD.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanD.cs @@ -26,6 +26,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestReadOnlySpanD() { Assert.Throws(() => GenericsNative.GetReadOnlySpanD(1.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanF.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanF.cs index ac23e97f4014d9..9d98f0d6027468 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanF.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanF.cs @@ -26,6 +26,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestReadOnlySpanF() { Assert.Throws(() => GenericsNative.GetReadOnlySpanF(1.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanL.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanL.cs index 61fe5e58dd0fd3..f20becc44a11af 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanL.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanL.cs @@ -26,6 +26,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestReadOnlySpanL() { Assert.Throws(() => GenericsNative.GetReadOnlySpanL(1L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanU.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanU.cs index 281bf5e14f8361..6ffe81d3176aa0 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanU.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanU.cs @@ -26,6 +26,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestReadOnlySpanU() { Assert.Throws(() => GenericsNative.GetReadOnlySpanU(1u)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanD.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanD.cs index b20fa17523630f..defee1dc67a291 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanD.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanD.cs @@ -26,6 +26,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestSpanD() { Assert.Throws(() => GenericsNative.GetSpanD(1.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanF.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanF.cs index 00fa07c4d3a02a..7418717628dc83 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanF.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanF.cs @@ -26,6 +26,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestSpanF() { Assert.Throws(() => GenericsNative.GetSpanF(1.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanL.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanL.cs index 37b50812711a79..fc18eaf59a7c58 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanL.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanL.cs @@ -26,6 +26,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestSpanL() { Assert.Throws(() => GenericsNative.GetSpanL(1L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanU.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanU.cs index 8af2ec532a697d..625870218a51d8 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanU.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanU.cs @@ -26,6 +26,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestSpanU() { Assert.Throws(() => GenericsNative.GetSpanU(1u)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128B.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128B.cs index 156d50557d7a8e..9757c2050c7db5 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128B.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128B.cs @@ -39,6 +39,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVector128B() { Assert.Throws(() => GenericsNative.GetVector128B(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128C.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128C.cs index b93286d5a85268..cbc42f7add5084 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128C.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128C.cs @@ -39,6 +39,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVector128C() { Assert.Throws(() => GenericsNative.GetVector128C('0', '1', '2', '3', '4', '5', '6', '7')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128D.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128D.cs index 04093dcf4907a5..de99aff597d522 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128D.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128D.cs @@ -39,6 +39,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVector128D() { Assert.Throws(() => GenericsNative.GetVector128D(1.0, 2.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128F.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128F.cs index e209ccbfffdf7b..07c0cb66df5d18 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128F.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128F.cs @@ -39,6 +39,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVector128F() { Assert.Throws(() => GenericsNative.GetVector128F(1.0f, 2.0f, 3.0f, 4.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128L.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128L.cs index 0fc48ca8dfd26c..7ef068809ec16b 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128L.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128L.cs @@ -39,6 +39,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVector128L() { Assert.Throws(() => GenericsNative.GetVector128L(1L, 2L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128U.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128U.cs index e27896e53c4849..67879049421e5a 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128U.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128U.cs @@ -39,6 +39,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVector128U() { Assert.Throws(() => GenericsNative.GetVector128U(1u, 2u, 3u, 4u)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs index 31062afce95fda..6da86d32091bcb 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs @@ -39,6 +39,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsXArch))] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVector256B() { Assert.Throws(() => GenericsNative.GetVector256B(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs index 70c5196bdc34d7..257cea6b68800f 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs @@ -39,6 +39,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsXArch))] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVector256C() { Assert.Throws(() => GenericsNative.GetVector256C('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs index b2dc10980e9973..a7dc0d8db35488 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs @@ -39,6 +39,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsXArch))] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVector256D() { Assert.Throws(() => GenericsNative.GetVector256D(1.0, 2.0, 3.0, 4.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs index 151dc915edb542..9072f41e5bee73 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs @@ -39,6 +39,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsXArch))] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVector256F() { Assert.Throws(() => GenericsNative.GetVector256F(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs index 79c5a6dd12b391..ae2fc8651e65bf 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs @@ -39,6 +39,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsXArch))] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVector256L() { Assert.Throws(() => GenericsNative.GetVector256L(1L, 2L, 3L, 4L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs index 2b5d5f2c467f25..d0142d95b10ab9 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs @@ -39,6 +39,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsXArch))] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVector256U() { Assert.Throws(() => GenericsNative.GetVector256U(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64B.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64B.cs index 6d273129eff3f8..fd07030c9d697b 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64B.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64B.cs @@ -39,6 +39,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVector64B() { Assert.Throws(() => GenericsNative.GetVector64B(true, false, true, false, true, false, true, false)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64C.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64C.cs index a7121ca77670cf..0b0a9cc6f90f99 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64C.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64C.cs @@ -39,6 +39,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVector64C() { Assert.Throws(() => GenericsNative.GetVector64C('0', '1', '2', '3')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64D.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64D.cs index 193be2bdcaccb4..9635b52b8844dd 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64D.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64D.cs @@ -39,6 +39,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVector64D() { Assert.Throws(() => GenericsNative.GetVector64D(1.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64F.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64F.cs index 15ca6abe2d1145..f2a9110456f3af 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64F.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64F.cs @@ -39,6 +39,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVector64F() { Assert.Throws(() => GenericsNative.GetVector64F(1.0f, 2.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64L.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64L.cs index 4a15a4bed2492c..1a770b4c668ceb 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64L.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64L.cs @@ -39,6 +39,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVector64L() { Assert.Throws(() => GenericsNative.GetVector64L(1L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64U.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64U.cs index d0531e5864fcce..2a6edf98431fd7 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64U.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64U.cs @@ -39,6 +39,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVector64U() { Assert.Throws(() => GenericsNative.GetVector64U(1u, 2u)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorB.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorB.cs index d21ee9eddb3ea4..3c733b6cfd0fe0 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorB.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorB.cs @@ -66,6 +66,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVectorB() { if (Vector.Count == 32) @@ -79,7 +80,6 @@ public static void TestVectorB() } } - [Fact] public static void TestVectorB128() { Assert.Throws(() => GenericsNative.GetVectorB128(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false)); @@ -149,7 +149,6 @@ public static void TestVectorB128() Assert.Throws(() => GenericsNative.AddVectorB128s(in values[0], values.Length)); } - [Fact] public static void TestVectorB256() { Assert.Throws(() => GenericsNative.GetVectorB256(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorC.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorC.cs index 4515096ddc6654..7f78d30fca6d3f 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorC.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorC.cs @@ -66,6 +66,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVectorC() { if (Vector.Count == 16) @@ -79,7 +80,6 @@ public static void TestVectorC() } } - [Fact] public static void TestVectorC128() { Assert.Throws(() => GenericsNative.GetVectorC128('0', '1', '2', '3', '4', '5', '6', '7')); @@ -133,7 +133,6 @@ public static void TestVectorC128() Assert.Throws(() => GenericsNative.AddVectorC128s(in values[0], values.Length)); } - [Fact] public static void TestVectorC256() { Assert.Throws(() => GenericsNative.GetVectorC256('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorD.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorD.cs index 5d641eca27e7f9..a8638a7213d531 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorD.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorD.cs @@ -66,6 +66,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVectorD() { if (Vector.Count == 4) @@ -79,7 +80,6 @@ public static void TestVectorD() } } - [Fact] public static void TestVectorD128() { Assert.Throws(() => GenericsNative.GetVectorD128(1.0, 2.0)); @@ -119,7 +119,6 @@ public static void TestVectorD128() Assert.Throws(() => GenericsNative.AddVectorD128s(in values[0], values.Length)); } - [Fact] public static void TestVectorD256() { Assert.Throws(() => GenericsNative.GetVectorD256(1.0, 2.0, 3.0, 4.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorF.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorF.cs index 904ce4443860a7..abae129e978fc6 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorF.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorF.cs @@ -66,6 +66,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVectorF() { if (Vector.Count == 8) @@ -79,7 +80,6 @@ public static void TestVectorF() } } - [Fact] public static void TestVectorF128() { Assert.Throws(() => GenericsNative.GetVectorF128(1.0f, 2.0f, 3.0f, 4.0f)); @@ -123,7 +123,6 @@ public static void TestVectorF128() Assert.Throws(() => GenericsNative.AddVectorF128s(in values[0], values.Length)); } - [Fact] public static void TestVectorF256() { Assert.Throws(() => GenericsNative.GetVectorF256(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorL.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorL.cs index d5a8cf4a9fc56e..df1743cc4aa0f7 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorL.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorL.cs @@ -66,6 +66,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVectorL() { if (Vector.Count == 4) @@ -79,7 +80,6 @@ public static void TestVectorL() } } - [Fact] public static void TestVectorL128() { Assert.Throws(() => GenericsNative.GetVectorL128(1L, 2L)); @@ -119,7 +119,6 @@ public static void TestVectorL128() Assert.Throws(() => GenericsNative.AddVectorL128s(in values[0], values.Length)); } - [Fact] public static void TestVectorL256() { Assert.Throws(() => GenericsNative.GetVectorL256(1L, 2L, 3L, 4L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorU.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorU.cs index 13d297b4d5f834..dbbb00991ddd55 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorU.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorU.cs @@ -66,6 +66,7 @@ unsafe partial class GenericsNative public unsafe partial class GenericsTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/177", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void TestVectorU() { if (Vector.Count == 8) @@ -79,7 +80,6 @@ public static void TestVectorU() } } - [Fact] public static void TestVectorU128() { Assert.Throws(() => GenericsNative.GetVectorU128(1u, 2u, 3u, 4u)); @@ -123,7 +123,6 @@ public static void TestVectorU128() Assert.Throws(() => GenericsNative.AddVectorU128s(in values[0], values.Length)); } - [Fact] public static void TestVectorU256() { Assert.Throws(() => GenericsNative.GetVectorU256(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.cs index d169741aae241f..c78c855c013f38 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.cs @@ -46,6 +46,7 @@ public class SequentialClass where T : struct } [SkipOnMono("needs triage")] + public partial class GenericsTest { } diff --git a/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs b/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs index fe678d93ceb76f..f06f206d177bb7 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs @@ -13,13 +13,12 @@ public class InvalidSafeHandleMarshallingTests [Fact] public static void RunTest() { - if (TestLibrary.Utilities.IsWindows) + if (TestLibrary.PlatformDetection.IsBuiltInComEnabled) { // The interface marshaller is only available when COM interop is // enabled. The interface marshaller is what initiates the COM // interop system which is what subsequently defines defined exception - // type to throw - matches .NET Framework behavior. At present support - // is limited to Windows so we branch on that. + // type to throw - matches .NET Framework behavior. Assert.Throws(() => MarshalSafeHandleAsInterface()); } else diff --git a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs index 583bf7940e0eb4..0c1ddee2a4c041 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs @@ -14,6 +14,7 @@ public class SafeHandleLifetimeTests private static readonly IntPtr newValue = new IntPtr(987185); [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/168", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void RunTest() { var testHandle = new TestSafeHandle(initialValue); diff --git a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs index 70669521dd8b8f..7bec185cee3c79 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs @@ -14,6 +14,7 @@ public class SafeHandleTest private static readonly IntPtr newValue = new IntPtr(987185); [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/168", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void RunTest() { var testHandle = new TestSafeHandle(initialValue); diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.cs b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.cs index b6f250c2e61854..1ae8d2510f5b56 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.cs @@ -16,12 +16,14 @@ public static extern void SizeParamIndexWrongType( out string arrSize, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] out byte[] arrByte); [Fact] + [SkipOnMono("needs triage")] public static void TooBig() { Assert.Throws(() => SizeParamIndexTooBig(out var _, out var _)); } [Fact] + [SkipOnMono("needs triage")] public static void WrongType() { Assert.Throws(() => SizeParamIndexWrongType(out var _, out var _)); diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs index cdb2b9b2b292ef..dd9c518c311946 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs @@ -231,6 +231,7 @@ static void SizeParamTypeIsString() } [Fact] + [SkipOnMono("needs triage")] public static int TestEntryPoint() { try{ diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.cs b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.cs index bfd02069925ae1..2b61abc66b0fb6 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.cs @@ -240,6 +240,7 @@ static void SizeParamTypeIsString() } [Fact] + [SkipOnMono("needs triage")] public static int TestEntryPoint() { try{ diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs index 99eb33114605e0..7f21eb2a3df308 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs @@ -194,6 +194,8 @@ public static void RunTestByOut() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/34196", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/167", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static int TestEntryPoint() { try{ diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs index 4478c270057de1..25f74a66d15047 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs @@ -209,6 +209,8 @@ public static void RunTestByRef() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/34196", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/167", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static int TestEntryPoint() { try{ diff --git a/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs b/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs index 4c6b4fb8361d75..ef30cf2c995db1 100644 --- a/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs +++ b/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs @@ -10,24 +10,28 @@ using static LPTStrTestNative; [OuterLoop] +[SkipOnMono("needs triage")] public partial class StringTests { } [OuterLoop] +[SkipOnMono("needs triage")] public partial class StringBuilderTests { } [OuterLoop] +[SkipOnMono("needs triage")] public partial class StringInStructTests { } [OuterLoop] +[SkipOnMono("needs triage")] public class LPTStrTest { private static readonly string InitialString = "Hello World"; diff --git a/src/tests/issues.targets b/src/tests/issues.targets index 1b2a852bba493d..ce644dd1c7a012 100644 --- a/src/tests/issues.targets +++ b/src/tests/issues.targets @@ -782,12 +782,6 @@ https://github.com/dotnet/runtimelab/issues/176: VARIANT marshalling - - https://github.com/dotnet/runtimelab/issues/170 - - - https://github.com/dotnet/runtimelab/issues/169 - https://github.com/dotnet/runtimelab/issues/165 @@ -812,12 +806,6 @@ https://github.com/dotnet/runtimelab/issues/155: C++/CLI - - https://github.com/dotnet/runtimelab/issues/168 - - - https://github.com/dotnet/runtimelab/issues/167 - https://github.com/dotnet/runtimelab/issues/155: Varargs @@ -1419,9 +1407,6 @@ needs triage - - needs triage - https://github.com/dotnet/runtime/issues/34371 @@ -1431,45 +1416,18 @@ needs triage - - needs triage - https://github.com/dotnet/runtime/issues/34072 https://github.com/dotnet/runtime/issues/34374 - - needs triage - - - needs triage - https://github.com/dotnet/runtime/issues/41180 needs triage - - needs triage - - - needs triage - - - needs triage - - - needs triage - - - needs triage - - - needs triage - needs triage @@ -1479,30 +1437,9 @@ needs triage - - needs triage - - - needs triage - - - needs triage - - - needs triage - - - https://github.com/dotnet/runtime/issues/69531 - https://github.com/dotnet/runtime/issues/48084 - - needs triage - - - needs triage - needs triage @@ -1512,18 +1449,12 @@ https://github.com/dotnet/runtime/issues/34196 - - needs triage - needs triage https://github.com/dotnet/runtime/issues/34196 - - needs triage - needs triage From 26230da8a6c6107c3dcd361c00e427c8065adbb3 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Mon, 27 Nov 2023 14:06:42 -0800 Subject: [PATCH 14/19] Remove extraneous edit --- .../Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj index 875bf5044da9e9..997daae2c43f25 100644 --- a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj +++ b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj @@ -5,7 +5,6 @@ enable true true - Debug;Release;Checked From 893eb61f5b1f8866f0f7c9fc2d546a7563fb9a49 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Wed, 29 Nov 2023 23:56:51 +0000 Subject: [PATCH 15/19] Disable SafeHandle tests that fail on Mono --- .../PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs | 1 + src/tests/Interop/PInvoke/SafeHandles/ReliableUnmarshalTest.cs | 1 + src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs | 1 + 3 files changed, 3 insertions(+) diff --git a/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs b/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs index f06f206d177bb7..0459a8c50daa13 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs @@ -11,6 +11,7 @@ namespace SafeHandleTests public class InvalidSafeHandleMarshallingTests { [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/48084", TestRuntimes.Mono)] public static void RunTest() { if (TestLibrary.PlatformDetection.IsBuiltInComEnabled) diff --git a/src/tests/Interop/PInvoke/SafeHandles/ReliableUnmarshalTest.cs b/src/tests/Interop/PInvoke/SafeHandles/ReliableUnmarshalTest.cs index 40d120036c51e7..47fbc0c62b9406 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/ReliableUnmarshalTest.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/ReliableUnmarshalTest.cs @@ -11,6 +11,7 @@ namespace SafeHandleTests public class ReliableUnmarshalTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/48084", TestRuntimes.Mono)] public static void RunTest() { // Test that our SafeHandle-derived object has its underlying handle set after a P/Invoke diff --git a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs index 0c1ddee2a4c041..0ef40a26d13e98 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs @@ -15,6 +15,7 @@ public class SafeHandleLifetimeTests [Fact] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/168", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/48084", TestRuntimes.Mono)] public static void RunTest() { var testHandle = new TestSafeHandle(initialValue); From 124e34f407ec38213adde40fbc75ee666dcdbdb1 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Wed, 29 Nov 2023 23:58:20 +0000 Subject: [PATCH 16/19] Disable last failing test on NativeAOT --- src/tests/Interop/IDynamicInterfaceCastable/Program.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/Interop/IDynamicInterfaceCastable/Program.cs b/src/tests/Interop/IDynamicInterfaceCastable/Program.cs index 0aba97ea0dfcb3..ff78b77d92e416 100644 --- a/src/tests/Interop/IDynamicInterfaceCastable/Program.cs +++ b/src/tests/Interop/IDynamicInterfaceCastable/Program.cs @@ -370,6 +370,7 @@ public static void ValidateBasicInterface() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/1442", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void ValidateGenericInterface() { Console.WriteLine($"Running {nameof(ValidateGenericInterface)}"); From 7b6a028333ef6097d3f3d7c46e8f7eb319cf5136 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Thu, 30 Nov 2023 11:51:55 -0800 Subject: [PATCH 17/19] Disable remaining tests that fail on Mono on non-mobile platforms. --- src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs | 1 + src/tests/Interop/StringMarshalling/LPSTR/LPSTRTest.cs | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 src/tests/Interop/StringMarshalling/LPSTR/LPSTRTest.cs diff --git a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs index 7bec185cee3c79..a7eafda8ac309c 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs @@ -15,6 +15,7 @@ public class SafeHandleTest [Fact] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/168", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/48084", TestRuntimes.Mono)] public static void RunTest() { var testHandle = new TestSafeHandle(initialValue); diff --git a/src/tests/Interop/StringMarshalling/LPSTR/LPSTRTest.cs b/src/tests/Interop/StringMarshalling/LPSTR/LPSTRTest.cs new file mode 100644 index 00000000000000..bf9e21791b4cb1 --- /dev/null +++ b/src/tests/Interop/StringMarshalling/LPSTR/LPSTRTest.cs @@ -0,0 +1,9 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +using Xunit; + +[OuterLoop] +[SkipOnMono("needs triage")] +public partial class StringBuilderTests +{ +} From b623ce9f82c75efc44b1b1b0c61f699958a02b8b Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Wed, 6 Dec 2023 14:18:03 -0800 Subject: [PATCH 18/19] Disable Interop tests with native assets on platforms that we don't currently build native assets on. --- .../CoreCLRTestLibrary/PlatformDetection.cs | 4 + .../BoolArray/MarshalBoolArrayTest.cs | 1 + .../SafeArray/SafeArrayTest.cs | 1 + .../Interop/BestFitMapping/BestFitMapping.cs | 1 + .../DisabledRuntimeMarshalling/AutoLayout.cs | 1 + .../FunctionPointers.cs | 1 + .../Delegates.cs | 1 + .../Generics.cs | 1 + .../PInvokes.cs | 1 + .../UnmanagedCallersOnly.cs | 1 + .../Delegates.cs | 1 + .../PInvokes.cs | 1 + .../UnmanagedCallersOnly.cs | 1 + .../DllImportPath/DllImportPathTest.cs | 1 + .../ExactSpelling/ExactSpellingTest.cs | 1 + .../DllImportSearchPathsTest.cs | 1 + .../ExecInDefAppDom/ExecInDefAppDom.cs | 2 + .../FuncPtrAsDelegateParamManaged.cs | 3 +- .../ConflictingNames/RunInALC.cs | 1 + .../SameNameDifferentAssembly.cs | 3 +- .../Primitives/ICustomMarshaler.cs | 1 + .../Interop/LayoutClass/LayoutClassTest.cs | 1 + .../FunctionPointer/FunctionPointer.cs | 3 +- .../MarshalAPI/IUnknown/IUnknownTest.cs | 6 +- .../AutoReleaseTest/AutoReleaseTest.cs | 1 + .../ObjectiveCMarshalAPI/Program.cs | 1 + .../AsByValArray/AsByValArrayTest.cs | 1 + .../AsLPArray/AsLPArrayTest.cs | 1 + .../AsDefault/AsDefaultTest.cs | 1 + .../AsLPArray/AsLPArrayTest.cs | 1 + .../ArrayWithOffset/ArrayWithOffsetTest.cs | 1 + src/tests/Interop/PInvoke/AsAny/AsAnyTest.cs | 1 + .../PInvoke/Attributes/LCID/LCIDTest.cs | 1 + .../Interop/PInvoke/BestFitMapping/Program.cs | 1 + .../CriticalHandles/ArrayTest/ArrayTest.cs | 1 + .../ReverseTest/ReverseTest.cs | 1 + .../CriticalHandles/StructTest/StructTest.cs | 1 + .../CustomMarshalers/CustomMarshalersTest.cs | 1 + .../Interop/PInvoke/DateTime/DateTimeTest.cs | 1 + .../Interop/PInvoke/Decimal/DecimalTest.cs | 1 + .../Interop/PInvoke/Delegate/DelegateTest.cs | 1 + .../Interop/PInvoke/Generics/GenericsTest.cs | 1 + .../Interop/PInvoke/Int128/Int128Test.cs | 1 + .../Miscellaneous/HandleRef/HandleRefTest.cs | 1 + .../MAWSPITest.cs | 16 +-- .../PInvoke/Primitives/Int/PInvokeIntTest.cs | 5 +- .../PInvoke/Primitives/Pointer/Program.cs | 1 + .../RuntimeHandles/RuntimeHandlesTest.cs | 1 + .../InvalidSafeHandleMarshallingTests.cs | 1 + .../SafeHandles/ReliableUnmarshalTest.cs | 1 + .../SafeHandles/SafeHandleLifetimeTests.cs | 1 + .../PInvoke/SafeHandles/SafeHandleTests.cs | 1 + .../PInvoke/SetLastError/SetLastErrorTest.cs | 1 + .../PInvoke/PassingByOut/PassingByOutTest.cs | 1 + .../PInvoke/PassingByRef/PassingByRefTest.cs | 1 + .../PassingByOut/PassingByOutTest.cs | 1 + .../PassingByRef/PassingByRefTest.cs | 1 + .../Interop/PInvoke/Varargs/VarargsTest.cs | 1 + .../Interop/PInvoke/Variant/VariantTest.cs | 1 + .../PInvoke/Vector2_3_4/Vector2_3_4.cs | 2 +- .../PrimitiveMarshalling/Bool/BoolTest.cs | 21 ++-- .../EnumMarshalling/MarshalEnumManaged.cs | 3 +- .../UIntPtr/PInvokeUIntPtrTest.cs | 1 + .../Interop/RefCharArray/RefCharArrayTest.cs | 1 + .../SimpleStruct/SimpleStructManaged.cs | 1 + .../Common/StringBuilderTests.cs | 1 + .../Common/StringInStructTests.cs | 1 + .../StringMarshalling/Common/StringTests.cs | 1 + .../StringMarshalling/LPTSTR/LPTSTRTest.cs | 1 + .../StringMarshalling/UTF8/UTF8Test.cs | 1 + .../PInvoke/MarshalStructAsLayoutExp.cs | 113 +++++++++--------- .../PInvoke/MarshalStructAsLayoutSeq.cs | 1 + .../StructMarshalling/PInvoke/NestedStruct.cs | 1 + .../DelegatePInvoke/DelegatePInvokeTest.cs | 1 + .../ReversePInvokeTest.cs | 1 + .../DelegatePInvoke/DelegatePInvokeTest.cs | 1 + .../ReversePInvoke/ReversePInvokeTest_.cs | 1 + .../SuppressGCTransitionNegativeTest.cs | 1 + .../SuppressGCTransitionTest.cs | 1 + .../UnmanagedCallConvTest.cs | 1 + .../UnmanagedCallersOnlyTest.cs | 1 + .../UnmanagedCallersOnlyBasicTest.cs | 1 + 82 files changed, 163 insertions(+), 88 deletions(-) diff --git a/src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs b/src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs index a23694a191edbe..56581dc9ea7723 100644 --- a/src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs +++ b/src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs @@ -51,5 +51,9 @@ public static bool IsNonZeroLowerBoundArraySupported public static bool IsMonoLLVMAOT => _variant == "llvmaot"; public static bool IsMonoLLVMFULLAOT => _variant == "llvmfullaot"; public static bool IsMonoInterpreter => _variant == "monointerpreter"; + + // These platforms have not had their infrastructure updated to support native test assets. + public static bool PlatformDoesNotSupportNativeTestAssets => + OperatingSystem.IsIOS() || OperatingSystem.IsTvOS() || OperatingSystem.IsWatchOS() || OperatingSystem.IsAndroid() || OperatingSystem.IsBrowser() || OperatingSystem.IsWasi(); } } diff --git a/src/tests/Interop/ArrayMarshalling/BoolArray/MarshalBoolArrayTest.cs b/src/tests/Interop/ArrayMarshalling/BoolArray/MarshalBoolArrayTest.cs index 8aa58d6d215a33..513ab0b1b4e36b 100644 --- a/src/tests/Interop/ArrayMarshalling/BoolArray/MarshalBoolArrayTest.cs +++ b/src/tests/Interop/ArrayMarshalling/BoolArray/MarshalBoolArrayTest.cs @@ -17,6 +17,7 @@ using TestLibrary; using Xunit; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class MarshalBoolArray { #region"variable" diff --git a/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.cs b/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.cs index 1935e223b35c8c..b3504dd9b397ea 100644 --- a/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.cs +++ b/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.cs @@ -9,6 +9,7 @@ #pragma warning disable CS0612, CS0618 +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class SafeArrayMarshallingTest { [ConditionalFact(typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.IsBuiltInComEnabled))] diff --git a/src/tests/Interop/BestFitMapping/BestFitMapping.cs b/src/tests/Interop/BestFitMapping/BestFitMapping.cs index 0919f7c106d0e4..e4f65d8bd9d6ba 100644 --- a/src/tests/Interop/BestFitMapping/BestFitMapping.cs +++ b/src/tests/Interop/BestFitMapping/BestFitMapping.cs @@ -8,6 +8,7 @@ using TestLibrary; using Xunit; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class BestFitMapping { diff --git a/src/tests/Interop/DisabledRuntimeMarshalling/AutoLayout.cs b/src/tests/Interop/DisabledRuntimeMarshalling/AutoLayout.cs index 19a8b916408dd3..24faa552f1e3cb 100644 --- a/src/tests/Interop/DisabledRuntimeMarshalling/AutoLayout.cs +++ b/src/tests/Interop/DisabledRuntimeMarshalling/AutoLayout.cs @@ -8,6 +8,7 @@ namespace DisabledRuntimeMarshalling; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public unsafe class PInvokes_AutoLayout { [Fact] diff --git a/src/tests/Interop/DisabledRuntimeMarshalling/FunctionPointers.cs b/src/tests/Interop/DisabledRuntimeMarshalling/FunctionPointers.cs index 5bfef01c8939ad..3f965ca41c69e1 100644 --- a/src/tests/Interop/DisabledRuntimeMarshalling/FunctionPointers.cs +++ b/src/tests/Interop/DisabledRuntimeMarshalling/FunctionPointers.cs @@ -8,6 +8,7 @@ namespace DisabledRuntimeMarshalling; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public unsafe class FunctionPointers { [Fact] diff --git a/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingDisabled/Delegates.cs b/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingDisabled/Delegates.cs index eb0da36bc3758d..711684eb9b2818 100644 --- a/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingDisabled/Delegates.cs +++ b/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingDisabled/Delegates.cs @@ -8,6 +8,7 @@ namespace DisabledRuntimeMarshalling.PInvokeAssemblyMarshallingDisabled; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public unsafe class DelegatesFromExternalAssembly { [Fact] diff --git a/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingDisabled/Generics.cs b/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingDisabled/Generics.cs index 2dce35f5155207..766ed7d32dd80d 100644 --- a/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingDisabled/Generics.cs +++ b/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingDisabled/Generics.cs @@ -10,6 +10,7 @@ namespace DisabledRuntimeMarshalling; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public unsafe class Generics { [Fact] diff --git a/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingDisabled/PInvokes.cs b/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingDisabled/PInvokes.cs index 72e919b0f30878..8eea4519007022 100644 --- a/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingDisabled/PInvokes.cs +++ b/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingDisabled/PInvokes.cs @@ -9,6 +9,7 @@ namespace DisabledRuntimeMarshalling.PInvokeAssemblyMarshallingDisabled; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class PInvokes { diff --git a/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingDisabled/UnmanagedCallersOnly.cs b/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingDisabled/UnmanagedCallersOnly.cs index 932fa7aaf43619..0275f02ca383a0 100644 --- a/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingDisabled/UnmanagedCallersOnly.cs +++ b/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingDisabled/UnmanagedCallersOnly.cs @@ -9,6 +9,7 @@ namespace DisabledRuntimeMarshalling.PInvokeAssemblyMarshallingDisabled; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public unsafe class UnmanagedCallersOnly { [Fact] diff --git a/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingEnabled/Delegates.cs b/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingEnabled/Delegates.cs index a875a9dd749cd5..365b16cdb57fbb 100644 --- a/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingEnabled/Delegates.cs +++ b/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingEnabled/Delegates.cs @@ -8,6 +8,7 @@ namespace DisabledRuntimeMarshalling.PInvokeAssemblyMarshallingEnabled; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public unsafe class DelegatesFromExternalAssembly { [Fact] diff --git a/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingEnabled/PInvokes.cs b/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingEnabled/PInvokes.cs index 5ac046b5919007..94c0aa63866dc0 100644 --- a/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingEnabled/PInvokes.cs +++ b/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingEnabled/PInvokes.cs @@ -8,6 +8,7 @@ namespace DisabledRuntimeMarshalling.PInvokeAssemblyMarshallingEnabled; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class PInvokes { public static bool IsWindowsX86Process => OperatingSystem.IsWindows() && RuntimeInformation.ProcessArchitecture == Architecture.X86; diff --git a/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingEnabled/UnmanagedCallersOnly.cs b/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingEnabled/UnmanagedCallersOnly.cs index 6f94ad67f6b975..f37703824e7911 100644 --- a/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingEnabled/UnmanagedCallersOnly.cs +++ b/src/tests/Interop/DisabledRuntimeMarshalling/PInvokeAssemblyMarshallingEnabled/UnmanagedCallersOnly.cs @@ -9,6 +9,7 @@ namespace DisabledRuntimeMarshalling.PInvokeAssemblyMarshallingDisabled; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public unsafe class UnmanagedCallersOnly { diff --git a/src/tests/Interop/DllImportAttribute/DllImportPath/DllImportPathTest.cs b/src/tests/Interop/DllImportAttribute/DllImportPath/DllImportPathTest.cs index c169e7a9b303e1..301e988f2c3bc8 100644 --- a/src/tests/Interop/DllImportAttribute/DllImportPath/DllImportPathTest.cs +++ b/src/tests/Interop/DllImportAttribute/DllImportPath/DllImportPathTest.cs @@ -7,6 +7,7 @@ using System.Runtime.InteropServices; using Xunit; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class Test { private const string RelativeSubdirectoryName = "RelativeNative"; diff --git a/src/tests/Interop/DllImportAttribute/ExactSpelling/ExactSpellingTest.cs b/src/tests/Interop/DllImportAttribute/ExactSpelling/ExactSpellingTest.cs index e083fff3c8bfcc..445bbfe19e9b15 100644 --- a/src/tests/Interop/DllImportAttribute/ExactSpelling/ExactSpellingTest.cs +++ b/src/tests/Interop/DllImportAttribute/ExactSpelling/ExactSpellingTest.cs @@ -5,6 +5,7 @@ using System.Runtime.InteropServices; using Xunit; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class ExactSpellingTest { class Ansi diff --git a/src/tests/Interop/DllImportSearchPaths/DllImportSearchPathsTest.cs b/src/tests/Interop/DllImportSearchPaths/DllImportSearchPathsTest.cs index 644bb79ac54bb6..b86a77cbc521e1 100644 --- a/src/tests/Interop/DllImportSearchPaths/DllImportSearchPathsTest.cs +++ b/src/tests/Interop/DllImportSearchPaths/DllImportSearchPathsTest.cs @@ -7,6 +7,7 @@ using System.Runtime.InteropServices; using Xunit; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class DllImportSearchPathsTest { private static string Subdirectory => Path.Combine(NativeLibraryToLoad.GetDirectory(), "subdirectory"); diff --git a/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs b/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs index 09a1ea26aff100..e98605c1a0ebf1 100644 --- a/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs +++ b/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs @@ -14,6 +14,7 @@ public class FakeInjectedCode static int ParseArgument(String argument) { return int.Parse(argument);} } +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class Program { public static class NativeMethods @@ -57,6 +58,7 @@ static int TestExecuteInAppDomain(string assemblyPath, string typeName, string m } [Fact] + [SkipOnMono("The legacy CoreCLR activation API is not supported on Mono.")] public static int TestEntryPoint() { int result = 100; diff --git a/src/tests/Interop/FuncPtrAsDelegateParam/FuncPtrAsDelegateParamManaged.cs b/src/tests/Interop/FuncPtrAsDelegateParam/FuncPtrAsDelegateParamManaged.cs index 001e81b4018252..8ca6d9b7aba316 100644 --- a/src/tests/Interop/FuncPtrAsDelegateParam/FuncPtrAsDelegateParamManaged.cs +++ b/src/tests/Interop/FuncPtrAsDelegateParam/FuncPtrAsDelegateParamManaged.cs @@ -7,6 +7,7 @@ //Value Pass N-->M M--->N //Cdecl -1 678 +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class Test_FuncPtrAsDelegateParamManaged { //TestMethod1 @@ -41,7 +42,7 @@ public static int TestEntryPoint() breturn = false; TestFramework.LogError("04","The Return value(DoCallBack_Cdecl) is wrong"); } - + return breturn ? 100: 101; } } diff --git a/src/tests/Interop/ICustomMarshaler/ConflictingNames/RunInALC.cs b/src/tests/Interop/ICustomMarshaler/ConflictingNames/RunInALC.cs index 9a6303ca179767..5798683e622d1b 100644 --- a/src/tests/Interop/ICustomMarshaler/ConflictingNames/RunInALC.cs +++ b/src/tests/Interop/ICustomMarshaler/ConflictingNames/RunInALC.cs @@ -8,6 +8,7 @@ using System.Runtime.Loader; using Xunit; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class RunInALC { [Fact] diff --git a/src/tests/Interop/ICustomMarshaler/ConflictingNames/SameNameDifferentAssembly.cs b/src/tests/Interop/ICustomMarshaler/ConflictingNames/SameNameDifferentAssembly.cs index 09d605cf2e02c9..dae10d32ec17a4 100644 --- a/src/tests/Interop/ICustomMarshaler/ConflictingNames/SameNameDifferentAssembly.cs +++ b/src/tests/Interop/ICustomMarshaler/ConflictingNames/SameNameDifferentAssembly.cs @@ -8,7 +8,8 @@ using System.Runtime.Loader; using Xunit; -public class RunInALC +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] +public class SameNameDifferentAssembly { [Fact] public static int TestEntryPoint() diff --git a/src/tests/Interop/ICustomMarshaler/Primitives/ICustomMarshaler.cs b/src/tests/Interop/ICustomMarshaler/Primitives/ICustomMarshaler.cs index 93719a0f891fcc..7b01b891dd6353 100644 --- a/src/tests/Interop/ICustomMarshaler/Primitives/ICustomMarshaler.cs +++ b/src/tests/Interop/ICustomMarshaler/Primitives/ICustomMarshaler.cs @@ -8,6 +8,7 @@ namespace System.Runtime.InteropServices.Tests { + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class ICustomMarshalerTests { // To avoid having to create a native test library to reference in tests that diff --git a/src/tests/Interop/LayoutClass/LayoutClassTest.cs b/src/tests/Interop/LayoutClass/LayoutClassTest.cs index ad6ee3a396e7c0..6f7015efe24914 100644 --- a/src/tests/Interop/LayoutClass/LayoutClassTest.cs +++ b/src/tests/Interop/LayoutClass/LayoutClassTest.cs @@ -139,6 +139,7 @@ public struct RecursiveTestStruct [SkipOnMono("needs triage")] [ActiveIssue("https://github.com/dotnet/runtime/issues/81673", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class LayoutClassTest { private const string SimpleBlittableSeqLayoutClass_UpdateField = nameof(SimpleBlittableSeqLayoutClass_UpdateField); diff --git a/src/tests/Interop/MarshalAPI/FunctionPointer/FunctionPointer.cs b/src/tests/Interop/MarshalAPI/FunctionPointer/FunctionPointer.cs index f78d8511a06e15..766a37efd00cf0 100644 --- a/src/tests/Interop/MarshalAPI/FunctionPointer/FunctionPointer.cs +++ b/src/tests/Interop/MarshalAPI/FunctionPointer/FunctionPointer.cs @@ -5,6 +5,7 @@ using Xunit; [SkipOnMono("needs triage")] +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public partial class FunctionPtr { static class FunctionPointerNative @@ -25,7 +26,7 @@ static class FunctionPointerNative delegate void VoidDelegate(); [Fact] - + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/164", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void RunGetDelForFcnPtrTest() { diff --git a/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.cs b/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.cs index 8275eb603cd590..eda2520c25d478 100644 --- a/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.cs +++ b/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.cs @@ -213,8 +213,7 @@ public bool Initialize() return true; } - [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNotNativeAot))] - [PlatformSpecific(TestPlatforms.Windows)] + [ConditionalFact(typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.IsBuiltInComEnabled))] [SkipOnMono("Requires COM support")] [ActiveIssue("https://github.com/dotnet/runtime/issues/85234", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsGCStress))] public static void Run() @@ -224,8 +223,7 @@ public static void Run() testObj.RunTests(); } - [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNotNativeAot))] - [PlatformSpecific(TestPlatforms.Windows)] + [ConditionalFact(typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.IsBuiltInComEnabled))] [SkipOnMono("Requires COM support")] [ActiveIssue("https://github.com/dotnet/runtime/issues/85234", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsGCStress))] public static void RunInALC() diff --git a/src/tests/Interop/ObjectiveC/AutoReleaseTest/AutoReleaseTest.cs b/src/tests/Interop/ObjectiveC/AutoReleaseTest/AutoReleaseTest.cs index b5e084e0cfed2f..dbf559150e3cb2 100644 --- a/src/tests/Interop/ObjectiveC/AutoReleaseTest/AutoReleaseTest.cs +++ b/src/tests/Interop/ObjectiveC/AutoReleaseTest/AutoReleaseTest.cs @@ -16,6 +16,7 @@ internal static unsafe class ObjectiveC public static extern int getNumReleaseCalls(); } +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class AutoReleaseTest { [Fact] diff --git a/src/tests/Interop/ObjectiveC/ObjectiveCMarshalAPI/Program.cs b/src/tests/Interop/ObjectiveC/ObjectiveCMarshalAPI/Program.cs index ba8846ffa512f5..d1d273c885de88 100644 --- a/src/tests/Interop/ObjectiveC/ObjectiveCMarshalAPI/Program.cs +++ b/src/tests/Interop/ObjectiveC/ObjectiveCMarshalAPI/Program.cs @@ -438,6 +438,7 @@ static void Validate_Initialize_FailsOnSecondAttempt() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.cs b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.cs index 4c6b7421251d1d..2874007823a959 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.cs +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.cs @@ -1180,6 +1180,7 @@ static void RunTest6(string report) [Fact] [SkipOnMono("needs triage")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs index 6fc009e995f780..8101ea28150287 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs @@ -424,6 +424,7 @@ static void RunTest4(string report) [Fact] [SkipOnMono("needs triage")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs index 5d5860c49b9f2a..ea25028fd43c12 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs @@ -657,6 +657,7 @@ private static void TestMultidimensional() [Fact] [SkipOnMono("needs triage")] [ActiveIssue("https://github.com/dotnet/runtime/issues/81674", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs index 7685d6db23ccde..c51e0ec9e0ec20 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs @@ -635,6 +635,7 @@ public static bool IsCorrect(S2[] actual, S2[] expected) [Fact] [SkipOnMono("needs triage")] [ActiveIssue("https://github.com/dotnet/runtime/issues/81674", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try{ diff --git a/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.cs b/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.cs index 2dd83f9d331dc9..7003c2c8d26a30 100644 --- a/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.cs +++ b/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.cs @@ -11,6 +11,7 @@ public unsafe class ArrayWithOffsetTest [Fact] [SkipOnMono("needs triage")] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/170", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/PInvoke/AsAny/AsAnyTest.cs b/src/tests/Interop/PInvoke/AsAny/AsAnyTest.cs index c22dc8039fadf4..f53a66919e1cf1 100644 --- a/src/tests/Interop/PInvoke/AsAny/AsAnyTest.cs +++ b/src/tests/Interop/PInvoke/AsAny/AsAnyTest.cs @@ -298,6 +298,7 @@ public static extern bool PassAnsiCharArrayFF( [Fact] [SkipOnMono("needs triage")] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/169", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.cs b/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.cs index fdec3c7c97e08f..b46dbd536c119e 100644 --- a/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.cs +++ b/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.cs @@ -32,6 +32,7 @@ private static string Reverse(string s) [PlatformSpecific(TestPlatforms.Windows)] [SkipOnMono("PInvoke LCIDConversionAttribute not supported on Mono")] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Program.cs b/src/tests/Interop/PInvoke/BestFitMapping/Program.cs index 1b74451a1c5b91..8c7019f3c91600 100644 --- a/src/tests/Interop/PInvoke/BestFitMapping/Program.cs +++ b/src/tests/Interop/PInvoke/BestFitMapping/Program.cs @@ -14,6 +14,7 @@ public class Program [PlatformSpecific(TestPlatforms.Windows)] [SkipOnMono("Mono doesn't support interop BestFitMapping and ThrowOnUnmappableChar attributes")] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static void TestEntryPoint() { if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") diff --git a/src/tests/Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest.cs b/src/tests/Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest.cs index c68ebc593fefd9..352c44cda8bb20 100644 --- a/src/tests/Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest.cs +++ b/src/tests/Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest.cs @@ -83,6 +83,7 @@ internal class Native internal static extern IntPtr SetIsHandleClosedCallback([MarshalAs(UnmanagedType.FunctionPtr)]IsHandleClosed isHandleClosed); } +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class CriticalHandleArrayTest { private static Native.IsHandleClosed s_isHandleClose = (handleValue) => diff --git a/src/tests/Interop/PInvoke/CriticalHandles/ReverseTest/ReverseTest.cs b/src/tests/Interop/PInvoke/CriticalHandles/ReverseTest/ReverseTest.cs index 0934092e372bc7..a9ed6db95e10f5 100644 --- a/src/tests/Interop/PInvoke/CriticalHandles/ReverseTest/ReverseTest.cs +++ b/src/tests/Interop/PInvoke/CriticalHandles/ReverseTest/ReverseTest.cs @@ -56,6 +56,7 @@ internal static bool IsHandleClosed(IntPtr handle) } } +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class Reverse { public static void In() diff --git a/src/tests/Interop/PInvoke/CriticalHandles/StructTest/StructTest.cs b/src/tests/Interop/PInvoke/CriticalHandles/StructTest/StructTest.cs index ccb7a14cdc5f80..b291afb6906afc 100644 --- a/src/tests/Interop/PInvoke/CriticalHandles/StructTest/StructTest.cs +++ b/src/tests/Interop/PInvoke/CriticalHandles/StructTest/StructTest.cs @@ -56,6 +56,7 @@ internal static bool IsHandleClosed(IntPtr handle) } } +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class CriticalHandleStructTest { private static Native.HandleCallback s_handleCallback = (handleValue) => diff --git a/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.cs b/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.cs index 9edf98028b6a5a..b6980a20fa2c07 100644 --- a/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.cs +++ b/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.cs @@ -30,6 +30,7 @@ public static class CustomMarshalersTests [PlatformSpecific(TestPlatforms.Windows)] [SkipOnMono("These custom marshallers were never built-in to the runtime on Mono")] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/PInvoke/DateTime/DateTimeTest.cs b/src/tests/Interop/PInvoke/DateTime/DateTimeTest.cs index d6b0dccef2fcfa..a0c3f6f574789c 100644 --- a/src/tests/Interop/PInvoke/DateTime/DateTimeTest.cs +++ b/src/tests/Interop/PInvoke/DateTime/DateTimeTest.cs @@ -27,6 +27,7 @@ public class DateTimeTest { [Fact] [SkipOnMono("needs triage")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static void TestEntryPoint() { DateTime currentDate = new DateTime(2019, 5, 2); diff --git a/src/tests/Interop/PInvoke/Decimal/DecimalTest.cs b/src/tests/Interop/PInvoke/Decimal/DecimalTest.cs index bcb9b27073a92c..25a0f4a3747f81 100644 --- a/src/tests/Interop/PInvoke/Decimal/DecimalTest.cs +++ b/src/tests/Interop/PInvoke/Decimal/DecimalTest.cs @@ -6,6 +6,7 @@ using Xunit; [SkipOnMono("needs triage")] +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class DecimalTest { private const int StartingIntValue = 42; diff --git a/src/tests/Interop/PInvoke/Delegate/DelegateTest.cs b/src/tests/Interop/PInvoke/Delegate/DelegateTest.cs index dac92476fa0bc3..da2ea71dbcde9d 100644 --- a/src/tests/Interop/PInvoke/Delegate/DelegateTest.cs +++ b/src/tests/Interop/PInvoke/Delegate/DelegateTest.cs @@ -8,6 +8,7 @@ using static DelegateTestNative; [SkipOnMono("needs triage")] +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class DelegateTest { [Fact] diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.cs index c78c855c013f38..5697feb35820aa 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.cs @@ -46,6 +46,7 @@ public class SequentialClass where T : struct } [SkipOnMono("needs triage")] +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public partial class GenericsTest { diff --git a/src/tests/Interop/PInvoke/Int128/Int128Test.cs b/src/tests/Interop/PInvoke/Int128/Int128Test.cs index 428fb9a11f6570..56bed4f2bfe0ec 100644 --- a/src/tests/Interop/PInvoke/Int128/Int128Test.cs +++ b/src/tests/Interop/PInvoke/Int128/Int128Test.cs @@ -99,6 +99,7 @@ unsafe partial class Int128Native public static extern Int128 AddInt128s(in Int128 pValues, int count); } +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public unsafe partial class Int128Native { [Fact] diff --git a/src/tests/Interop/PInvoke/Miscellaneous/HandleRef/HandleRefTest.cs b/src/tests/Interop/PInvoke/Miscellaneous/HandleRef/HandleRefTest.cs index b863154d60fd66..ea43507c0cd1ef 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/HandleRef/HandleRefTest.cs +++ b/src/tests/Interop/PInvoke/Miscellaneous/HandleRef/HandleRefTest.cs @@ -25,6 +25,7 @@ public class HandleRefTest private static extern HandleRef InvalidMarshalPointer_Return(); [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public unsafe static int TestEntryPoint() { try{ diff --git a/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/MAWSPITest.cs b/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/MAWSPITest.cs index e9afcf855ccd33..7de6205ab999e9 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/MAWSPITest.cs +++ b/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/MAWSPITest.cs @@ -11,17 +11,11 @@ public class MultipleAssembliesWithSamePInvokeTest private static extern int GetInt(); [Fact] - public static int TestEntryPoint() + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] + public static void Test() { - try{ - Assert.Equal(24, GetInt()); - Assert.Equal(24, ManagedDll1.Class1.GetInt()); - Assert.Equal(24, ManagedDll2.Class2.GetInt()); - - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } + Assert.Equal(24, GetInt()); + Assert.Equal(24, ManagedDll1.Class1.GetInt()); + Assert.Equal(24, ManagedDll2.Class2.GetInt()); } } diff --git a/src/tests/Interop/PInvoke/Primitives/Int/PInvokeIntTest.cs b/src/tests/Interop/PInvoke/Primitives/Int/PInvokeIntTest.cs index e3bc51e7bb1b4e..8ee64072d78cd0 100644 --- a/src/tests/Interop/PInvoke/Primitives/Int/PInvokeIntTest.cs +++ b/src/tests/Interop/PInvoke/Primitives/Int/PInvokeIntTest.cs @@ -5,6 +5,7 @@ using System; using Xunit; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class ClientPInvokeIntNativeTest { [DllImport("PInvokeIntNative")] @@ -27,7 +28,7 @@ public class ClientPInvokeIntNativeTest [DllImport("PInvokeIntNative")] private static extern int Marshal_InMany([In]short i1, [In]short i2, [In]short i3, [In]short i4, [In]short i5, [In]short i6, [In]short i7, [In]short i8, [In]short i9, [In]short i10, [In]short i11, [In]byte i12, [In]byte i13, [In]int i14, [In]short i15); - + [DllImport("PInvokeIntNative")] private static extern int Marshal_InMany_InOutPointer([In]short i1, [In]short i2, [In]short i3, [In]short i4, [In]short i5, [In]short i6, [In]short i7, [In]short i8, [In]short i9, [In]short i10, [In]short i11, [In]byte i12, [In]byte i13, [In]int i14, [In]short i15, ref int pintValue); @@ -112,7 +113,7 @@ public static int TestEntryPoint() failures++; Console.WriteLine("InMany return value is wrong"); } - + int int7 = intManaged; if(120 != Marshal_InMany_InOutPointer(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ref int7)) { diff --git a/src/tests/Interop/PInvoke/Primitives/Pointer/Program.cs b/src/tests/Interop/PInvoke/Primitives/Pointer/Program.cs index ff0177668c298e..57663d03a8c0d6 100644 --- a/src/tests/Interop/PInvoke/Primitives/Pointer/Program.cs +++ b/src/tests/Interop/PInvoke/Primitives/Pointer/Program.cs @@ -13,6 +13,7 @@ static class NonBlittablePointerNative public static unsafe extern void Negate(bool* ptr); } + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class Program { [Fact] diff --git a/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.cs b/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.cs index fec823c81f9d8f..ab696de75f67c0 100644 --- a/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.cs +++ b/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.cs @@ -7,6 +7,7 @@ using Xunit; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class RuntimeHandlesTest { class TestClass diff --git a/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs b/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs index 0459a8c50daa13..9346fdc04feb43 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs @@ -11,6 +11,7 @@ namespace SafeHandleTests public class InvalidSafeHandleMarshallingTests { [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] [ActiveIssue("https://github.com/dotnet/runtime/issues/48084", TestRuntimes.Mono)] public static void RunTest() { diff --git a/src/tests/Interop/PInvoke/SafeHandles/ReliableUnmarshalTest.cs b/src/tests/Interop/PInvoke/SafeHandles/ReliableUnmarshalTest.cs index 47fbc0c62b9406..3324dd6d97ff43 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/ReliableUnmarshalTest.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/ReliableUnmarshalTest.cs @@ -11,6 +11,7 @@ namespace SafeHandleTests public class ReliableUnmarshalTest { [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] [ActiveIssue("https://github.com/dotnet/runtime/issues/48084", TestRuntimes.Mono)] public static void RunTest() { diff --git a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs index 0ef40a26d13e98..fb174961ac536d 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs @@ -15,6 +15,7 @@ public class SafeHandleLifetimeTests [Fact] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/168", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] [ActiveIssue("https://github.com/dotnet/runtime/issues/48084", TestRuntimes.Mono)] public static void RunTest() { diff --git a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs index a7eafda8ac309c..87714ee4297ad4 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs @@ -15,6 +15,7 @@ public class SafeHandleTest [Fact] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/168", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] [ActiveIssue("https://github.com/dotnet/runtime/issues/48084", TestRuntimes.Mono)] public static void RunTest() { diff --git a/src/tests/Interop/PInvoke/SetLastError/SetLastErrorTest.cs b/src/tests/Interop/PInvoke/SetLastError/SetLastErrorTest.cs index 96b6d25cbe4caa..5acc07484d0b29 100644 --- a/src/tests/Interop/PInvoke/SetLastError/SetLastErrorTest.cs +++ b/src/tests/Interop/PInvoke/SetLastError/SetLastErrorTest.cs @@ -63,6 +63,7 @@ public static void ClearPreviousError() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs index dd9c518c311946..d753f8961348b9 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs @@ -232,6 +232,7 @@ static void SizeParamTypeIsString() [Fact] [SkipOnMono("needs triage")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try{ diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.cs b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.cs index 2b61abc66b0fb6..ce270f927fcd94 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.cs @@ -241,6 +241,7 @@ static void SizeParamTypeIsString() [Fact] [SkipOnMono("needs triage")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try{ diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs index 7f21eb2a3df308..5177ad15d5dc30 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs @@ -196,6 +196,7 @@ public static void RunTestByOut() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34196", TestRuntimes.Mono)] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/167", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try{ diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs index 25f74a66d15047..174efb9d14a130 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs @@ -211,6 +211,7 @@ public static void RunTestByRef() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34196", TestRuntimes.Mono)] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/167", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try{ diff --git a/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs b/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs index 4275ef7e4c0db1..e36cfc158066ba 100644 --- a/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs +++ b/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs @@ -38,6 +38,7 @@ private static bool AssertEqual(string lhs, string rhs) [PlatformSpecific(TestPlatforms.Windows)] [SkipOnMono("PInvoke Varargs/ArgIterator marshalling not supported on Mono")] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { var passed = true; diff --git a/src/tests/Interop/PInvoke/Variant/VariantTest.cs b/src/tests/Interop/PInvoke/Variant/VariantTest.cs index 26829d8b34cbd3..9b1b80393d0e63 100644 --- a/src/tests/Interop/PInvoke/Variant/VariantTest.cs +++ b/src/tests/Interop/PInvoke/Variant/VariantTest.cs @@ -20,6 +20,7 @@ public class GenerateIClassX public DateTime FieldValueType; } +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] partial class Test_VariantTest { private const byte NumericValue = 15; diff --git a/src/tests/Interop/PInvoke/Vector2_3_4/Vector2_3_4.cs b/src/tests/Interop/PInvoke/Vector2_3_4/Vector2_3_4.cs index c8e1dcb65fe89d..4a79cdbb181928 100644 --- a/src/tests/Interop/PInvoke/Vector2_3_4/Vector2_3_4.cs +++ b/src/tests/Interop/PInvoke/Vector2_3_4/Vector2_3_4.cs @@ -12,7 +12,7 @@ public class Vector2_3_4Test private const int NewIntValue = 18; [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/93669", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static void RunVector2Tests() { Console.WriteLine($"Running {nameof(RunVector2Tests)}... "); diff --git a/src/tests/Interop/PrimitiveMarshalling/Bool/BoolTest.cs b/src/tests/Interop/PrimitiveMarshalling/Bool/BoolTest.cs index 38c52abea2e6b8..bd1fe40a512939 100644 --- a/src/tests/Interop/PrimitiveMarshalling/Bool/BoolTest.cs +++ b/src/tests/Interop/PrimitiveMarshalling/Bool/BoolTest.cs @@ -14,10 +14,11 @@ public class Test static void ReportFailure(string describe, bool expect, bool actual) { - throw new Exception(" === Fail: " + describe + "\n\tExpected:" + expect + "\n\tActual:" + actual); + throw new Exception(" === Fail: " + describe + "\n\tExpected:" + expect + "\n\tActual:" + actual); } - + [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static void TestEntryPoint() { //Test Method1 @@ -86,7 +87,7 @@ public static void TestEntryPoint() if (boolValue6 != boolNative) { ReportFailure("Method Marshal_Out[Managed Side],The passed value is wrong", boolNative, boolValue6); - } + } //Test Method7 bool boolValue7 = boolManaged; @@ -128,12 +129,12 @@ public static void TestEntryPoint() private static void TestVariantBool() { - + if (!BoolNative.Marshal_ByValue_Variant(true, true)) { ReportFailure("Method Marshal_ByValue_Variant[Managed Side], The return value is wrong", true, true); } - + if (!BoolNative.Marshal_ByValue_Variant(false, false)) { ReportFailure("Method Marshal_ByValue_Variant[Managed Side], The return value is wrong", false, false); @@ -149,8 +150,8 @@ private static void TestVariantBool() if (boolValue10 != boolNative) { ReportFailure("Method Marshal_Ref_Variant[Managed Side],The passed value is wrong", boolNative, boolValue10); - } - + } + var trueStruct = new BoolNative.ContainsVariantBool { value = true @@ -160,12 +161,12 @@ private static void TestVariantBool() { value = false }; - + if (!BoolNative.Marshal_ByValue_Struct_Variant(trueStruct, true)) { ReportFailure("Method Marshal_ByValue_Variant[Managed Side], The return value is wrong", true, true); } - + if (!BoolNative.Marshal_ByValue_Struct_Variant(falseStruct, false)) { ReportFailure("Method Marshal_ByValue_Variant[Managed Side], The return value is wrong", false, false); @@ -175,7 +176,7 @@ private static void TestVariantBool() { value = boolManaged }; - + bool boolValueRet11 = BoolNative.Marshal_Ref_Struct_Variant(ref boolValue11); if (!boolValueRet11) diff --git a/src/tests/Interop/PrimitiveMarshalling/EnumMarshalling/MarshalEnumManaged.cs b/src/tests/Interop/PrimitiveMarshalling/EnumMarshalling/MarshalEnumManaged.cs index c7fe40923d4f5d..21d7c80e35cc9c 100644 --- a/src/tests/Interop/PrimitiveMarshalling/EnumMarshalling/MarshalEnumManaged.cs +++ b/src/tests/Interop/PrimitiveMarshalling/EnumMarshalling/MarshalEnumManaged.cs @@ -38,6 +38,7 @@ public enum DialogResult #endregion [System.Security.SecuritySafeCritical] [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { bool result = true; @@ -63,7 +64,7 @@ public static int TestEntryPoint() TestFramework.LogError("04", "Main : Returned value of enum doesn't match with the value passed in to pinvoke call"); return 101; } - + return 100; } } diff --git a/src/tests/Interop/PrimitiveMarshalling/UIntPtr/PInvokeUIntPtrTest.cs b/src/tests/Interop/PrimitiveMarshalling/UIntPtr/PInvokeUIntPtrTest.cs index 18ecdb02595762..be075d82c31fa1 100644 --- a/src/tests/Interop/PrimitiveMarshalling/UIntPtr/PInvokeUIntPtrTest.cs +++ b/src/tests/Interop/PrimitiveMarshalling/UIntPtr/PInvokeUIntPtrTest.cs @@ -29,6 +29,7 @@ public class Test [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static void TestEntryPoint() { UIntPtr uintPtrManaged = (UIntPtr)1000; diff --git a/src/tests/Interop/RefCharArray/RefCharArrayTest.cs b/src/tests/Interop/RefCharArray/RefCharArrayTest.cs index a71814269f528b..3723177e541dd9 100644 --- a/src/tests/Interop/RefCharArray/RefCharArrayTest.cs +++ b/src/tests/Interop/RefCharArray/RefCharArrayTest.cs @@ -250,6 +250,7 @@ private static bool TestMethod_DelegatePInvokeStdcall() [Fact] [OuterLoop] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { bool bresult = true; diff --git a/src/tests/Interop/SimpleStruct/SimpleStructManaged.cs b/src/tests/Interop/SimpleStruct/SimpleStructManaged.cs index 91eb0554476466..ff9d026337bcce 100644 --- a/src/tests/Interop/SimpleStruct/SimpleStructManaged.cs +++ b/src/tests/Interop/SimpleStruct/SimpleStructManaged.cs @@ -512,6 +512,7 @@ public static bool AutoStructNegativeTest() [Fact] [OuterLoop] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { bool retVal = true; diff --git a/src/tests/Interop/StringMarshalling/Common/StringBuilderTests.cs b/src/tests/Interop/StringMarshalling/Common/StringBuilderTests.cs index 42bb85d029e0a1..f09305a2a03046 100644 --- a/src/tests/Interop/StringMarshalling/Common/StringBuilderTests.cs +++ b/src/tests/Interop/StringMarshalling/Common/StringBuilderTests.cs @@ -9,6 +9,7 @@ using static StringMarshalingTestNative; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public partial class StringBuilderTests { private static readonly string InitialString = "Hello World"; diff --git a/src/tests/Interop/StringMarshalling/Common/StringInStructTests.cs b/src/tests/Interop/StringMarshalling/Common/StringInStructTests.cs index 564a29827a5938..b51fc9de8516c6 100644 --- a/src/tests/Interop/StringMarshalling/Common/StringInStructTests.cs +++ b/src/tests/Interop/StringMarshalling/Common/StringInStructTests.cs @@ -9,6 +9,7 @@ using static StringMarshalingTestNative; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public partial class StringInStructTests { private static readonly string InitialString = "Hello World"; diff --git a/src/tests/Interop/StringMarshalling/Common/StringTests.cs b/src/tests/Interop/StringMarshalling/Common/StringTests.cs index e8dfd4319f4d53..c3b2384630608a 100644 --- a/src/tests/Interop/StringMarshalling/Common/StringTests.cs +++ b/src/tests/Interop/StringMarshalling/Common/StringTests.cs @@ -9,6 +9,7 @@ using static StringMarshalingTestNative; +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public partial class StringTests { private static readonly string InitialString = "Hello World"; diff --git a/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs b/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs index ef30cf2c995db1..79a92cc60e5ea8 100644 --- a/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs +++ b/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs @@ -32,6 +32,7 @@ public partial class StringInStructTests [OuterLoop] [SkipOnMono("needs triage")] +[ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public class LPTStrTest { private static readonly string InitialString = "Hello World"; diff --git a/src/tests/Interop/StringMarshalling/UTF8/UTF8Test.cs b/src/tests/Interop/StringMarshalling/UTF8/UTF8Test.cs index b0c74d1479fe15..7d0385898b8d51 100644 --- a/src/tests/Interop/StringMarshalling/UTF8/UTF8Test.cs +++ b/src/tests/Interop/StringMarshalling/UTF8/UTF8Test.cs @@ -238,6 +238,7 @@ public class Test [Fact] [OuterLoop] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static void TestEntryPoint() { // Test string as [In,Out] parameter diff --git a/src/tests/Interop/StructMarshalling/PInvoke/MarshalStructAsLayoutExp.cs b/src/tests/Interop/StructMarshalling/PInvoke/MarshalStructAsLayoutExp.cs index eb27b8c508306d..5ce7af01fa58b1 100644 --- a/src/tests/Interop/StructMarshalling/PInvoke/MarshalStructAsLayoutExp.cs +++ b/src/tests/Interop/StructMarshalling/PInvoke/MarshalStructAsLayoutExp.cs @@ -24,6 +24,7 @@ enum StructID [SecuritySafeCritical] [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { RunMarshalStructAsParamAsExpByVal(); @@ -174,7 +175,7 @@ public static int TestEntryPoint() static extern bool MarshalStructAsParam_AsExpByValInOutShortStructPack4Explicit([In, Out] ShortStructPack4Explicit str1); [DllImport("MarshalStructAsParam", EntryPoint = "MarshalStructAsParam_AsExpByRefShortStructPack4Explicit")] static extern bool MarshalStructAsParam_AsExpByRefInOutShortStructPack4Explicit([In, Out] ref ShortStructPack4Explicit str1); - #endregion + #endregion #region Struct(IntStructPack8Explicit) with Layout Explicit scenario8 [DllImport("MarshalStructAsParam")] static extern bool MarshalStructAsParam_AsExpByValIntStructPack8Explicit(IntStructPack8Explicit str1); @@ -220,7 +221,7 @@ public static int TestEntryPoint() static extern bool MarshalStructAsParam_AsExpByValOverlappingLongFloat(OverlappingLongFloat str, long expected); [DllImport("MarshalStructAsParam")] static extern bool MarshalStructAsParam_AsExpByValOverlappingLongFloat(OverlappingLongFloat2 str, long expected); - + [DllImport("MarshalStructAsParam")] static extern bool MarshalStructAsParam_AsExpByValOverlappingMultipleEightByte(OverlappingMultipleEightbyte str, float i1, float i2, float i3); @@ -253,7 +254,7 @@ private static void MarshalStructAsParam_AsExpByVal(StructID id) { failures++; } - break; + break; case StructID.InnerExplicitId: InnerExplicit sourceInnerExplicit = new InnerExplicit(); sourceInnerExplicit.f1 = 1; @@ -332,7 +333,7 @@ private static void MarshalStructAsParam_AsExpByVal(StructID id) failures++; } break; - case StructID.ShortStructPack4ExplicitId: + case StructID.ShortStructPack4ExplicitId: ShortStructPack4Explicit source_sspe = Helper.NewShortStructPack4Explicit(32, 32); ShortStructPack4Explicit clone_sspe = Helper.NewShortStructPack4Explicit(32, 32); Console.WriteLine("\tCalling MarshalStructAsParam_AsExpByValShortStructPack4Explicit..."); @@ -486,7 +487,7 @@ private static void MarshalStructAsParam_AsExpByRef(StructID id) { failures++; } - break; + break; case StructID.InnerExplicitId: InnerExplicit sourceInnerExplicit = new InnerExplicit(); sourceInnerExplicit.f1 = 1; @@ -505,7 +506,7 @@ private static void MarshalStructAsParam_AsExpByRef(StructID id) { failures++; } - break; + break; case StructID.InnerArrayExplicitId: InnerArrayExplicit sourceInnerArrayExplicit = Helper.NewInnerArrayExplicit(1, 1.0F, "some string1", "some string2"); InnerArrayExplicit changeInnerArrayExplicit = Helper.NewInnerArrayExplicit(77, 77.0F, "change string1", "change string2"); @@ -520,7 +521,7 @@ private static void MarshalStructAsParam_AsExpByRef(StructID id) { failures++; } - break; + break; case StructID.OUTER3Id: OUTER3 sourceOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string"); OUTER3 changeOUTER3 = Helper.NewOUTER3(77, 77.0F, "changed string", "changed string"); @@ -535,7 +536,7 @@ private static void MarshalStructAsParam_AsExpByRef(StructID id) { failures++; } - break; + break; case StructID.UId: U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2); U changeU = Helper.NewU(Int32.MaxValue, UInt32.MinValue, new IntPtr(-64), new UIntPtr(64), short.MaxValue, ushort.MinValue, byte.MaxValue, sbyte.MinValue, long.MaxValue, ulong.MinValue, 64.0F, 6.4); @@ -550,7 +551,7 @@ private static void MarshalStructAsParam_AsExpByRef(StructID id) { failures++; } - break; + break; case StructID.ByteStructPack2ExplicitId: ByteStructPack2Explicit source_bspe = Helper.NewByteStructPack2Explicit(32, 32); ByteStructPack2Explicit change_bspe = Helper.NewByteStructPack2Explicit(64, 64); @@ -564,7 +565,7 @@ private static void MarshalStructAsParam_AsExpByRef(StructID id) { failures++; } - break; + break; case StructID.ShortStructPack4ExplicitId: ShortStructPack4Explicit source_sspe = Helper.NewShortStructPack4Explicit(32, 32); ShortStructPack4Explicit change_sspe = Helper.NewShortStructPack4Explicit(64, 64); @@ -606,7 +607,7 @@ private static void MarshalStructAsParam_AsExpByRef(StructID id) { failures++; } - break; + break; default: Console.WriteLine("\tThere is not the struct id"); failures++; @@ -641,7 +642,7 @@ private static void MarshalStructAsParam_AsExpByValIn(StructID id) { failures++; } - break; + break; case StructID.InnerExplicitId: InnerExplicit sourceInnerExplicit = new InnerExplicit(); sourceInnerExplicit.f1 = 1; @@ -660,7 +661,7 @@ private static void MarshalStructAsParam_AsExpByValIn(StructID id) { failures++; } - break; + break; case StructID.InnerArrayExplicitId: InnerArrayExplicit sourceInnerArrayExplicit = Helper.NewInnerArrayExplicit(1, 1.0F, "some string1", "some string2"); InnerArrayExplicit cloneInnerArrayExplicit = Helper.NewInnerArrayExplicit(1, 1.0F, "some string1", "some string2"); @@ -675,7 +676,7 @@ private static void MarshalStructAsParam_AsExpByValIn(StructID id) { failures++; } - break; + break; case StructID.OUTER3Id: OUTER3 sourceOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string"); OUTER3 cloneOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string"); @@ -690,7 +691,7 @@ private static void MarshalStructAsParam_AsExpByValIn(StructID id) { failures++; } - break; + break; case StructID.UId: U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2); U cloneU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2); @@ -705,7 +706,7 @@ private static void MarshalStructAsParam_AsExpByValIn(StructID id) { failures++; } - break; + break; case StructID.ByteStructPack2ExplicitId: ByteStructPack2Explicit source_bspe = Helper.NewByteStructPack2Explicit(32, 32); ByteStructPack2Explicit clone_bspe = Helper.NewByteStructPack2Explicit(32, 32); @@ -719,7 +720,7 @@ private static void MarshalStructAsParam_AsExpByValIn(StructID id) { failures++; } - break; + break; case StructID.ShortStructPack4ExplicitId: ShortStructPack4Explicit source_sspe = Helper.NewShortStructPack4Explicit(32, 32); ShortStructPack4Explicit clone_sspe = Helper.NewShortStructPack4Explicit(32, 32); @@ -733,7 +734,7 @@ private static void MarshalStructAsParam_AsExpByValIn(StructID id) { failures++; } - break; + break; case StructID.IntStructPack8ExplicitId: IntStructPack8Explicit source_ispe = Helper.NewIntStructPack8Explicit(32, 32); IntStructPack8Explicit clone_ispe = Helper.NewIntStructPack8Explicit(32, 32); @@ -761,7 +762,7 @@ private static void MarshalStructAsParam_AsExpByValIn(StructID id) { failures++; } - break; + break; default: Console.WriteLine("\tThere is not the struct id"); failures++; @@ -796,7 +797,7 @@ private static void MarshalStructAsParam_AsExpByRefIn(StructID id) { failures++; } - break; + break; case StructID.InnerExplicitId: InnerExplicit sourceInnerExplicit = new InnerExplicit(); sourceInnerExplicit.f1 = 1; @@ -815,7 +816,7 @@ private static void MarshalStructAsParam_AsExpByRefIn(StructID id) { failures++; } - break; + break; case StructID.InnerArrayExplicitId: InnerArrayExplicit sourceInnerArrayExplicit = Helper.NewInnerArrayExplicit(1, 1.0F, "some string1", "some string2"); InnerArrayExplicit changeInnerArrayExplicit = Helper.NewInnerArrayExplicit(1, 1.0F, "some string1", "some string2"); @@ -830,7 +831,7 @@ private static void MarshalStructAsParam_AsExpByRefIn(StructID id) { failures++; } - break; + break; case StructID.OUTER3Id: OUTER3 sourceOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string"); OUTER3 changeOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string"); @@ -845,7 +846,7 @@ private static void MarshalStructAsParam_AsExpByRefIn(StructID id) { failures++; } - break; + break; case StructID.UId: U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2); U changeU = Helper.NewU(Int32.MaxValue, UInt32.MinValue, new IntPtr(-64), new UIntPtr(64), short.MaxValue, ushort.MinValue, byte.MaxValue, sbyte.MinValue, long.MaxValue, ulong.MinValue, 64.0F, 6.4); @@ -860,7 +861,7 @@ private static void MarshalStructAsParam_AsExpByRefIn(StructID id) { failures++; } - break; + break; case StructID.ByteStructPack2ExplicitId: ByteStructPack2Explicit source_bspe = Helper.NewByteStructPack2Explicit(32, 32); ByteStructPack2Explicit change_bspe = Helper.NewByteStructPack2Explicit(64, 64); @@ -874,7 +875,7 @@ private static void MarshalStructAsParam_AsExpByRefIn(StructID id) { failures++; } - break; + break; case StructID.ShortStructPack4ExplicitId: ShortStructPack4Explicit source_sspe = Helper.NewShortStructPack4Explicit(32, 32); ShortStructPack4Explicit change_sspe = Helper.NewShortStructPack4Explicit(64, 64); @@ -888,7 +889,7 @@ private static void MarshalStructAsParam_AsExpByRefIn(StructID id) { failures++; } - break; + break; case StructID.IntStructPack8ExplicitId: IntStructPack8Explicit source_ispe = Helper.NewIntStructPack8Explicit(32, 32); IntStructPack8Explicit change_ispe = Helper.NewIntStructPack8Explicit(64, 64); @@ -916,7 +917,7 @@ private static void MarshalStructAsParam_AsExpByRefIn(StructID id) { failures++; } - break; + break; default: Console.WriteLine("\tThere is not the struct id"); failures++; @@ -951,7 +952,7 @@ private static void MarshalStructAsParam_AsExpByValOut(StructID id) { failures++; } - break; + break; case StructID.InnerExplicitId: InnerExplicit sourceInnerExplicit = new InnerExplicit(); sourceInnerExplicit.f1 = 1; @@ -970,7 +971,7 @@ private static void MarshalStructAsParam_AsExpByValOut(StructID id) { failures++; } - break; + break; case StructID.InnerArrayExplicitId: InnerArrayExplicit sourceInnerArrayExplicit = Helper.NewInnerArrayExplicit(1, 1.0F, "some string1", "some string2"); InnerArrayExplicit cloneInnerArrayExplicit = Helper.NewInnerArrayExplicit(1, 1.0F, "some string1", "some string2"); @@ -985,7 +986,7 @@ private static void MarshalStructAsParam_AsExpByValOut(StructID id) { failures++; } - break; + break; case StructID.OUTER3Id: OUTER3 sourceOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string"); OUTER3 cloneOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string"); @@ -1000,7 +1001,7 @@ private static void MarshalStructAsParam_AsExpByValOut(StructID id) { failures++; } - break; + break; case StructID.UId: U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2); U cloneU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2); @@ -1015,7 +1016,7 @@ private static void MarshalStructAsParam_AsExpByValOut(StructID id) { failures++; } - break; + break; case StructID.ByteStructPack2ExplicitId: ByteStructPack2Explicit source_bspe = Helper.NewByteStructPack2Explicit(32, 32); ByteStructPack2Explicit clone_bspe = Helper.NewByteStructPack2Explicit(32, 32); @@ -1029,7 +1030,7 @@ private static void MarshalStructAsParam_AsExpByValOut(StructID id) { failures++; } - break; + break; case StructID.ShortStructPack4ExplicitId: ShortStructPack4Explicit source_sspe = Helper.NewShortStructPack4Explicit(32, 32); ShortStructPack4Explicit clone_sspe = Helper.NewShortStructPack4Explicit(32, 32); @@ -1043,7 +1044,7 @@ private static void MarshalStructAsParam_AsExpByValOut(StructID id) { failures++; } - break; + break; case StructID.IntStructPack8ExplicitId: IntStructPack8Explicit source_ispe = Helper.NewIntStructPack8Explicit(32, 32); IntStructPack8Explicit clone_ispe = Helper.NewIntStructPack8Explicit(32, 32); @@ -1071,7 +1072,7 @@ private static void MarshalStructAsParam_AsExpByValOut(StructID id) { failures++; } - break; + break; default: Console.WriteLine("\tThere is not the struct id"); failures++; @@ -1106,7 +1107,7 @@ private static void MarshalStructAsParam_AsExpByRefOut(StructID id) { failures++; } - break; + break; case StructID.InnerExplicitId: InnerExplicit sourceInnerExplicit = new InnerExplicit(); sourceInnerExplicit.f1 = 1; @@ -1125,7 +1126,7 @@ private static void MarshalStructAsParam_AsExpByRefOut(StructID id) { failures++; } - break; + break; case StructID.InnerArrayExplicitId: InnerArrayExplicit sourceInnerArrayExplicit = Helper.NewInnerArrayExplicit(1, 1.0F, "some string1", "some string2"); InnerArrayExplicit changeInnerArrayExplicit = Helper.NewInnerArrayExplicit(77, 77.0F, "change string1", "change string2"); @@ -1140,7 +1141,7 @@ private static void MarshalStructAsParam_AsExpByRefOut(StructID id) { failures++; } - break; + break; case StructID.OUTER3Id: OUTER3 sourceOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string"); OUTER3 changeOUTER3 = Helper.NewOUTER3(77, 77.0F, "changed string", "changed string"); @@ -1155,7 +1156,7 @@ private static void MarshalStructAsParam_AsExpByRefOut(StructID id) { failures++; } - break; + break; case StructID.UId: U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2); U changeU = Helper.NewU(Int32.MaxValue, UInt32.MinValue, new IntPtr(-64), new UIntPtr(64), short.MaxValue, ushort.MinValue, byte.MaxValue, sbyte.MinValue, long.MaxValue, ulong.MinValue, 64.0F, 6.4); @@ -1170,7 +1171,7 @@ private static void MarshalStructAsParam_AsExpByRefOut(StructID id) { failures++; } - break; + break; case StructID.ByteStructPack2ExplicitId: ByteStructPack2Explicit source_bspe = Helper.NewByteStructPack2Explicit(32, 32); ByteStructPack2Explicit change_bspe = Helper.NewByteStructPack2Explicit(64, 64); @@ -1184,7 +1185,7 @@ private static void MarshalStructAsParam_AsExpByRefOut(StructID id) { failures++; } - break; + break; case StructID.ShortStructPack4ExplicitId: ShortStructPack4Explicit source_sspe = Helper.NewShortStructPack4Explicit(32, 32); ShortStructPack4Explicit change_sspe = Helper.NewShortStructPack4Explicit(64, 64); @@ -1226,7 +1227,7 @@ private static void MarshalStructAsParam_AsExpByRefOut(StructID id) { failures++; } - break; + break; default: Console.WriteLine("\tThere is not the struct id"); failures++; @@ -1261,7 +1262,7 @@ private static void MarshalStructAsParam_AsExpByValInOut(StructID id) { failures++; } - break; + break; case StructID.InnerExplicitId: InnerExplicit sourceInnerExplicit = new InnerExplicit(); sourceInnerExplicit.f1 = 1; @@ -1280,7 +1281,7 @@ private static void MarshalStructAsParam_AsExpByValInOut(StructID id) { failures++; } - break; + break; case StructID.InnerArrayExplicitId: InnerArrayExplicit sourceInnerArrayExplicit = Helper.NewInnerArrayExplicit(1, 1.0F, "some string1", "some string2"); InnerArrayExplicit cloneInnerArrayExplicit = Helper.NewInnerArrayExplicit(1, 1.0F, "some string1", "some string2"); @@ -1295,7 +1296,7 @@ private static void MarshalStructAsParam_AsExpByValInOut(StructID id) { failures++; } - break; + break; case StructID.OUTER3Id: OUTER3 sourceOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string"); OUTER3 cloneOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string"); @@ -1310,7 +1311,7 @@ private static void MarshalStructAsParam_AsExpByValInOut(StructID id) { failures++; } - break; + break; case StructID.UId: U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2); U cloneU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2); @@ -1325,7 +1326,7 @@ private static void MarshalStructAsParam_AsExpByValInOut(StructID id) { failures++; } - break; + break; case StructID.ByteStructPack2ExplicitId: ByteStructPack2Explicit source_bspe = Helper.NewByteStructPack2Explicit(32, 32); ByteStructPack2Explicit clone_bspe = Helper.NewByteStructPack2Explicit(32, 32); @@ -1339,7 +1340,7 @@ private static void MarshalStructAsParam_AsExpByValInOut(StructID id) { failures++; } - break; + break; case StructID.ShortStructPack4ExplicitId: ShortStructPack4Explicit source_sspe = Helper.NewShortStructPack4Explicit(32, 32); ShortStructPack4Explicit clone_sspe = Helper.NewShortStructPack4Explicit(32, 32); @@ -1381,7 +1382,7 @@ private static void MarshalStructAsParam_AsExpByValInOut(StructID id) { failures++; } - break; + break; default: Console.WriteLine("\tThere is not the struct id"); failures++; @@ -1416,7 +1417,7 @@ private static void MarshalStructAsParam_AsExpByRefInOut(StructID id) { failures++; } - break; + break; case StructID.InnerExplicitId: InnerExplicit sourceInnerExplicit = new InnerExplicit(); sourceInnerExplicit.f1 = 1; @@ -1435,7 +1436,7 @@ private static void MarshalStructAsParam_AsExpByRefInOut(StructID id) { failures++; } - break; + break; case StructID.InnerArrayExplicitId: InnerArrayExplicit sourceInnerArrayExplicit = Helper.NewInnerArrayExplicit(1, 1.0F, "some string1", "some string2"); InnerArrayExplicit changeInnerArrayExplicit = Helper.NewInnerArrayExplicit(77, 77.0F, "change string1", "change string2"); @@ -1450,7 +1451,7 @@ private static void MarshalStructAsParam_AsExpByRefInOut(StructID id) { failures++; } - break; + break; case StructID.OUTER3Id: OUTER3 sourceOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string"); OUTER3 changeOUTER3 = Helper.NewOUTER3(77, 77.0F, "changed string", "changed string"); @@ -1465,7 +1466,7 @@ private static void MarshalStructAsParam_AsExpByRefInOut(StructID id) { failures++; } - break; + break; case StructID.UId: U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2); U changeU = Helper.NewU(Int32.MaxValue, UInt32.MinValue, new IntPtr(-64), new UIntPtr(64), short.MaxValue, ushort.MinValue, byte.MaxValue, sbyte.MinValue, long.MaxValue, ulong.MinValue, 64.0F, 6.4); @@ -1480,7 +1481,7 @@ private static void MarshalStructAsParam_AsExpByRefInOut(StructID id) { failures++; } - break; + break; case StructID.ByteStructPack2ExplicitId: ByteStructPack2Explicit source_bspe = Helper.NewByteStructPack2Explicit(32, 32); ByteStructPack2Explicit change_bspe = Helper.NewByteStructPack2Explicit(64, 64); @@ -1494,7 +1495,7 @@ private static void MarshalStructAsParam_AsExpByRefInOut(StructID id) { failures++; } - break; + break; case StructID.ShortStructPack4ExplicitId: ShortStructPack4Explicit source_sspe = Helper.NewShortStructPack4Explicit(32, 32); ShortStructPack4Explicit change_sspe = Helper.NewShortStructPack4Explicit(64, 64); @@ -1536,7 +1537,7 @@ private static void MarshalStructAsParam_AsExpByRefInOut(StructID id) { failures++; } - break; + break; default: Console.WriteLine("\tThere is not the struct id"); failures++; diff --git a/src/tests/Interop/StructMarshalling/PInvoke/MarshalStructAsLayoutSeq.cs b/src/tests/Interop/StructMarshalling/PInvoke/MarshalStructAsLayoutSeq.cs index fb9a4bd2f4ef1a..9853b6d04fd159 100644 --- a/src/tests/Interop/StructMarshalling/PInvoke/MarshalStructAsLayoutSeq.cs +++ b/src/tests/Interop/StructMarshalling/PInvoke/MarshalStructAsLayoutSeq.cs @@ -57,6 +57,7 @@ private static void testMethod(S9 s9) [SecuritySafeCritical] [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { RunMarshalSeqStructAsParamByVal(); diff --git a/src/tests/Interop/StructMarshalling/PInvoke/NestedStruct.cs b/src/tests/Interop/StructMarshalling/PInvoke/NestedStruct.cs index fd90c27eb37cb0..2a6387bb39e941 100644 --- a/src/tests/Interop/StructMarshalling/PInvoke/NestedStruct.cs +++ b/src/tests/Interop/StructMarshalling/PInvoke/NestedStruct.cs @@ -11,6 +11,7 @@ public class Managed static extern GameControllerBindType getBindType (GameControllerButtonBind button); [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { GameControllerButtonBind button = new GameControllerButtonBind(GameControllerBindType.ControllerBindtypeAxis, null); diff --git a/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/DelegatePInvoke/DelegatePInvokeTest.cs b/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/DelegatePInvoke/DelegatePInvokeTest.cs index 17d396754f04ac..3cf6f2d883077d 100644 --- a/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/DelegatePInvoke/DelegatePInvokeTest.cs +++ b/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/DelegatePInvoke/DelegatePInvokeTest.cs @@ -689,6 +689,7 @@ private static void TestMethod_DelegatePInvoke_MarshalByVal_Stdcall(StructID str #endregion [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/ReversePInvokeManaged/ReversePInvokeTest.cs b/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/ReversePInvokeManaged/ReversePInvokeTest.cs index acc1d1b4b85b28..dda5d7a27e8a1c 100644 --- a/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/ReversePInvokeManaged/ReversePInvokeTest.cs +++ b/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/ReversePInvokeManaged/ReversePInvokeTest.cs @@ -744,6 +744,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_LongStructPack16Expl #endregion [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try{ diff --git a/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/DelegatePInvoke/DelegatePInvokeTest.cs b/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/DelegatePInvoke/DelegatePInvokeTest.cs index e605dff6d7eb1f..8cfd1d263b9373 100644 --- a/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/DelegatePInvoke/DelegatePInvokeTest.cs +++ b/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/DelegatePInvoke/DelegatePInvokeTest.cs @@ -1414,6 +1414,7 @@ unsafe private static void Run_TestMethod_DelegatePInvoke_MarshalByVal_StdCall() #endregion [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try{ diff --git a/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest_.cs b/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest_.cs index c3a6af563f25be..092dbec2947832 100644 --- a/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest_.cs +++ b/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest_.cs @@ -1833,6 +1833,7 @@ private static void Run_TestMethod_DoCallBack_MarshalStructByVal_StdCall() #endregion [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try{ diff --git a/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionNegativeTest.cs b/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionNegativeTest.cs index 35538c8e0a0e38..56129cd76c4f84 100644 --- a/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionNegativeTest.cs +++ b/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionNegativeTest.cs @@ -151,6 +151,7 @@ private static int ILStubCache_GCTransition_NoGCTransition(int expected) } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static void TestEntryPoint() { CheckGCMode.Initialize(&SuppressGCTransitionNative.SetIsInCooperativeModeFunction); diff --git a/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionTest.cs b/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionTest.cs index 32bbfb64b3ee8e..f608d552bb9265 100644 --- a/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionTest.cs +++ b/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionTest.cs @@ -287,6 +287,7 @@ private static int ILStubCache_NoGCTransition_GCTransition(int expected) } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static void TestEntryPoint() { CheckGCMode.Initialize(&SuppressGCTransitionNative.SetIsInCooperativeModeFunction); diff --git a/src/tests/Interop/UnmanagedCallConv/UnmanagedCallConvTest.cs b/src/tests/Interop/UnmanagedCallConv/UnmanagedCallConvTest.cs index eb0fb6f83882bf..8afb1adfd8dce2 100644 --- a/src/tests/Interop/UnmanagedCallConv/UnmanagedCallConvTest.cs +++ b/src/tests/Interop/UnmanagedCallConv/UnmanagedCallConvTest.cs @@ -385,6 +385,7 @@ private static void MatchingDllImport_NotBlittable() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs b/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs index 6f41b75def5482..5d4f1478a07a24 100644 --- a/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs +++ b/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs @@ -27,6 +27,7 @@ public static class UnmanagedCallersOnlyDll private delegate void NativeMethodInvoker(); [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/UnmanagedCallersOnlyBasic/UnmanagedCallersOnlyBasicTest.cs b/src/tests/Interop/UnmanagedCallersOnlyBasic/UnmanagedCallersOnlyBasicTest.cs index 8ca03b0dc62b80..be02e222b746d0 100644 --- a/src/tests/Interop/UnmanagedCallersOnlyBasic/UnmanagedCallersOnlyBasicTest.cs +++ b/src/tests/Interop/UnmanagedCallersOnlyBasic/UnmanagedCallersOnlyBasicTest.cs @@ -45,6 +45,7 @@ public static int ManagedDoubleCallback(int n) } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] public static void TestUnmanagedCallersOnlyValid() { Console.WriteLine($"Running {nameof(TestUnmanagedCallersOnlyValid)}..."); From c8099ee44b7a557fe73e4395548a1d1a417b239f Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Thu, 7 Dec 2023 18:07:49 +0100 Subject: [PATCH 19/19] PR feedback --- src/tests/Common/CoreCLRTestLibrary/Utilities.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tests/Common/CoreCLRTestLibrary/Utilities.cs b/src/tests/Common/CoreCLRTestLibrary/Utilities.cs index 3a4dc42eb8d7d2..d48a3e6bd6e79d 100644 --- a/src/tests/Common/CoreCLRTestLibrary/Utilities.cs +++ b/src/tests/Common/CoreCLRTestLibrary/Utilities.cs @@ -440,6 +440,8 @@ public static int ExecuteAndUnload(string assemblyPath, string[] args, Action