From 13d2da392baaa0a72f327f6407a2e9163fe9c328 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Fri, 10 Nov 2023 08:58:40 -0800 Subject: [PATCH] Resolving various Linux test failures --- .../CXXMethodDeclarationTest.cs | 50 +++++----- .../DeprecatedToObsoleteTest.cs | 2 + .../EnumDeclarationTest.cs | 6 +- .../FunctionDeclarationBodyImportTest.cs | 2 + .../FunctionDeclarationDllImportTest.cs | 2 + .../FunctionPointerDeclarationTest.cs | 2 + .../StructDeclarationTest.cs | 6 +- .../UnionDeclarationTest.cs | 3 +- .../VarDeclarationTest.cs | 2 + .../CXXMethodDeclarationTest.cs | 2 + .../DeprecatedToObsoleteTest.cs | 2 + .../EnumDeclarationTest.cs | 2 + .../FunctionDeclarationBodyImportTest.cs | 2 + .../FunctionDeclarationDllImportTest.cs | 2 + .../FunctionPointerDeclarationTest.cs | 2 + .../StructDeclarationTest.cs | 2 + .../UnionDeclarationTest.cs | 3 +- .../VarDeclarationTest.cs | 2 + .../CXXMethodDeclarationTest.cs | 46 +++++----- .../DeprecatedToObsoleteTest.cs | 2 + .../CSharpDefaultUnix/EnumDeclarationTest.cs | 6 +- .../FunctionDeclarationBodyImportTest.cs | 2 + .../FunctionDeclarationDllImportTest.cs | 2 + .../FunctionPointerDeclarationTest.cs | 2 + .../StructDeclarationTest.cs | 6 +- .../CSharpDefaultUnix/UnionDeclarationTest.cs | 3 +- .../CSharpDefaultUnix/VarDeclarationTest.cs | 2 + .../CXXMethodDeclarationTest.cs | 2 + .../DeprecatedToObsoleteTest.cs | 2 + .../EnumDeclarationTest.cs | 2 + .../FunctionDeclarationBodyImportTest.cs | 2 + .../FunctionDeclarationDllImportTest.cs | 2 + .../FunctionPointerDeclarationTest.cs | 2 + .../StructDeclarationTest.cs | 2 + .../UnionDeclarationTest.cs | 3 +- .../VarDeclarationTest.cs | 2 + .../CXXMethodDeclarationTest.cs | 46 +++++----- .../DeprecatedToObsoleteTest.cs | 2 + .../CSharpLatestUnix/EnumDeclarationTest.cs | 6 +- .../FunctionDeclarationBodyImportTest.cs | 2 + .../FunctionDeclarationDllImportTest.cs | 2 + .../FunctionPointerDeclarationTest.cs | 2 + .../CSharpLatestUnix/StructDeclarationTest.cs | 6 +- .../CSharpLatestUnix/UnionDeclarationTest.cs | 3 +- .../CSharpLatestUnix/VarDeclarationTest.cs | 2 + .../CXXMethodDeclarationTest.cs | 2 + .../DeprecatedToObsoleteTest.cs | 2 + .../EnumDeclarationTest.cs | 2 + .../FunctionDeclarationBodyImportTest.cs | 2 + .../FunctionDeclarationDllImportTest.cs | 2 + .../FunctionPointerDeclarationTest.cs | 2 + .../StructDeclarationTest.cs | 2 + .../UnionDeclarationTest.cs | 3 +- .../CSharpLatestWindows/VarDeclarationTest.cs | 2 + .../CXXMethodDeclarationTest.cs | 46 +++++----- .../DeprecatedToObsoleteTest.cs | 2 + .../CSharpPreviewUnix/EnumDeclarationTest.cs | 6 +- .../FunctionDeclarationBodyImportTest.cs | 2 + .../FunctionDeclarationDllImportTest.cs | 2 + .../FunctionPointerDeclarationTest.cs | 2 + .../StructDeclarationTest.cs | 6 +- .../CSharpPreviewUnix/UnionDeclarationTest.cs | 3 +- .../CSharpPreviewUnix/VarDeclarationTest.cs | 2 + .../CXXMethodDeclarationTest.cs | 2 + .../DeprecatedToObsoleteTest.cs | 2 + .../EnumDeclarationTest.cs | 2 + .../FunctionDeclarationBodyImportTest.cs | 2 + .../FunctionDeclarationDllImportTest.cs | 2 + .../FunctionPointerDeclarationTest.cs | 2 + .../StructDeclarationTest.cs | 2 + .../UnionDeclarationTest.cs | 3 +- .../VarDeclarationTest.cs | 2 + .../PInvokeGeneratorTest.cs | 2 +- .../CXXMethodDeclarationTest.cs | 92 ++++++++++--------- .../DeprecatedToObsoleteTest.cs | 2 + .../XmlCompatibleUnix/EnumDeclarationTest.cs | 6 +- .../FunctionDeclarationBodyImportTest.cs | 2 + .../FunctionDeclarationDllImportTest.cs | 2 + .../FunctionPointerDeclarationTest.cs | 2 + .../StructDeclarationTest.cs | 6 +- .../XmlCompatibleUnix/UnionDeclarationTest.cs | 3 +- .../XmlCompatibleUnix/VarDeclarationTest.cs | 2 + .../CXXMethodDeclarationTest.cs | 2 + .../DeprecatedToObsoleteTest.cs | 2 + .../EnumDeclarationTest.cs | 2 + .../FunctionDeclarationBodyImportTest.cs | 2 + .../FunctionDeclarationDllImportTest.cs | 2 + .../FunctionPointerDeclarationTest.cs | 2 + .../StructDeclarationTest.cs | 2 + .../UnionDeclarationTest.cs | 3 +- .../VarDeclarationTest.cs | 2 + .../CXXMethodDeclarationTest.cs | 62 +++++++------ .../DeprecatedToObsoleteTest.cs | 2 + .../XmlDefaultUnix/EnumDeclarationTest.cs | 6 +- .../FunctionDeclarationBodyImportTest.cs | 2 + .../FunctionDeclarationDllImportTest.cs | 2 + .../FunctionPointerDeclarationTest.cs | 2 + .../XmlDefaultUnix/StructDeclarationTest.cs | 6 +- .../XmlDefaultUnix/UnionDeclarationTest.cs | 3 +- .../XmlDefaultUnix/VarDeclarationTest.cs | 2 + .../CXXMethodDeclarationTest.cs | 2 + .../DeprecatedToObsoleteTest.cs | 2 + .../XmlDefaultWindows/EnumDeclarationTest.cs | 2 + .../FunctionDeclarationBodyImportTest.cs | 2 + .../FunctionDeclarationDllImportTest.cs | 2 + .../FunctionPointerDeclarationTest.cs | 2 + .../StructDeclarationTest.cs | 2 + .../XmlDefaultWindows/UnionDeclarationTest.cs | 3 +- .../XmlDefaultWindows/VarDeclarationTest.cs | 2 + .../XmlLatestUnix/CXXMethodDeclarationTest.cs | 62 +++++++------ .../XmlLatestUnix/DeprecatedToObsoleteTest.cs | 2 + .../XmlLatestUnix/EnumDeclarationTest.cs | 6 +- .../FunctionDeclarationBodyImportTest.cs | 2 + .../FunctionDeclarationDllImportTest.cs | 2 + .../FunctionPointerDeclarationTest.cs | 2 + .../XmlLatestUnix/StructDeclarationTest.cs | 6 +- .../XmlLatestUnix/UnionDeclarationTest.cs | 3 +- .../XmlLatestUnix/VarDeclarationTest.cs | 2 + .../CXXMethodDeclarationTest.cs | 2 + .../DeprecatedToObsoleteTest.cs | 2 + .../XmlLatestWindows/EnumDeclarationTest.cs | 2 + .../FunctionDeclarationBodyImportTest.cs | 2 + .../FunctionDeclarationDllImportTest.cs | 2 + .../FunctionPointerDeclarationTest.cs | 2 + .../XmlLatestWindows/StructDeclarationTest.cs | 2 + .../XmlLatestWindows/UnionDeclarationTest.cs | 3 +- .../XmlLatestWindows/VarDeclarationTest.cs | 2 + .../CXXMethodDeclarationTest.cs | 62 +++++++------ .../DeprecatedToObsoleteTest.cs | 2 + .../XmlPreviewUnix/EnumDeclarationTest.cs | 6 +- .../FunctionDeclarationBodyImportTest.cs | 2 + .../FunctionDeclarationDllImportTest.cs | 2 + .../FunctionPointerDeclarationTest.cs | 2 + .../XmlPreviewUnix/StructDeclarationTest.cs | 6 +- .../XmlPreviewUnix/UnionDeclarationTest.cs | 3 +- .../XmlPreviewUnix/VarDeclarationTest.cs | 2 + .../CXXMethodDeclarationTest.cs | 2 + .../DeprecatedToObsoleteTest.cs | 2 + .../XmlPreviewWindows/EnumDeclarationTest.cs | 2 + .../FunctionDeclarationBodyImportTest.cs | 2 + .../FunctionDeclarationDllImportTest.cs | 2 + .../FunctionPointerDeclarationTest.cs | 2 + .../StructDeclarationTest.cs | 2 + .../XmlPreviewWindows/UnionDeclarationTest.cs | 3 +- .../XmlPreviewWindows/VarDeclarationTest.cs | 2 + 145 files changed, 554 insertions(+), 266 deletions(-) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/CXXMethodDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/CXXMethodDeclarationTest.cs index 83dcda73..92ec9bb7 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/CXXMethodDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/CXXMethodDeclarationTest.cs @@ -3,9 +3,11 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpCompatibleUnix_CXXMethodDeclarationTest : CXXMethodDeclarationTest { protected override Task ConstructorTestImpl() @@ -425,19 +427,19 @@ public unsafe partial struct MyStruct public void** lpVtbl; [UnmanagedFunctionPointer(CallingConvention.ThisCall)] - public delegate int _GetType(MyStruct* pThis, int objA, int objB); + public delegate int _GetType(MyStruct* pThis, int obj); [UnmanagedFunctionPointer(CallingConvention.ThisCall)] public delegate int _GetType1(MyStruct* pThis); [UnmanagedFunctionPointer(CallingConvention.ThisCall)] - public delegate int _GetType2(MyStruct* pThis, int obj); + public delegate int _GetType2(MyStruct* pThis, int objA, int objB); - public int GetType(int objA, int objB) + public int GetType(int obj) {{ fixed (MyStruct* pThis = &this) {{ - return Marshal.GetDelegateForFunctionPointer<_GetType>((IntPtr)(lpVtbl[0]))(pThis, objA, objB); + return Marshal.GetDelegateForFunctionPointer<_GetType>((IntPtr)(lpVtbl[0]))(pThis, obj); }} }} @@ -449,11 +451,11 @@ public new int GetType() }} }} - public int GetType(int obj) + public int GetType(int objA, int objB) {{ fixed (MyStruct* pThis = &this) {{ - return Marshal.GetDelegateForFunctionPointer<_GetType2>((IntPtr)(lpVtbl[2]))(pThis, obj); + return Marshal.GetDelegateForFunctionPointer<_GetType2>((IntPtr)(lpVtbl[2]))(pThis, objA, objB); }} }} }} @@ -489,19 +491,19 @@ public unsafe partial struct MyStruct public Vtbl* lpVtbl; [UnmanagedFunctionPointer(CallingConvention.ThisCall)] - public delegate int _GetType(MyStruct* pThis, int objA, int objB); + public delegate int _GetType(MyStruct* pThis, int obj); [UnmanagedFunctionPointer(CallingConvention.ThisCall)] public delegate int _GetType1(MyStruct* pThis); [UnmanagedFunctionPointer(CallingConvention.ThisCall)] - public delegate int _GetType2(MyStruct* pThis, int obj); + public delegate int _GetType2(MyStruct* pThis, int objA, int objB); - public int GetType(int objA, int objB) + public int GetType(int obj) {{ fixed (MyStruct* pThis = &this) {{ - return Marshal.GetDelegateForFunctionPointer<_GetType>(lpVtbl->GetType)(pThis, objA, objB); + return Marshal.GetDelegateForFunctionPointer<_GetType>(lpVtbl->GetType)(pThis, obj); }} }} @@ -513,23 +515,23 @@ public new int GetType() }} }} - public int GetType(int obj) + public int GetType(int objA, int objB) {{ fixed (MyStruct* pThis = &this) {{ - return Marshal.GetDelegateForFunctionPointer<_GetType2>(lpVtbl->GetType2)(pThis, obj); + return Marshal.GetDelegateForFunctionPointer<_GetType2>(lpVtbl->GetType2)(pThis, objA, objB); }} }} public partial struct Vtbl {{ - [NativeTypeName(""int (int, int){nativeCallConv}"")] + [NativeTypeName(""int (int){nativeCallConv}"")] public new IntPtr GetType; [NativeTypeName(""int (){nativeCallConv}"")] public IntPtr GetType1; - [NativeTypeName(""int (int){nativeCallConv}"")] + [NativeTypeName(""int (int, int){nativeCallConv}"")] public IntPtr GetType2; }} }} @@ -565,19 +567,19 @@ public unsafe partial struct MyStruct : MyStruct.Interface public Vtbl* lpVtbl; [UnmanagedFunctionPointer(CallingConvention.ThisCall)] - public delegate int _GetType(MyStruct* pThis, int objA, int objB); + public delegate int _GetType(MyStruct* pThis, int obj); [UnmanagedFunctionPointer(CallingConvention.ThisCall)] public delegate int _GetType1(MyStruct* pThis); [UnmanagedFunctionPointer(CallingConvention.ThisCall)] - public delegate int _GetType2(MyStruct* pThis, int obj); + public delegate int _GetType2(MyStruct* pThis, int objA, int objB); - public int GetType(int objA, int objB) + public int GetType(int obj) {{ fixed (MyStruct* pThis = &this) {{ - return Marshal.GetDelegateForFunctionPointer<_GetType>(lpVtbl->GetType)(pThis, objA, objB); + return Marshal.GetDelegateForFunctionPointer<_GetType>(lpVtbl->GetType)(pThis, obj); }} }} @@ -589,32 +591,32 @@ public new int GetType() }} }} - public int GetType(int obj) + public int GetType(int objA, int objB) {{ fixed (MyStruct* pThis = &this) {{ - return Marshal.GetDelegateForFunctionPointer<_GetType2>(lpVtbl->GetType2)(pThis, obj); + return Marshal.GetDelegateForFunctionPointer<_GetType2>(lpVtbl->GetType2)(pThis, objA, objB); }} }} public interface Interface {{ - int GetType(int objA, int objB); + int GetType(int obj); int GetType(); - int GetType(int obj); + int GetType(int objA, int objB); }} public partial struct Vtbl {{ - [NativeTypeName(""int (int, int){nativeCallConv}"")] + [NativeTypeName(""int (int){nativeCallConv}"")] public new IntPtr GetType; [NativeTypeName(""int (){nativeCallConv}"")] public IntPtr GetType1; - [NativeTypeName(""int (int){nativeCallConv}"")] + [NativeTypeName(""int (int, int){nativeCallConv}"")] public IntPtr GetType2; }} }} diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/DeprecatedToObsoleteTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/DeprecatedToObsoleteTest.cs index 87a1f500..289cc350 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/DeprecatedToObsoleteTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/DeprecatedToObsoleteTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpCompatibleUnix_DeprecatedToObsoleteTest : DeprecatedToObsoleteTest { protected override Task SimpleStructMembersImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/EnumDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/EnumDeclarationTest.cs index c098bea0..3933f23a 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/EnumDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/EnumDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpCompatibleUnix_EnumDeclarationTest : EnumDeclarationTest { protected override Task BasicTestImpl() @@ -572,7 +574,7 @@ public enum MyEnum2 public static partial class Methods { - public const int MyEnum1_Value1 = 1; + public const uint MyEnum1_Value1 = 1; } } "; @@ -595,7 +597,7 @@ protected override Task WithReferenceToAnonymousEnumEnumeratorTestImpl() { public static partial class Methods { - public const int MyEnum1_Value1 = 1; + public const uint MyEnum1_Value1 = 1; [NativeTypeName(""const int"")] public const int MyEnum2_Value1 = (int)(MyEnum1_Value1) + 1; diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/FunctionDeclarationBodyImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/FunctionDeclarationBodyImportTest.cs index 176dfade..b8128a4f 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/FunctionDeclarationBodyImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/FunctionDeclarationBodyImportTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpCompatibleUnix_FunctionDeclarationBodyImportTest : FunctionDeclarationBodyImportTest { protected override Task ArraySubscriptTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/FunctionDeclarationDllImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/FunctionDeclarationDllImportTest.cs index 592315f5..6a976236 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/FunctionDeclarationDllImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/FunctionDeclarationDllImportTest.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpCompatibleUnix_FunctionDeclarationDllImportTest : FunctionDeclarationDllImportTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/FunctionPointerDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/FunctionPointerDeclarationTest.cs index a63ebae8..277d111b 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/FunctionPointerDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/FunctionPointerDeclarationTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpCompatibleUnix_FunctionPointerDeclarationTest : FunctionPointerDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/StructDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/StructDeclarationTest.cs index 6d5f47a7..6704850b 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/StructDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/StructDeclarationTest.cs @@ -4,9 +4,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpCompatibleUnix_StructDeclarationTest : StructDeclarationTest { protected override Task IncompleteArraySizeTestImpl(string nativeType, string expectedManagedType) @@ -1942,7 +1944,9 @@ public partial struct MyStruct3 protected override Task WithPackingTestImpl() { - const string InputContents = @"struct MyStruct + const string InputContents = @"typedef int size_t; + +struct MyStruct { size_t FixedBuffer[1]; }; diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/UnionDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/UnionDeclarationTest.cs index 6f31ed6c..383e9a67 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/UnionDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/UnionDeclarationTest.cs @@ -1,12 +1,13 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. -using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpCompatibleUnix_UnionDeclarationTest : UnionDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/VarDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/VarDeclarationTest.cs index df8f4626..a068c33f 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/VarDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleUnix/VarDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpCompatibleUnix_VarDeclarationTest : VarDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/CXXMethodDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/CXXMethodDeclarationTest.cs index 00d65f74..a2bd365b 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/CXXMethodDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/CXXMethodDeclarationTest.cs @@ -3,9 +3,11 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpCompatibleWindows_CXXMethodDeclarationTest : CXXMethodDeclarationTest { protected override Task ConstructorTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/DeprecatedToObsoleteTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/DeprecatedToObsoleteTest.cs index bce728df..eea3b88d 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/DeprecatedToObsoleteTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/DeprecatedToObsoleteTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpCompatibleWindows_DeprecatedToObsoleteTest : DeprecatedToObsoleteTest { protected override Task SimpleStructMembersImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/EnumDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/EnumDeclarationTest.cs index 882351dd..c0a0a7a3 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/EnumDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/EnumDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpCompatibleWindows_EnumDeclarationTest : EnumDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/FunctionDeclarationBodyImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/FunctionDeclarationBodyImportTest.cs index 026859c9..c5812b5a 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/FunctionDeclarationBodyImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/FunctionDeclarationBodyImportTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpCompatibleWindows_FunctionDeclarationBodyImportTest : FunctionDeclarationBodyImportTest { protected override Task ArraySubscriptTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/FunctionDeclarationDllImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/FunctionDeclarationDllImportTest.cs index 3f17231e..765ce399 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/FunctionDeclarationDllImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/FunctionDeclarationDllImportTest.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpCompatibleWindows_FunctionDeclarationDllImportTest : FunctionDeclarationDllImportTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/FunctionPointerDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/FunctionPointerDeclarationTest.cs index 37511696..9a27a03b 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/FunctionPointerDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/FunctionPointerDeclarationTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpCompatibleWindows_FunctionPointerDeclarationTest : FunctionPointerDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/StructDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/StructDeclarationTest.cs index a3f6b0d9..f650aa46 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/StructDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/StructDeclarationTest.cs @@ -4,9 +4,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpCompatibleWindows_StructDeclarationTest : StructDeclarationTest { protected override Task IncompleteArraySizeTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/UnionDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/UnionDeclarationTest.cs index bf49d6be..ad291ac5 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/UnionDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/UnionDeclarationTest.cs @@ -1,12 +1,13 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. -using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpCompatibleWindows_UnionDeclarationTest : UnionDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/VarDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/VarDeclarationTest.cs index 929ffaa4..fba485f7 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/VarDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpCompatibleWindows/VarDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpCompatibleWindows_VarDeclarationTest : VarDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/CXXMethodDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/CXXMethodDeclarationTest.cs index f1edb2b3..f5f02549 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/CXXMethodDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/CXXMethodDeclarationTest.cs @@ -3,9 +3,11 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpDefaultUnix_CXXMethodDeclarationTest : CXXMethodDeclarationTest { protected override Task ConstructorTestImpl() @@ -423,9 +425,9 @@ public unsafe partial struct MyStruct {{ public void** lpVtbl; - public int GetType(int objA, int objB) + public int GetType(int obj) {{ - return ((delegate* unmanaged[Thiscall])(lpVtbl[0]))((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); + return ((delegate* unmanaged[Thiscall])(lpVtbl[0]))((MyStruct*)Unsafe.AsPointer(ref this), obj); }} public new int GetType() @@ -433,9 +435,9 @@ public new int GetType() return ((delegate* unmanaged[Thiscall])(lpVtbl[1]))((MyStruct*)Unsafe.AsPointer(ref this)); }} - public int GetType(int obj) + public int GetType(int objA, int objB) {{ - return ((delegate* unmanaged[Thiscall])(lpVtbl[2]))((MyStruct*)Unsafe.AsPointer(ref this), obj); + return ((delegate* unmanaged[Thiscall])(lpVtbl[2]))((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); }} }} }} @@ -468,9 +470,9 @@ public unsafe partial struct MyStruct {{ public Vtbl* lpVtbl; - public int GetType(int objA, int objB) + public int GetType(int obj) {{ - return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); + return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), obj); }} public new int GetType() @@ -478,21 +480,21 @@ public new int GetType() return lpVtbl->GetType1((MyStruct*)Unsafe.AsPointer(ref this)); }} - public int GetType(int obj) + public int GetType(int objA, int objB) {{ - return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), obj); + return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); }} public partial struct Vtbl {{ - [NativeTypeName(""int (int, int){nativeCallConv}"")] - public new delegate* unmanaged[Thiscall] GetType; + [NativeTypeName(""int (int){nativeCallConv}"")] + public new delegate* unmanaged[Thiscall] GetType; [NativeTypeName(""int (){nativeCallConv}"")] public delegate* unmanaged[Thiscall] GetType1; - [NativeTypeName(""int (int){nativeCallConv}"")] - public delegate* unmanaged[Thiscall] GetType2; + [NativeTypeName(""int (int, int){nativeCallConv}"")] + public delegate* unmanaged[Thiscall] GetType2; }} }} }} @@ -525,9 +527,9 @@ public unsafe partial struct MyStruct : MyStruct.Interface {{ public Vtbl* lpVtbl; - public int GetType(int objA, int objB) + public int GetType(int obj) {{ - return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); + return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), obj); }} public new int GetType() @@ -535,31 +537,31 @@ public new int GetType() return lpVtbl->GetType1((MyStruct*)Unsafe.AsPointer(ref this)); }} - public int GetType(int obj) + public int GetType(int objA, int objB) {{ - return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), obj); + return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); }} public interface Interface {{ - int GetType(int objA, int objB); + int GetType(int obj); int GetType(); - int GetType(int obj); + int GetType(int objA, int objB); }} public partial struct Vtbl where TSelf : unmanaged, Interface {{ - [NativeTypeName(""int (int, int){nativeCallConv}"")] - public new delegate* unmanaged[Thiscall] GetType; + [NativeTypeName(""int (int){nativeCallConv}"")] + public new delegate* unmanaged[Thiscall] GetType; [NativeTypeName(""int (){nativeCallConv}"")] public delegate* unmanaged[Thiscall] GetType1; - [NativeTypeName(""int (int){nativeCallConv}"")] - public delegate* unmanaged[Thiscall] GetType2; + [NativeTypeName(""int (int, int){nativeCallConv}"")] + public delegate* unmanaged[Thiscall] GetType2; }} }} }} diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/DeprecatedToObsoleteTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/DeprecatedToObsoleteTest.cs index 9f6f7902..cfccc233 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/DeprecatedToObsoleteTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/DeprecatedToObsoleteTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpDefaultUnix_DeprecatedToObsoleteTest : DeprecatedToObsoleteTest { protected override Task SimpleStructMembersImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/EnumDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/EnumDeclarationTest.cs index c0ac7b8f..3ab6e291 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/EnumDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/EnumDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpDefaultUnix_EnumDeclarationTest : EnumDeclarationTest { protected override Task BasicTestImpl() @@ -575,7 +577,7 @@ public enum MyEnum2 public static partial class Methods { - public const int MyEnum1_Value1 = 1; + public const uint MyEnum1_Value1 = 1; } } "; @@ -598,7 +600,7 @@ protected override Task WithReferenceToAnonymousEnumEnumeratorTestImpl() { public static partial class Methods { - public const int MyEnum1_Value1 = 1; + public const uint MyEnum1_Value1 = 1; [NativeTypeName(""const int"")] public const int MyEnum2_Value1 = (int)(MyEnum1_Value1) + 1; diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/FunctionDeclarationBodyImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/FunctionDeclarationBodyImportTest.cs index b0c4d581..a375ba77 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/FunctionDeclarationBodyImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/FunctionDeclarationBodyImportTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpDefaultUnix_FunctionDeclarationBodyImportTest : FunctionDeclarationBodyImportTest { protected override Task ArraySubscriptTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/FunctionDeclarationDllImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/FunctionDeclarationDllImportTest.cs index a74e2fb0..8e082149 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/FunctionDeclarationDllImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/FunctionDeclarationDllImportTest.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpDefaultUnix_FunctionDeclarationDllImportTest : FunctionDeclarationDllImportTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/FunctionPointerDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/FunctionPointerDeclarationTest.cs index dd5dbe71..c73ce7a2 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/FunctionPointerDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/FunctionPointerDeclarationTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpDefaultUnix_FunctionPointerDeclarationTest : FunctionPointerDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/StructDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/StructDeclarationTest.cs index 380b1a4c..6ab069d9 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/StructDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/StructDeclarationTest.cs @@ -4,9 +4,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpDefaultUnix_StructDeclarationTest : StructDeclarationTest { protected override Task IncompleteArraySizeTestImpl(string nativeType, string expectedManagedType) @@ -1920,7 +1922,9 @@ public partial struct MyStruct3 protected override Task WithPackingTestImpl() { - const string InputContents = @"struct MyStruct + const string InputContents = @"typedef int size_t; + +struct MyStruct { size_t FixedBuffer[1]; }; diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/UnionDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/UnionDeclarationTest.cs index eeb3b452..db6d3a6d 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/UnionDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/UnionDeclarationTest.cs @@ -1,12 +1,13 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. -using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpDefaultUnix_UnionDeclarationTest : UnionDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/VarDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/VarDeclarationTest.cs index 29b0977b..611048ea 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/VarDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultUnix/VarDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpDefaultUnix_VarDeclarationTest : VarDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/CXXMethodDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/CXXMethodDeclarationTest.cs index 57dfdb08..bf88b54a 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/CXXMethodDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/CXXMethodDeclarationTest.cs @@ -3,9 +3,11 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpDefaultWindows_CXXMethodDeclarationTest : CXXMethodDeclarationTest { protected override Task ConstructorTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/DeprecatedToObsoleteTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/DeprecatedToObsoleteTest.cs index 01b15fe6..0135ae7f 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/DeprecatedToObsoleteTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/DeprecatedToObsoleteTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpDefaultWindows_DeprecatedToObsoleteTest : DeprecatedToObsoleteTest { protected override Task SimpleStructMembersImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/EnumDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/EnumDeclarationTest.cs index db8f2a1d..92117a16 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/EnumDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/EnumDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpDefaultWindows_EnumDeclarationTest : EnumDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/FunctionDeclarationBodyImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/FunctionDeclarationBodyImportTest.cs index 6fcfa642..ce5e2d6d 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/FunctionDeclarationBodyImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/FunctionDeclarationBodyImportTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpDefaultWindows_FunctionDeclarationBodyImportTest : FunctionDeclarationBodyImportTest { protected override Task ArraySubscriptTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/FunctionDeclarationDllImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/FunctionDeclarationDllImportTest.cs index 47930afd..0c5f180e 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/FunctionDeclarationDllImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/FunctionDeclarationDllImportTest.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpDefaultWindows_FunctionDeclarationDllImportTest : FunctionDeclarationDllImportTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/FunctionPointerDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/FunctionPointerDeclarationTest.cs index 350d08cc..81848773 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/FunctionPointerDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/FunctionPointerDeclarationTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpDefaultWindows_FunctionPointerDeclarationTest : FunctionPointerDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/StructDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/StructDeclarationTest.cs index b9ddfd41..0102a48f 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/StructDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/StructDeclarationTest.cs @@ -4,9 +4,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpDefaultWindows_StructDeclarationTest : StructDeclarationTest { protected override Task IncompleteArraySizeTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/UnionDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/UnionDeclarationTest.cs index fca75b1e..5dae51e6 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/UnionDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/UnionDeclarationTest.cs @@ -1,12 +1,13 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. -using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpDefaultWindows_UnionDeclarationTest : UnionDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/VarDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/VarDeclarationTest.cs index da6922fc..bc82da08 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/VarDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpDefaultWindows/VarDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpDefaultWindows_VarDeclarationTest : VarDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/CXXMethodDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/CXXMethodDeclarationTest.cs index 1246574a..5554781f 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/CXXMethodDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/CXXMethodDeclarationTest.cs @@ -3,9 +3,11 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpLatestUnix_CXXMethodDeclarationTest : CXXMethodDeclarationTest { protected override Task ConstructorTestImpl() @@ -423,9 +425,9 @@ public unsafe partial struct MyStruct {{ public void** lpVtbl; - public int GetType(int objA, int objB) + public int GetType(int obj) {{ - return ((delegate* unmanaged[Thiscall])(lpVtbl[0]))((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); + return ((delegate* unmanaged[Thiscall])(lpVtbl[0]))((MyStruct*)Unsafe.AsPointer(ref this), obj); }} public new int GetType() @@ -433,9 +435,9 @@ public new int GetType() return ((delegate* unmanaged[Thiscall])(lpVtbl[1]))((MyStruct*)Unsafe.AsPointer(ref this)); }} - public int GetType(int obj) + public int GetType(int objA, int objB) {{ - return ((delegate* unmanaged[Thiscall])(lpVtbl[2]))((MyStruct*)Unsafe.AsPointer(ref this), obj); + return ((delegate* unmanaged[Thiscall])(lpVtbl[2]))((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); }} }} }} @@ -468,9 +470,9 @@ public unsafe partial struct MyStruct {{ public Vtbl* lpVtbl; - public int GetType(int objA, int objB) + public int GetType(int obj) {{ - return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); + return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), obj); }} public new int GetType() @@ -478,21 +480,21 @@ public new int GetType() return lpVtbl->GetType1((MyStruct*)Unsafe.AsPointer(ref this)); }} - public int GetType(int obj) + public int GetType(int objA, int objB) {{ - return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), obj); + return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); }} public partial struct Vtbl {{ - [NativeTypeName(""int (int, int){nativeCallConv}"")] - public new delegate* unmanaged[Thiscall] GetType; + [NativeTypeName(""int (int){nativeCallConv}"")] + public new delegate* unmanaged[Thiscall] GetType; [NativeTypeName(""int (){nativeCallConv}"")] public delegate* unmanaged[Thiscall] GetType1; - [NativeTypeName(""int (int){nativeCallConv}"")] - public delegate* unmanaged[Thiscall] GetType2; + [NativeTypeName(""int (int, int){nativeCallConv}"")] + public delegate* unmanaged[Thiscall] GetType2; }} }} }} @@ -525,9 +527,9 @@ public unsafe partial struct MyStruct : MyStruct.Interface {{ public Vtbl* lpVtbl; - public int GetType(int objA, int objB) + public int GetType(int obj) {{ - return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); + return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), obj); }} public new int GetType() @@ -535,31 +537,31 @@ public new int GetType() return lpVtbl->GetType1((MyStruct*)Unsafe.AsPointer(ref this)); }} - public int GetType(int obj) + public int GetType(int objA, int objB) {{ - return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), obj); + return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); }} public interface Interface {{ - int GetType(int objA, int objB); + int GetType(int obj); int GetType(); - int GetType(int obj); + int GetType(int objA, int objB); }} public partial struct Vtbl where TSelf : unmanaged, Interface {{ - [NativeTypeName(""int (int, int){nativeCallConv}"")] - public new delegate* unmanaged[Thiscall] GetType; + [NativeTypeName(""int (int){nativeCallConv}"")] + public new delegate* unmanaged[Thiscall] GetType; [NativeTypeName(""int (){nativeCallConv}"")] public delegate* unmanaged[Thiscall] GetType1; - [NativeTypeName(""int (int){nativeCallConv}"")] - public delegate* unmanaged[Thiscall] GetType2; + [NativeTypeName(""int (int, int){nativeCallConv}"")] + public delegate* unmanaged[Thiscall] GetType2; }} }} }} diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/DeprecatedToObsoleteTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/DeprecatedToObsoleteTest.cs index 1c79e4bd..25abcf97 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/DeprecatedToObsoleteTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/DeprecatedToObsoleteTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpLatestUnix_DeprecatedToObsoleteTest : DeprecatedToObsoleteTest { protected override Task SimpleStructMembersImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/EnumDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/EnumDeclarationTest.cs index a2f127d9..dc2ddb04 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/EnumDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/EnumDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpLatestUnix_EnumDeclarationTest : EnumDeclarationTest { protected override Task BasicTestImpl() @@ -575,7 +577,7 @@ public enum MyEnum2 public static partial class Methods { - public const int MyEnum1_Value1 = 1; + public const uint MyEnum1_Value1 = 1; } } "; @@ -598,7 +600,7 @@ protected override Task WithReferenceToAnonymousEnumEnumeratorTestImpl() { public static partial class Methods { - public const int MyEnum1_Value1 = 1; + public const uint MyEnum1_Value1 = 1; [NativeTypeName(""const int"")] public const int MyEnum2_Value1 = (int)(MyEnum1_Value1) + 1; diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/FunctionDeclarationBodyImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/FunctionDeclarationBodyImportTest.cs index c8599f05..1c8e0f1c 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/FunctionDeclarationBodyImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/FunctionDeclarationBodyImportTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpLatestUnix_FunctionDeclarationBodyImportTest : FunctionDeclarationBodyImportTest { protected override Task ArraySubscriptTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/FunctionDeclarationDllImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/FunctionDeclarationDllImportTest.cs index 4559142b..d989b804 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/FunctionDeclarationDllImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/FunctionDeclarationDllImportTest.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpLatestUnix_FunctionDeclarationDllImportTest : FunctionDeclarationDllImportTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/FunctionPointerDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/FunctionPointerDeclarationTest.cs index b9c5747b..e7253c5b 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/FunctionPointerDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/FunctionPointerDeclarationTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpLatestUnix_FunctionPointerDeclarationTest : FunctionPointerDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/StructDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/StructDeclarationTest.cs index 96eea6bb..ab899ce0 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/StructDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/StructDeclarationTest.cs @@ -4,9 +4,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpLatestUnix_StructDeclarationTest : StructDeclarationTest { protected override Task IncompleteArraySizeTestImpl(string nativeType, string expectedManagedType) @@ -1946,7 +1948,9 @@ public partial struct MyStruct3 protected override Task WithPackingTestImpl() { - const string InputContents = @"struct MyStruct + const string InputContents = @"typedef int size_t; + +struct MyStruct { size_t FixedBuffer[1]; }; diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/UnionDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/UnionDeclarationTest.cs index 5ffdabb6..2a5fbf26 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/UnionDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/UnionDeclarationTest.cs @@ -1,12 +1,13 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. -using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpLatestUnix_UnionDeclarationTest : UnionDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/VarDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/VarDeclarationTest.cs index dc8b3ac8..00fbbb56 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/VarDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestUnix/VarDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpLatestUnix_VarDeclarationTest : VarDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/CXXMethodDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/CXXMethodDeclarationTest.cs index 461f1893..2881a195 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/CXXMethodDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/CXXMethodDeclarationTest.cs @@ -3,9 +3,11 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpLatestWindows_CXXMethodDeclarationTest : CXXMethodDeclarationTest { protected override Task ConstructorTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/DeprecatedToObsoleteTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/DeprecatedToObsoleteTest.cs index c6c16574..dfd968ac 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/DeprecatedToObsoleteTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/DeprecatedToObsoleteTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpLatestWindows_DeprecatedToObsoleteTest : DeprecatedToObsoleteTest { protected override Task SimpleStructMembersImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/EnumDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/EnumDeclarationTest.cs index e9b8862b..9fe2b8d7 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/EnumDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/EnumDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpLatestWindows_EnumDeclarationTest : EnumDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/FunctionDeclarationBodyImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/FunctionDeclarationBodyImportTest.cs index 9e5ba2c2..623eae4f 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/FunctionDeclarationBodyImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/FunctionDeclarationBodyImportTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpLatestWindows_FunctionDeclarationBodyImportTest : FunctionDeclarationBodyImportTest { protected override Task ArraySubscriptTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/FunctionDeclarationDllImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/FunctionDeclarationDllImportTest.cs index 3d7e4ce4..7dd8e3c7 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/FunctionDeclarationDllImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/FunctionDeclarationDllImportTest.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpLatestWindows_FunctionDeclarationDllImportTest : FunctionDeclarationDllImportTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/FunctionPointerDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/FunctionPointerDeclarationTest.cs index 2f83c559..85e996ae 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/FunctionPointerDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/FunctionPointerDeclarationTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpLatestWindows_FunctionPointerDeclarationTest : FunctionPointerDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/StructDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/StructDeclarationTest.cs index f971e7c1..17a62b5f 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/StructDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/StructDeclarationTest.cs @@ -4,9 +4,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpLatestWindows_StructDeclarationTest : StructDeclarationTest { protected override Task IncompleteArraySizeTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/UnionDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/UnionDeclarationTest.cs index b90bb054..14338655 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/UnionDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/UnionDeclarationTest.cs @@ -1,12 +1,13 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. -using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpLatestWindows_UnionDeclarationTest : UnionDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/VarDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/VarDeclarationTest.cs index 13ee4259..cc9e2428 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/VarDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpLatestWindows/VarDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpLatestWindows_VarDeclarationTest : VarDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/CXXMethodDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/CXXMethodDeclarationTest.cs index 090fabfb..d055bbb1 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/CXXMethodDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/CXXMethodDeclarationTest.cs @@ -3,9 +3,11 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpPreviewUnix_CXXMethodDeclarationTest : CXXMethodDeclarationTest { protected override Task ConstructorTestImpl() @@ -423,9 +425,9 @@ public unsafe partial struct MyStruct {{ public void** lpVtbl; - public int GetType(int objA, int objB) + public int GetType(int obj) {{ - return ((delegate* unmanaged[Thiscall])(lpVtbl[0]))((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); + return ((delegate* unmanaged[Thiscall])(lpVtbl[0]))((MyStruct*)Unsafe.AsPointer(ref this), obj); }} public new int GetType() @@ -433,9 +435,9 @@ public new int GetType() return ((delegate* unmanaged[Thiscall])(lpVtbl[1]))((MyStruct*)Unsafe.AsPointer(ref this)); }} - public int GetType(int obj) + public int GetType(int objA, int objB) {{ - return ((delegate* unmanaged[Thiscall])(lpVtbl[2]))((MyStruct*)Unsafe.AsPointer(ref this), obj); + return ((delegate* unmanaged[Thiscall])(lpVtbl[2]))((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); }} }} }} @@ -468,9 +470,9 @@ public unsafe partial struct MyStruct {{ public Vtbl* lpVtbl; - public int GetType(int objA, int objB) + public int GetType(int obj) {{ - return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); + return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), obj); }} public new int GetType() @@ -478,21 +480,21 @@ public new int GetType() return lpVtbl->GetType1((MyStruct*)Unsafe.AsPointer(ref this)); }} - public int GetType(int obj) + public int GetType(int objA, int objB) {{ - return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), obj); + return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); }} public partial struct Vtbl {{ - [NativeTypeName(""int (int, int){nativeCallConv}"")] - public new delegate* unmanaged[Thiscall] GetType; + [NativeTypeName(""int (int){nativeCallConv}"")] + public new delegate* unmanaged[Thiscall] GetType; [NativeTypeName(""int (){nativeCallConv}"")] public delegate* unmanaged[Thiscall] GetType1; - [NativeTypeName(""int (int){nativeCallConv}"")] - public delegate* unmanaged[Thiscall] GetType2; + [NativeTypeName(""int (int, int){nativeCallConv}"")] + public delegate* unmanaged[Thiscall] GetType2; }} }} }} @@ -525,9 +527,9 @@ public unsafe partial struct MyStruct : MyStruct.Interface {{ public Vtbl* lpVtbl; - public int GetType(int objA, int objB) + public int GetType(int obj) {{ - return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); + return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), obj); }} public new int GetType() @@ -535,31 +537,31 @@ public new int GetType() return lpVtbl->GetType1((MyStruct*)Unsafe.AsPointer(ref this)); }} - public int GetType(int obj) + public int GetType(int objA, int objB) {{ - return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), obj); + return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); }} public interface Interface {{ - int GetType(int objA, int objB); + int GetType(int obj); int GetType(); - int GetType(int obj); + int GetType(int objA, int objB); }} public partial struct Vtbl where TSelf : unmanaged, Interface {{ - [NativeTypeName(""int (int, int){nativeCallConv}"")] - public new delegate* unmanaged[Thiscall] GetType; + [NativeTypeName(""int (int){nativeCallConv}"")] + public new delegate* unmanaged[Thiscall] GetType; [NativeTypeName(""int (){nativeCallConv}"")] public delegate* unmanaged[Thiscall] GetType1; - [NativeTypeName(""int (int){nativeCallConv}"")] - public delegate* unmanaged[Thiscall] GetType2; + [NativeTypeName(""int (int, int){nativeCallConv}"")] + public delegate* unmanaged[Thiscall] GetType2; }} }} }} diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/DeprecatedToObsoleteTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/DeprecatedToObsoleteTest.cs index c7219b8b..335c8a5c 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/DeprecatedToObsoleteTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/DeprecatedToObsoleteTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpPreviewUnix_DeprecatedToObsoleteTest : DeprecatedToObsoleteTest { protected override Task SimpleStructMembersImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/EnumDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/EnumDeclarationTest.cs index acdd787d..3d485f8b 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/EnumDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/EnumDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpPreviewUnix_EnumDeclarationTest : EnumDeclarationTest { protected override Task BasicTestImpl() @@ -575,7 +577,7 @@ public enum MyEnum2 public static partial class Methods { - public const int MyEnum1_Value1 = 1; + public const uint MyEnum1_Value1 = 1; } } "; @@ -598,7 +600,7 @@ protected override Task WithReferenceToAnonymousEnumEnumeratorTestImpl() { public static partial class Methods { - public const int MyEnum1_Value1 = 1; + public const uint MyEnum1_Value1 = 1; [NativeTypeName(""const int"")] public const int MyEnum2_Value1 = (int)(MyEnum1_Value1) + 1; diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/FunctionDeclarationBodyImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/FunctionDeclarationBodyImportTest.cs index 68b2efa7..7c0507bb 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/FunctionDeclarationBodyImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/FunctionDeclarationBodyImportTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpPreviewUnix_FunctionDeclarationBodyImportTest : FunctionDeclarationBodyImportTest { protected override Task ArraySubscriptTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/FunctionDeclarationDllImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/FunctionDeclarationDllImportTest.cs index 97491edb..e079637d 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/FunctionDeclarationDllImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/FunctionDeclarationDllImportTest.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpPreviewUnix_FunctionDeclarationDllImportTest : FunctionDeclarationDllImportTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/FunctionPointerDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/FunctionPointerDeclarationTest.cs index 306535f9..b37a7dc9 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/FunctionPointerDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/FunctionPointerDeclarationTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpPreviewUnix_FunctionPointerDeclarationTest : FunctionPointerDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/StructDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/StructDeclarationTest.cs index c8ca84a3..3716ac26 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/StructDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/StructDeclarationTest.cs @@ -4,9 +4,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpPreviewUnix_StructDeclarationTest : StructDeclarationTest { protected override Task IncompleteArraySizeTestImpl(string nativeType, string expectedManagedType) @@ -1841,7 +1843,9 @@ public partial struct MyStruct3 protected override Task WithPackingTestImpl() { - const string InputContents = @"struct MyStruct + const string InputContents = @"typedef int size_t; + +struct MyStruct { size_t FixedBuffer[1]; }; diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/UnionDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/UnionDeclarationTest.cs index 6015518e..9a54276b 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/UnionDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/UnionDeclarationTest.cs @@ -1,12 +1,13 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. -using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpPreviewUnix_UnionDeclarationTest : UnionDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/VarDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/VarDeclarationTest.cs index c90f5fec..0ab01dfb 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/VarDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewUnix/VarDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class CSharpPreviewUnix_VarDeclarationTest : VarDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/CXXMethodDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/CXXMethodDeclarationTest.cs index 8e51fefd..59ed024a 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/CXXMethodDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/CXXMethodDeclarationTest.cs @@ -3,9 +3,11 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpPreviewWindows_CXXMethodDeclarationTest : CXXMethodDeclarationTest { protected override Task ConstructorTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/DeprecatedToObsoleteTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/DeprecatedToObsoleteTest.cs index e29bc04e..b18e9ae2 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/DeprecatedToObsoleteTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/DeprecatedToObsoleteTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpPreviewWindows_DeprecatedToObsoleteTest : DeprecatedToObsoleteTest { protected override Task SimpleStructMembersImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/EnumDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/EnumDeclarationTest.cs index 5b6dc595..b435b243 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/EnumDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/EnumDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpPreviewWindows_EnumDeclarationTest : EnumDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/FunctionDeclarationBodyImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/FunctionDeclarationBodyImportTest.cs index dea83cdf..d6502c71 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/FunctionDeclarationBodyImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/FunctionDeclarationBodyImportTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpPreviewWindows_FunctionDeclarationBodyImportTest : FunctionDeclarationBodyImportTest { protected override Task ArraySubscriptTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/FunctionDeclarationDllImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/FunctionDeclarationDllImportTest.cs index 7d50416b..4fbeb1e4 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/FunctionDeclarationDllImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/FunctionDeclarationDllImportTest.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpPreviewWindows_FunctionDeclarationDllImportTest : FunctionDeclarationDllImportTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/FunctionPointerDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/FunctionPointerDeclarationTest.cs index df41fefd..35e7a5c2 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/FunctionPointerDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/FunctionPointerDeclarationTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpPreviewWindows_FunctionPointerDeclarationTest : FunctionPointerDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/StructDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/StructDeclarationTest.cs index 69763c80..3a43d637 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/StructDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/StructDeclarationTest.cs @@ -4,9 +4,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpPreviewWindows_StructDeclarationTest : StructDeclarationTest { protected override Task IncompleteArraySizeTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/UnionDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/UnionDeclarationTest.cs index bfaa48b2..7e8302e6 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/UnionDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/UnionDeclarationTest.cs @@ -1,12 +1,13 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. -using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpPreviewWindows_UnionDeclarationTest : UnionDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/VarDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/VarDeclarationTest.cs index 6386ad82..714c18ed 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/VarDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/CSharpPreviewWindows/VarDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class CSharpPreviewWindows_VarDeclarationTest : VarDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/PInvokeGeneratorTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/PInvokeGeneratorTest.cs index 53637790..c64a0a52 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/PInvokeGeneratorTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/PInvokeGeneratorTest.cs @@ -4,9 +4,9 @@ using System.Diagnostics; using System.IO; using System.Threading.Tasks; +using NUnit.Framework; using System.Xml.Linq; using ClangSharp.Interop; -using NUnit.Framework; using static ClangSharp.Interop.CXTranslationUnit_Flags; namespace ClangSharp.UnitTests; diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/CXXMethodDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/CXXMethodDeclarationTest.cs index 21066678..b4ed6c64 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/CXXMethodDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/CXXMethodDeclarationTest.cs @@ -3,9 +3,11 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlCompatibleUnix_CXXMethodDeclarationTest : CXXMethodDeclarationXmlTest { protected override Task ConstructorTestImpl() @@ -484,10 +486,7 @@ protected override Task NewKeywordVirtualTestImpl() MyStruct* - - int - - + int @@ -502,22 +501,22 @@ protected override Task NewKeywordVirtualTestImpl() MyStruct* - + + int + + int int - - int - - + int fixed (MyStruct* pThis = &this) {{ - return Marshal.GetDelegateForFunctionPointer<_GetType>((IntPtr)(lpVtbl[0]))(pThis, objA, objB); + return Marshal.GetDelegateForFunctionPointer<_GetType>((IntPtr)(lpVtbl[0]))(pThis, obj); }} @@ -532,13 +531,16 @@ protected override Task NewKeywordVirtualTestImpl() int - + + int + + int fixed (MyStruct* pThis = &this) {{ - return Marshal.GetDelegateForFunctionPointer<_GetType2>((IntPtr)(lpVtbl[2]))(pThis, obj); + return Marshal.GetDelegateForFunctionPointer<_GetType2>((IntPtr)(lpVtbl[2]))(pThis, objA, objB); }} @@ -578,10 +580,7 @@ protected override Task NewKeywordVirtualWithExplicitVtblTestImpl() MyStruct* - - int - - + int @@ -596,22 +595,22 @@ protected override Task NewKeywordVirtualWithExplicitVtblTestImpl() MyStruct* - + + int + + int int - - int - - + int fixed (MyStruct* pThis = &this) {{ - return Marshal.GetDelegateForFunctionPointer<_GetType>(lpVtbl->GetType)(pThis, objA, objB); + return Marshal.GetDelegateForFunctionPointer<_GetType>(lpVtbl->GetType)(pThis, obj); }} @@ -626,25 +625,28 @@ protected override Task NewKeywordVirtualWithExplicitVtblTestImpl() int - + + int + + int fixed (MyStruct* pThis = &this) {{ - return Marshal.GetDelegateForFunctionPointer<_GetType2>(lpVtbl->GetType2)(pThis, obj); + return Marshal.GetDelegateForFunctionPointer<_GetType2>(lpVtbl->GetType2)(pThis, objA, objB); }} - IntPtr + IntPtr IntPtr - IntPtr + IntPtr @@ -683,10 +685,7 @@ protected override Task NewKeywordVirtualWithExplicitVtblAndMarkerInterfaceTestI MyStruct* - - int - - + int @@ -701,22 +700,22 @@ protected override Task NewKeywordVirtualWithExplicitVtblAndMarkerInterfaceTestI MyStruct* - + + int + + int int - - int - - + int fixed (MyStruct* pThis = &this) {{ - return Marshal.GetDelegateForFunctionPointer<_GetType>(lpVtbl->GetType)(pThis, objA, objB); + return Marshal.GetDelegateForFunctionPointer<_GetType>(lpVtbl->GetType)(pThis, obj); }} @@ -731,23 +730,23 @@ protected override Task NewKeywordVirtualWithExplicitVtblAndMarkerInterfaceTestI int - + + int + + int fixed (MyStruct* pThis = &this) {{ - return Marshal.GetDelegateForFunctionPointer<_GetType2>(lpVtbl->GetType2)(pThis, obj); + return Marshal.GetDelegateForFunctionPointer<_GetType2>(lpVtbl->GetType2)(pThis, objA, objB); }} int - - int - - + int @@ -756,20 +755,23 @@ protected override Task NewKeywordVirtualWithExplicitVtblAndMarkerInterfaceTestI int - + + int + + int - IntPtr + IntPtr IntPtr - IntPtr + IntPtr diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/DeprecatedToObsoleteTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/DeprecatedToObsoleteTest.cs index 148de6d8..2e8b4848 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/DeprecatedToObsoleteTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/DeprecatedToObsoleteTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlCompatibleUnix_DeprecatedToObsoleteTest : DeprecatedToObsoleteTest { protected override Task SimpleStructMembersImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/EnumDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/EnumDeclarationTest.cs index 34c5260c..6beadedb 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/EnumDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/EnumDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlCompatibleUnix_EnumDeclarationTest : EnumDeclarationTest { protected override Task BasicTestImpl() @@ -680,7 +682,7 @@ enum MyEnum2 : int - int + uint 1 @@ -709,7 +711,7 @@ protected override Task WithReferenceToAnonymousEnumEnumeratorTestImpl() - int + uint 1 diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/FunctionDeclarationBodyImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/FunctionDeclarationBodyImportTest.cs index ccf8a28a..03f31904 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/FunctionDeclarationBodyImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/FunctionDeclarationBodyImportTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlCompatibleUnix_FunctionDeclarationBodyImportTest : FunctionDeclarationBodyImportTest { protected override Task ArraySubscriptTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/FunctionDeclarationDllImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/FunctionDeclarationDllImportTest.cs index ec3977ef..d1ff401d 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/FunctionDeclarationDllImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/FunctionDeclarationDllImportTest.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlCompatibleUnix_FunctionDeclarationDllImportTest : FunctionDeclarationDllImportTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/FunctionPointerDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/FunctionPointerDeclarationTest.cs index 32d626ee..8d727175 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/FunctionPointerDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/FunctionPointerDeclarationTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlCompatibleUnix_FunctionPointerDeclarationTest : FunctionPointerDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/StructDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/StructDeclarationTest.cs index 1eeaf41a..899ba55e 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/StructDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/StructDeclarationTest.cs @@ -4,9 +4,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlCompatibleUnix_StructDeclarationTest : StructDeclarationTest { protected override Task IncompleteArraySizeTestImpl(string nativeType, string expectedManagedType) @@ -1905,7 +1907,9 @@ struct MyStruct3 protected override Task WithPackingTestImpl() { - const string InputContents = @"struct MyStruct + const string InputContents = @"typedef int size_t; + +struct MyStruct { size_t FixedBuffer[1]; }; diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/UnionDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/UnionDeclarationTest.cs index fe430d13..fba277e2 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/UnionDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/UnionDeclarationTest.cs @@ -1,12 +1,13 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. -using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlCompatibleUnix_UnionDeclarationTest : UnionDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/VarDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/VarDeclarationTest.cs index 45f7a3fa..37103690 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/VarDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleUnix/VarDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlCompatibleUnix_VarDeclarationTest : VarDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/CXXMethodDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/CXXMethodDeclarationTest.cs index bcd409ee..189d2622 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/CXXMethodDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/CXXMethodDeclarationTest.cs @@ -3,9 +3,11 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlCompatibleWindows_CXXMethodDeclarationTest : CXXMethodDeclarationXmlTest { protected override Task ConstructorTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/DeprecatedToObsoleteTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/DeprecatedToObsoleteTest.cs index 3b547a53..5e571f29 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/DeprecatedToObsoleteTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/DeprecatedToObsoleteTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlCompatibleWindows_DeprecatedToObsoleteTest : DeprecatedToObsoleteTest { protected override Task SimpleStructMembersImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/EnumDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/EnumDeclarationTest.cs index 5bb0fb96..856c2edd 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/EnumDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/EnumDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlCompatibleWindows_EnumDeclarationTest : EnumDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/FunctionDeclarationBodyImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/FunctionDeclarationBodyImportTest.cs index 83571b43..7bd2c912 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/FunctionDeclarationBodyImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/FunctionDeclarationBodyImportTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlCompatibleWindows_FunctionDeclarationBodyImportTest : FunctionDeclarationBodyImportTest { protected override Task ArraySubscriptTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/FunctionDeclarationDllImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/FunctionDeclarationDllImportTest.cs index 6c6a5167..28508ac3 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/FunctionDeclarationDllImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/FunctionDeclarationDllImportTest.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlCompatibleWindows_FunctionDeclarationDllImportTest : FunctionDeclarationDllImportTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/FunctionPointerDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/FunctionPointerDeclarationTest.cs index a762a71a..d218388b 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/FunctionPointerDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/FunctionPointerDeclarationTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlCompatibleWindows_FunctionPointerDeclarationTest : FunctionPointerDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/StructDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/StructDeclarationTest.cs index 9cfa644e..b751686f 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/StructDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/StructDeclarationTest.cs @@ -4,9 +4,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlCompatibleWindows_StructDeclarationTest : StructDeclarationTest { protected override Task IncompleteArraySizeTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/UnionDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/UnionDeclarationTest.cs index a3af56a2..a48dc61d 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/UnionDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/UnionDeclarationTest.cs @@ -1,12 +1,13 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. -using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlCompatibleWindows_UnionDeclarationTest : UnionDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/VarDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/VarDeclarationTest.cs index e051510b..fc6e0f25 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/VarDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlCompatibleWindows/VarDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlCompatibleWindows_VarDeclarationTest : VarDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/CXXMethodDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/CXXMethodDeclarationTest.cs index c3819711..0f0f5e63 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/CXXMethodDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/CXXMethodDeclarationTest.cs @@ -3,9 +3,11 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlDefaultUnix_CXXMethodDeclarationTest : CXXMethodDeclarationXmlTest { protected override Task ConstructorTestImpl() @@ -481,14 +483,11 @@ protected override Task NewKeywordVirtualTestImpl() int - - int - - + int - return ((delegate* unmanaged[Thiscall]<MyStruct*, int, int, int>)(lpVtbl[0]))((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); + return ((delegate* unmanaged[Thiscall]<MyStruct*, int, int>)(lpVtbl[0]))((MyStruct*)Unsafe.AsPointer(ref this), obj); @@ -499,11 +498,14 @@ protected override Task NewKeywordVirtualTestImpl() int - + + int + + int - return ((delegate* unmanaged[Thiscall]<MyStruct*, int, int>)(lpVtbl[2]))((MyStruct*)Unsafe.AsPointer(ref this), obj); + return ((delegate* unmanaged[Thiscall]<MyStruct*, int, int, int>)(lpVtbl[2]))((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); @@ -539,14 +541,11 @@ protected override Task NewKeywordVirtualWithExplicitVtblTestImpl() int - - int - - + int - return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); + return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), obj); @@ -557,22 +556,25 @@ protected override Task NewKeywordVirtualWithExplicitVtblTestImpl() int - + + int + + int - return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), obj); + return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); - delegate* unmanaged[Thiscall]<MyStruct*, int, int, int> + delegate* unmanaged[Thiscall]<MyStruct*, int, int> delegate* unmanaged[Thiscall]<MyStruct*, int> - delegate* unmanaged[Thiscall]<MyStruct*, int, int> + delegate* unmanaged[Thiscall]<MyStruct*, int, int, int> @@ -608,14 +610,11 @@ protected override Task NewKeywordVirtualWithExplicitVtblAndMarkerInterfaceTestI int - - int - - + int - return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); + return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), obj); @@ -626,20 +625,20 @@ protected override Task NewKeywordVirtualWithExplicitVtblAndMarkerInterfaceTestI int - + + int + + int - return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), obj); + return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); int - - int - - + int @@ -648,20 +647,23 @@ protected override Task NewKeywordVirtualWithExplicitVtblAndMarkerInterfaceTestI int - + + int + + int - delegate* unmanaged[Thiscall]<TSelf*, int, int, int> + delegate* unmanaged[Thiscall]<TSelf*, int, int> delegate* unmanaged[Thiscall]<TSelf*, int> - delegate* unmanaged[Thiscall]<TSelf*, int, int> + delegate* unmanaged[Thiscall]<TSelf*, int, int, int> diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/DeprecatedToObsoleteTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/DeprecatedToObsoleteTest.cs index 4b4e4117..7cd8fca6 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/DeprecatedToObsoleteTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/DeprecatedToObsoleteTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlDefaultUnix_DeprecatedToObsoleteTest : DeprecatedToObsoleteTest { protected override Task SimpleStructMembersImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/EnumDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/EnumDeclarationTest.cs index 51bdffb6..7e116390 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/EnumDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/EnumDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlDefaultUnix_EnumDeclarationTest : EnumDeclarationTest { protected override Task BasicTestImpl() @@ -680,7 +682,7 @@ enum MyEnum2 : int - int + uint 1 @@ -709,7 +711,7 @@ protected override Task WithReferenceToAnonymousEnumEnumeratorTestImpl() - int + uint 1 diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/FunctionDeclarationBodyImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/FunctionDeclarationBodyImportTest.cs index 074e5e7f..f54f80ff 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/FunctionDeclarationBodyImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/FunctionDeclarationBodyImportTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlDefaultUnix_FunctionDeclarationBodyImportTest : FunctionDeclarationBodyImportTest { protected override Task ArraySubscriptTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/FunctionDeclarationDllImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/FunctionDeclarationDllImportTest.cs index 277216f6..ad2a82a8 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/FunctionDeclarationDllImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/FunctionDeclarationDllImportTest.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlDefaultUnix_FunctionDeclarationDllImportTest : FunctionDeclarationDllImportTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/FunctionPointerDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/FunctionPointerDeclarationTest.cs index f1d0c73a..7ddd213a 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/FunctionPointerDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/FunctionPointerDeclarationTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlDefaultUnix_FunctionPointerDeclarationTest : FunctionPointerDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/StructDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/StructDeclarationTest.cs index 369c7914..3c8b5a83 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/StructDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/StructDeclarationTest.cs @@ -4,9 +4,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlDefaultUnix_StructDeclarationTest : StructDeclarationTest { protected override Task IncompleteArraySizeTestImpl(string nativeType, string expectedManagedType) @@ -1885,7 +1887,9 @@ struct MyStruct3 protected override Task WithPackingTestImpl() { - const string InputContents = @"struct MyStruct + const string InputContents = @"typedef int size_t; + +struct MyStruct { size_t FixedBuffer[1]; }; diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/UnionDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/UnionDeclarationTest.cs index cc480472..3b39053e 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/UnionDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/UnionDeclarationTest.cs @@ -1,12 +1,13 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. -using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlDefaultUnix_UnionDeclarationTest : UnionDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/VarDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/VarDeclarationTest.cs index 47830d15..26aa0acf 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/VarDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultUnix/VarDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlDefaultUnix_VarDeclarationTest : VarDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/CXXMethodDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/CXXMethodDeclarationTest.cs index 60c9ce03..82435999 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/CXXMethodDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/CXXMethodDeclarationTest.cs @@ -3,9 +3,11 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlDefaultWindows_CXXMethodDeclarationTest : CXXMethodDeclarationXmlTest { protected override Task ConstructorTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/DeprecatedToObsoleteTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/DeprecatedToObsoleteTest.cs index 8a0e5423..0a45b2d1 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/DeprecatedToObsoleteTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/DeprecatedToObsoleteTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlDefaultWindows_DeprecatedToObsoleteTest : DeprecatedToObsoleteTest { protected override Task SimpleStructMembersImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/EnumDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/EnumDeclarationTest.cs index f4259061..d42f3d2b 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/EnumDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/EnumDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlDefaultWindows_EnumDeclarationTest : EnumDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/FunctionDeclarationBodyImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/FunctionDeclarationBodyImportTest.cs index 3a1a633f..00348ce7 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/FunctionDeclarationBodyImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/FunctionDeclarationBodyImportTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlDefaultWindows_FunctionDeclarationBodyImportTest : FunctionDeclarationBodyImportTest { protected override Task ArraySubscriptTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/FunctionDeclarationDllImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/FunctionDeclarationDllImportTest.cs index fccbad41..79a1ea0d 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/FunctionDeclarationDllImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/FunctionDeclarationDllImportTest.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlDefaultWindows_FunctionDeclarationDllImportTest : FunctionDeclarationDllImportTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/FunctionPointerDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/FunctionPointerDeclarationTest.cs index e5342d0a..373f3da5 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/FunctionPointerDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/FunctionPointerDeclarationTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlDefaultWindows_FunctionPointerDeclarationTest : FunctionPointerDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/StructDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/StructDeclarationTest.cs index b9bcee3a..128bfc45 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/StructDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/StructDeclarationTest.cs @@ -4,9 +4,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlDefaultWindows_StructDeclarationTest : StructDeclarationTest { protected override Task IncompleteArraySizeTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/UnionDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/UnionDeclarationTest.cs index 31c6d3f8..6064c700 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/UnionDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/UnionDeclarationTest.cs @@ -1,12 +1,13 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. -using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlDefaultWindows_UnionDeclarationTest : UnionDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/VarDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/VarDeclarationTest.cs index 1838ec4b..32a1e7f7 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/VarDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlDefaultWindows/VarDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlDefaultWindows_VarDeclarationTest : VarDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/CXXMethodDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/CXXMethodDeclarationTest.cs index 22978b0c..c71b11b2 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/CXXMethodDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/CXXMethodDeclarationTest.cs @@ -3,9 +3,11 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlLatestUnix_CXXMethodDeclarationTest : CXXMethodDeclarationXmlTest { protected override Task ConstructorTestImpl() @@ -481,14 +483,11 @@ protected override Task NewKeywordVirtualTestImpl() int - - int - - + int - return ((delegate* unmanaged[Thiscall]<MyStruct*, int, int, int>)(lpVtbl[0]))((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); + return ((delegate* unmanaged[Thiscall]<MyStruct*, int, int>)(lpVtbl[0]))((MyStruct*)Unsafe.AsPointer(ref this), obj); @@ -499,11 +498,14 @@ protected override Task NewKeywordVirtualTestImpl() int - + + int + + int - return ((delegate* unmanaged[Thiscall]<MyStruct*, int, int>)(lpVtbl[2]))((MyStruct*)Unsafe.AsPointer(ref this), obj); + return ((delegate* unmanaged[Thiscall]<MyStruct*, int, int, int>)(lpVtbl[2]))((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); @@ -539,14 +541,11 @@ protected override Task NewKeywordVirtualWithExplicitVtblTestImpl() int - - int - - + int - return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); + return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), obj); @@ -557,22 +556,25 @@ protected override Task NewKeywordVirtualWithExplicitVtblTestImpl() int - + + int + + int - return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), obj); + return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); - delegate* unmanaged[Thiscall]<MyStruct*, int, int, int> + delegate* unmanaged[Thiscall]<MyStruct*, int, int> delegate* unmanaged[Thiscall]<MyStruct*, int> - delegate* unmanaged[Thiscall]<MyStruct*, int, int> + delegate* unmanaged[Thiscall]<MyStruct*, int, int, int> @@ -608,14 +610,11 @@ protected override Task NewKeywordVirtualWithExplicitVtblAndMarkerInterfaceTestI int - - int - - + int - return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); + return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), obj); @@ -626,20 +625,20 @@ protected override Task NewKeywordVirtualWithExplicitVtblAndMarkerInterfaceTestI int - + + int + + int - return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), obj); + return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); int - - int - - + int @@ -648,20 +647,23 @@ protected override Task NewKeywordVirtualWithExplicitVtblAndMarkerInterfaceTestI int - + + int + + int - delegate* unmanaged[Thiscall]<TSelf*, int, int, int> + delegate* unmanaged[Thiscall]<TSelf*, int, int> delegate* unmanaged[Thiscall]<TSelf*, int> - delegate* unmanaged[Thiscall]<TSelf*, int, int> + delegate* unmanaged[Thiscall]<TSelf*, int, int, int> diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/DeprecatedToObsoleteTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/DeprecatedToObsoleteTest.cs index 54dca338..36d7c219 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/DeprecatedToObsoleteTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/DeprecatedToObsoleteTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlLatestUnix_DeprecatedToObsoleteTest : DeprecatedToObsoleteTest { protected override Task SimpleStructMembersImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/EnumDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/EnumDeclarationTest.cs index 2fecdfa2..ce063a40 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/EnumDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/EnumDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlLatestUnix_EnumDeclarationTest : EnumDeclarationTest { protected override Task BasicTestImpl() @@ -680,7 +682,7 @@ enum MyEnum2 : int - int + uint 1 @@ -709,7 +711,7 @@ protected override Task WithReferenceToAnonymousEnumEnumeratorTestImpl() - int + uint 1 diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/FunctionDeclarationBodyImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/FunctionDeclarationBodyImportTest.cs index 06cf0a52..861c27f3 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/FunctionDeclarationBodyImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/FunctionDeclarationBodyImportTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlLatestUnix_FunctionDeclarationBodyImportTest : FunctionDeclarationBodyImportTest { protected override Task ArraySubscriptTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/FunctionDeclarationDllImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/FunctionDeclarationDllImportTest.cs index 4b51102f..ce5041aa 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/FunctionDeclarationDllImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/FunctionDeclarationDllImportTest.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlLatestUnix_FunctionDeclarationDllImportTest : FunctionDeclarationDllImportTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/FunctionPointerDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/FunctionPointerDeclarationTest.cs index c0be5b45..6c03dc0c 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/FunctionPointerDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/FunctionPointerDeclarationTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlLatestUnix_FunctionPointerDeclarationTest : FunctionPointerDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/StructDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/StructDeclarationTest.cs index 5190c342..6fbe2884 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/StructDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/StructDeclarationTest.cs @@ -4,9 +4,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlLatestUnix_StructDeclarationTest : StructDeclarationTest { protected override Task IncompleteArraySizeTestImpl(string nativeType, string expectedManagedType) @@ -1885,7 +1887,9 @@ struct MyStruct3 protected override Task WithPackingTestImpl() { - const string InputContents = @"struct MyStruct + const string InputContents = @"typedef int size_t; + +struct MyStruct { size_t FixedBuffer[1]; }; diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/UnionDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/UnionDeclarationTest.cs index cb74e887..ce508bf7 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/UnionDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/UnionDeclarationTest.cs @@ -1,12 +1,13 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. -using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlLatestUnix_UnionDeclarationTest : UnionDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/VarDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/VarDeclarationTest.cs index 3f25701e..26187922 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/VarDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestUnix/VarDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlLatestUnix_VarDeclarationTest : VarDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/CXXMethodDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/CXXMethodDeclarationTest.cs index ead9e451..947e12c8 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/CXXMethodDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/CXXMethodDeclarationTest.cs @@ -3,9 +3,11 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlLatestWindows_CXXMethodDeclarationTest : CXXMethodDeclarationXmlTest { protected override Task ConstructorTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/DeprecatedToObsoleteTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/DeprecatedToObsoleteTest.cs index 1daae4dc..f6de9033 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/DeprecatedToObsoleteTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/DeprecatedToObsoleteTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlLatestWindows_DeprecatedToObsoleteTest : DeprecatedToObsoleteTest { protected override Task SimpleStructMembersImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/EnumDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/EnumDeclarationTest.cs index 07eb0393..32dfb994 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/EnumDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/EnumDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlLatestWindows_EnumDeclarationTest : EnumDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/FunctionDeclarationBodyImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/FunctionDeclarationBodyImportTest.cs index 0de2dc3f..bdca15de 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/FunctionDeclarationBodyImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/FunctionDeclarationBodyImportTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlLatestWindows_FunctionDeclarationBodyImportTest : FunctionDeclarationBodyImportTest { protected override Task ArraySubscriptTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/FunctionDeclarationDllImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/FunctionDeclarationDllImportTest.cs index 80d4336a..43f39925 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/FunctionDeclarationDllImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/FunctionDeclarationDllImportTest.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlLatestWindows_FunctionDeclarationDllImportTest : FunctionDeclarationDllImportTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/FunctionPointerDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/FunctionPointerDeclarationTest.cs index e807dda2..68f182af 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/FunctionPointerDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/FunctionPointerDeclarationTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlLatestWindows_FunctionPointerDeclarationTest : FunctionPointerDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/StructDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/StructDeclarationTest.cs index ce9855df..7ceab0a9 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/StructDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/StructDeclarationTest.cs @@ -4,9 +4,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlLatestWindows_StructDeclarationTest : StructDeclarationTest { protected override Task IncompleteArraySizeTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/UnionDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/UnionDeclarationTest.cs index 27dbb2d1..74376381 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/UnionDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/UnionDeclarationTest.cs @@ -1,12 +1,13 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. -using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlLatestWindows_UnionDeclarationTest : UnionDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/VarDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/VarDeclarationTest.cs index 720b0e90..1c1ae4dc 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/VarDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlLatestWindows/VarDeclarationTest.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlLatestWindows_VarDeclarationTest : VarDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/CXXMethodDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/CXXMethodDeclarationTest.cs index d111de8a..630770a9 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/CXXMethodDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/CXXMethodDeclarationTest.cs @@ -3,9 +3,11 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlPreviewUnix_CXXMethodDeclarationTest : CXXMethodDeclarationXmlTest { protected override Task ConstructorTestImpl() @@ -481,14 +483,11 @@ protected override Task NewKeywordVirtualTestImpl() int - - int - - + int - return ((delegate* unmanaged[Thiscall]<MyStruct*, int, int, int>)(lpVtbl[0]))((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); + return ((delegate* unmanaged[Thiscall]<MyStruct*, int, int>)(lpVtbl[0]))((MyStruct*)Unsafe.AsPointer(ref this), obj); @@ -499,11 +498,14 @@ protected override Task NewKeywordVirtualTestImpl() int - + + int + + int - return ((delegate* unmanaged[Thiscall]<MyStruct*, int, int>)(lpVtbl[2]))((MyStruct*)Unsafe.AsPointer(ref this), obj); + return ((delegate* unmanaged[Thiscall]<MyStruct*, int, int, int>)(lpVtbl[2]))((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); @@ -539,14 +541,11 @@ protected override Task NewKeywordVirtualWithExplicitVtblTestImpl() int - - int - - + int - return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); + return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), obj); @@ -557,22 +556,25 @@ protected override Task NewKeywordVirtualWithExplicitVtblTestImpl() int - + + int + + int - return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), obj); + return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); - delegate* unmanaged[Thiscall]<MyStruct*, int, int, int> + delegate* unmanaged[Thiscall]<MyStruct*, int, int> delegate* unmanaged[Thiscall]<MyStruct*, int> - delegate* unmanaged[Thiscall]<MyStruct*, int, int> + delegate* unmanaged[Thiscall]<MyStruct*, int, int, int> @@ -608,14 +610,11 @@ protected override Task NewKeywordVirtualWithExplicitVtblAndMarkerInterfaceTestI int - - int - - + int - return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); + return lpVtbl->GetType((MyStruct*)Unsafe.AsPointer(ref this), obj); @@ -626,20 +625,20 @@ protected override Task NewKeywordVirtualWithExplicitVtblAndMarkerInterfaceTestI int - + + int + + int - return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), obj); + return lpVtbl->GetType2((MyStruct*)Unsafe.AsPointer(ref this), objA, objB); int - - int - - + int @@ -648,20 +647,23 @@ protected override Task NewKeywordVirtualWithExplicitVtblAndMarkerInterfaceTestI int - + + int + + int - delegate* unmanaged[Thiscall]<TSelf*, int, int, int> + delegate* unmanaged[Thiscall]<TSelf*, int, int> delegate* unmanaged[Thiscall]<TSelf*, int> - delegate* unmanaged[Thiscall]<TSelf*, int, int> + delegate* unmanaged[Thiscall]<TSelf*, int, int, int> diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/DeprecatedToObsoleteTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/DeprecatedToObsoleteTest.cs index 7df42fb6..4a33ede7 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/DeprecatedToObsoleteTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/DeprecatedToObsoleteTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlPreviewUnix_DeprecatedToObsoleteTest : DeprecatedToObsoleteTest { protected override Task SimpleStructMembersImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/EnumDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/EnumDeclarationTest.cs index d4470508..76537a1f 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/EnumDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/EnumDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlPreviewUnix_EnumDeclarationTest : EnumDeclarationTest { protected override Task BasicTestImpl() @@ -680,7 +682,7 @@ enum MyEnum2 : int - int + uint 1 @@ -709,7 +711,7 @@ protected override Task WithReferenceToAnonymousEnumEnumeratorTestImpl() - int + uint 1 diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/FunctionDeclarationBodyImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/FunctionDeclarationBodyImportTest.cs index aeed7100..790a437c 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/FunctionDeclarationBodyImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/FunctionDeclarationBodyImportTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlPreviewUnix_FunctionDeclarationBodyImportTest : FunctionDeclarationBodyImportTest { protected override Task ArraySubscriptTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/FunctionDeclarationDllImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/FunctionDeclarationDllImportTest.cs index 0932e32b..ed3a3bad 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/FunctionDeclarationDllImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/FunctionDeclarationDllImportTest.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlPreviewUnix_FunctionDeclarationDllImportTest : FunctionDeclarationDllImportTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/FunctionPointerDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/FunctionPointerDeclarationTest.cs index 9df4290f..5ccea7ec 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/FunctionPointerDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/FunctionPointerDeclarationTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlPreviewUnix_FunctionPointerDeclarationTest : FunctionPointerDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/StructDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/StructDeclarationTest.cs index 5f5ca818..3aaa163e 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/StructDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/StructDeclarationTest.cs @@ -4,9 +4,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlPreviewUnix_StructDeclarationTest : StructDeclarationTest { protected override Task IncompleteArraySizeTestImpl(string nativeType, string expectedManagedType) @@ -1729,7 +1731,9 @@ struct MyStruct3 protected override Task WithPackingTestImpl() { - const string InputContents = @"struct MyStruct + const string InputContents = @"typedef int size_t; + +struct MyStruct { size_t FixedBuffer[1]; }; diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/UnionDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/UnionDeclarationTest.cs index 3237e297..3188695b 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/UnionDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/UnionDeclarationTest.cs @@ -1,12 +1,13 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. -using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlPreviewUnix_UnionDeclarationTest : UnionDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/VarDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/VarDeclarationTest.cs index d6416f80..84b87012 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/VarDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewUnix/VarDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("unix")] public sealed class XmlPreviewUnix_VarDeclarationTest : VarDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/CXXMethodDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/CXXMethodDeclarationTest.cs index 7aa48aa7..6a341edf 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/CXXMethodDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/CXXMethodDeclarationTest.cs @@ -3,9 +3,11 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlPreviewWindows_CXXMethodDeclarationTest : CXXMethodDeclarationXmlTest { protected override Task ConstructorTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/DeprecatedToObsoleteTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/DeprecatedToObsoleteTest.cs index b16803a4..7bc36051 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/DeprecatedToObsoleteTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/DeprecatedToObsoleteTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlPreviewWindows_DeprecatedToObsoleteTest : DeprecatedToObsoleteTest { protected override Task SimpleStructMembersImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/EnumDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/EnumDeclarationTest.cs index 9dac6dbe..babf4a06 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/EnumDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/EnumDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlPreviewWindows_EnumDeclarationTest : EnumDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/FunctionDeclarationBodyImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/FunctionDeclarationBodyImportTest.cs index a7297c31..98a64f6a 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/FunctionDeclarationBodyImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/FunctionDeclarationBodyImportTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlPreviewWindows_FunctionDeclarationBodyImportTest : FunctionDeclarationBodyImportTest { protected override Task ArraySubscriptTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/FunctionDeclarationDllImportTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/FunctionDeclarationDllImportTest.cs index 6688ab81..613f479f 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/FunctionDeclarationDllImportTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/FunctionDeclarationDllImportTest.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlPreviewWindows_FunctionDeclarationDllImportTest : FunctionDeclarationDllImportTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/FunctionPointerDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/FunctionPointerDeclarationTest.cs index 894a4bb9..31ad3ded 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/FunctionPointerDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/FunctionPointerDeclarationTest.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlPreviewWindows_FunctionPointerDeclarationTest : FunctionPointerDeclarationTest { protected override Task BasicTestImpl() diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/StructDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/StructDeclarationTest.cs index c3fe8b96..6045543f 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/StructDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/StructDeclarationTest.cs @@ -4,9 +4,11 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlPreviewWindows_StructDeclarationTest : StructDeclarationTest { protected override Task IncompleteArraySizeTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/UnionDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/UnionDeclarationTest.cs index a522a1e6..8809aa70 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/UnionDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/UnionDeclarationTest.cs @@ -1,12 +1,13 @@ // Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information. -using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlPreviewWindows_UnionDeclarationTest : UnionDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType) diff --git a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/VarDeclarationTest.cs b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/VarDeclarationTest.cs index dd8ed9a3..afe0fc7c 100644 --- a/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/VarDeclarationTest.cs +++ b/tests/ClangSharp.PInvokeGenerator.UnitTests/XmlPreviewWindows/VarDeclarationTest.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Threading.Tasks; +using NUnit.Framework; namespace ClangSharp.UnitTests; +[Platform("win")] public sealed class XmlPreviewWindows_VarDeclarationTest : VarDeclarationTest { protected override Task BasicTestImpl(string nativeType, string expectedManagedType)