diff options
Diffstat (limited to 'tests')
12 files changed, 32 insertions, 19 deletions
diff --git a/tests/src/Interop/ArrayMarshalling/ByValArray/MarshalArrayByValNative.cpp b/tests/src/Interop/ArrayMarshalling/ByValArray/MarshalArrayByValNative.cpp index a4600d08a5..26fbbac449 100644 --- a/tests/src/Interop/ArrayMarshalling/ByValArray/MarshalArrayByValNative.cpp +++ b/tests/src/Interop/ArrayMarshalling/ByValArray/MarshalArrayByValNative.cpp @@ -139,8 +139,8 @@ bool IsObjectEquals(LPSTR o1, LPSTR o2) template<> bool IsObjectEquals(LPCSTR o1, LPCSTR o2) { - int cLen1 = strlen(o1); - int cLen2 = strlen(o2); + size_t cLen1 = strlen(o1); + size_t cLen2 = strlen(o2); if (cLen1 != cLen2 ) { diff --git a/tests/src/Interop/MarshalAPI/FunctionPointer/GetDelForFcnPtr_Negative_Catchable.cs b/tests/src/Interop/MarshalAPI/FunctionPointer/GetDelForFcnPtr_Negative_Catchable.cs index c9d96ee623..9fddac1785 100644 --- a/tests/src/Interop/MarshalAPI/FunctionPointer/GetDelForFcnPtr_Negative_Catchable.cs +++ b/tests/src/Interop/MarshalAPI/FunctionPointer/GetDelForFcnPtr_Negative_Catchable.cs @@ -6,6 +6,7 @@ using System.Security; using System.Threading; using System.Globalization; using System.Runtime.InteropServices; +#pragma warning disable 618 public partial class FunctionPtr { @@ -88,3 +89,4 @@ public partial class FunctionPtr Console.WriteLine("Simple method to get a delegate for"); } } +#pragma warning restore 618
\ No newline at end of file diff --git a/tests/src/Interop/MarshalAPI/FunctionPointer/GetFcnPtrForDel_Negative_Catchable.cs b/tests/src/Interop/MarshalAPI/FunctionPointer/GetFcnPtrForDel_Negative_Catchable.cs index b33ea4c70c..e4b5c2dbff 100644 --- a/tests/src/Interop/MarshalAPI/FunctionPointer/GetFcnPtrForDel_Negative_Catchable.cs +++ b/tests/src/Interop/MarshalAPI/FunctionPointer/GetFcnPtrForDel_Negative_Catchable.cs @@ -6,7 +6,7 @@ using System.Security; using System.Threading; using System.Globalization; using System.Runtime.InteropServices; - +#pragma warning disable 618 public partial class FunctionPtr { delegate void VoidDelegate(); @@ -39,4 +39,5 @@ public partial class FunctionPtr return retVal; } -}
\ No newline at end of file +} +#pragma warning restore 618
\ No newline at end of file diff --git a/tests/src/Interop/MarshalAPI/FunctionPointer/GetFcnPtrForDel_Negative_Security.cs b/tests/src/Interop/MarshalAPI/FunctionPointer/GetFcnPtrForDel_Negative_Security.cs index 271b71ca63..3724404d59 100644 --- a/tests/src/Interop/MarshalAPI/FunctionPointer/GetFcnPtrForDel_Negative_Security.cs +++ b/tests/src/Interop/MarshalAPI/FunctionPointer/GetFcnPtrForDel_Negative_Security.cs @@ -4,6 +4,7 @@ using System; using System.Security; using System.Runtime.InteropServices; +#pragma warning disable 618 partial class FunctionPtr { @@ -82,4 +83,5 @@ partial class FunctionPtr if (l != 999999999999) throw new Exception("Failed multicast call"); } -}
\ No newline at end of file +} +#pragma warning restore 618
\ No newline at end of file diff --git a/tests/src/Interop/MarshalAPI/GetObjectForNativeVariant/GetObjectForNativeVariant.cs b/tests/src/Interop/MarshalAPI/GetObjectForNativeVariant/GetObjectForNativeVariant.cs index 5880a74518..ab42a25c28 100644 --- a/tests/src/Interop/MarshalAPI/GetObjectForNativeVariant/GetObjectForNativeVariant.cs +++ b/tests/src/Interop/MarshalAPI/GetObjectForNativeVariant/GetObjectForNativeVariant.cs @@ -3,6 +3,7 @@ using System.IO; using System.Reflection; using System.Runtime.InteropServices; using CoreFXTestLibrary; +#pragma warning disable 618 public class GetObjectForNativeVariantTest { @@ -116,3 +117,4 @@ public class GetObjectForNativeVariantTest return 100; } } +#pragma warning restore 618
\ No newline at end of file diff --git a/tests/src/Interop/MarshalAPI/GetObjectsForNativeVariants/GetObjectsForNativeVariants.cs b/tests/src/Interop/MarshalAPI/GetObjectsForNativeVariants/GetObjectsForNativeVariants.cs index 36ab12283b..6a55638d92 100644 --- a/tests/src/Interop/MarshalAPI/GetObjectsForNativeVariants/GetObjectsForNativeVariants.cs +++ b/tests/src/Interop/MarshalAPI/GetObjectsForNativeVariants/GetObjectsForNativeVariants.cs @@ -3,7 +3,7 @@ using System.IO; using System.Reflection; using System.Runtime.InteropServices; using CoreFXTestLibrary; - +#pragma warning disable 618 public class GetObjectsForNativeVariantsTest { [StructLayout(LayoutKind.Sequential)] @@ -83,3 +83,4 @@ public class GetObjectsForNativeVariantsTest return 100; } } +#pragma warning restore 618
\ No newline at end of file diff --git a/tests/src/Interop/MarshalAPI/IUnknown/IUnknownTest.cs b/tests/src/Interop/MarshalAPI/IUnknown/IUnknownTest.cs index 83ffad3e52..5b5d8459b7 100644 --- a/tests/src/Interop/MarshalAPI/IUnknown/IUnknownTest.cs +++ b/tests/src/Interop/MarshalAPI/IUnknown/IUnknownTest.cs @@ -9,6 +9,8 @@ using System.Runtime.InteropServices; using System.Collections.Generic; using CoreFXTestLibrary; +#pragma warning disable 618 + public class TestClass { public int value; @@ -67,8 +69,9 @@ public class IUnknownMarshalingTest public void GetComInterfaceForObjectTest() { - //test null - IntPtr nullPtr = Marshal.GetComInterfaceForObject(null, typeof(object)); + + //test null + IntPtr nullPtr = Marshal.GetComInterfaceForObject(null, typeof(object)); if (nullPtr != IntPtr.Zero) throw new Exception("A valid ptr was returned for null object."); @@ -220,3 +223,4 @@ public class IUnknownMarshalingTest } } +#pragma warning restore 618 diff --git a/tests/src/Interop/RefCharArray/RefCharArrayNative.cpp b/tests/src/Interop/RefCharArray/RefCharArrayNative.cpp index 1cc4190b1a..09f4671858 100755 --- a/tests/src/Interop/RefCharArray/RefCharArrayNative.cpp +++ b/tests/src/Interop/RefCharArray/RefCharArrayNative.cpp @@ -6,7 +6,7 @@ #include <stdio.h> #include <stdlib.h> -int LEN = 10; +size_t LEN = 10; extern "C" BOOL DLL_EXPORT _cdecl MarshalRefCharArray_Cdecl(char ** pstr) { //Check the Input diff --git a/tests/src/Interop/SimpleStruct/SimpleStructManaged.cs b/tests/src/Interop/SimpleStruct/SimpleStructManaged.cs index c815015a39..185eec7e7b 100644 --- a/tests/src/Interop/SimpleStruct/SimpleStructManaged.cs +++ b/tests/src/Interop/SimpleStruct/SimpleStructManaged.cs @@ -180,7 +180,7 @@ namespace PInvokeTests public static Sstr_simple DoCdeclSimpleStruct(Sstr_simple p, ref bool retval) { IntPtr st = CdeclSimpleStruct(p, ref retval); - Sstr_simple simple = (Sstr_simple)Marshal.PtrToStructure(st, typeof(Sstr_simple)); + Sstr_simple simple = Marshal.PtrToStructure<Sstr_simple>(st); return simple; } @@ -189,7 +189,7 @@ namespace PInvokeTests public static ExplStruct DoCdeclSimpleExplStruct(ExplStruct p, ref bool retval) { IntPtr st = CdeclSimpleExplStruct(p, ref retval); - ExplStruct simple = (ExplStruct)Marshal.PtrToStructure(st, typeof(ExplStruct)); + ExplStruct simple = Marshal.PtrToStructure<ExplStruct>(st); return simple; } @@ -306,7 +306,7 @@ namespace PInvokeTests CdeclSimpleStructDelegate std = GetFptrCdeclSimpleStruct(16); IntPtr st = std(simple, ref retval); - simple = (Sstr_simple)Marshal.PtrToStructure(st, typeof(Sstr_simple)); + simple = Marshal.PtrToStructure<Sstr_simple>(st); if (retval == false) @@ -444,7 +444,7 @@ namespace PInvokeTests CdeclSimpleExplStructDelegate std = GetFptrCdeclSimpleExplStruct(20); IntPtr st = std(p, ref retval); - p = (ExplStruct)Marshal.PtrToStructure(st, typeof(ExplStruct)); + p = Marshal.PtrToStructure<ExplStruct>(st); if (retval == false) { @@ -476,7 +476,9 @@ namespace PInvokeTests retVal = retVal && PosTest1(); retVal = retVal && PosTest2(); retVal = retVal && PosTest3(); - retVal = retVal && PosTest4(); + + // https://github.com/dotnet/coreclr/issues/4193 + // retVal = retVal && PosTest4(); if (!retVal) Console.WriteLine("FAIL"); diff --git a/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTest.cs b/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTest.cs Binary files differindex ce9302d1c4..f704791cfd 100755 --- a/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTest.cs +++ b/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTest.cs diff --git a/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTestNative.cpp b/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTestNative.cpp index ac43d40aa6..3f72126acc 100755 --- a/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTestNative.cpp +++ b/tests/src/Interop/StringMarshalling/LPSTR/LPSTRTestNative.cpp @@ -80,10 +80,10 @@ extern "C" DLL_EXPORT LPSTR MarshalPointer_InOut(/*[in,out]*/LPSTR *s) { printf("Error in Function MarshalPointer_InOut\n"); - for(int i = 0; i< lenstrManaged;++i) + for(size_t i = 0; i< lenstrManaged;++i) putchar(*(((char *)strManaged)+i)); - for( int j = 0; j < len; ++j) + for( size_t j = 0; j < len; ++j) putchar(*(((char *)*s) + j)); return ReturnErrorString(); @@ -111,7 +111,7 @@ extern "C" DLL_EXPORT LPSTR MarshalPointer_Out(/*[out]*/ LPSTR *s) extern "C" DLL_EXPORT int __cdecl Writeline(char * pFormat, int i, char c, double d, short s, unsigned u) { int sum = i; - for (size_t i = 0; i < strlen(pFormat); i++) + for (size_t it = 0; it < strlen(pFormat); it++) { sum += (int)(*pFormat); } @@ -127,7 +127,7 @@ typedef LPCTSTR (__stdcall * Test_DelMarshal_InOut)(/*[in]*/ LPCSTR s); extern "C" DLL_EXPORT BOOL __cdecl RPinvoke_DelMarshal_InOut(Test_DelMarshal_InOut d, /*[in]*/ LPCSTR s) { LPCTSTR str = d(s); - LPTSTR ret = (LPTSTR)W("Return"); + const char *ret = "Return"; size_t lenstr = _tcslen(str); size_t lenret = _tcslen(ret); diff --git a/tests/testsFailingOutsideWindows.txt b/tests/testsFailingOutsideWindows.txt index f7b8b91575..f81295b1e6 100644 --- a/tests/testsFailingOutsideWindows.txt +++ b/tests/testsFailingOutsideWindows.txt @@ -168,7 +168,6 @@ JIT/Methodical/Boxing/xlang/_orelsin_cs_il/_orelsin_cs_il.sh JIT/Methodical/Boxing/xlang/_relsin_cs_il/_relsin_cs_il.sh JIT/Methodical/localloc/call/call01_small/call01_small.sh JIT/Regression/Dev11/External/dev11_145295/CSharpPart/CSharpPart.sh -Interop/SimpleStruct/SimpleStruct/SimpleStruct.sh Interop/StructMarshalling/PInvoke/MarshalStructAsLayoutExp/MarshalStructAsLayoutExp.sh Interop/StructMarshalling/PInvoke/MarshalStructAsLayoutSeq/MarshalStructAsLayoutSeq.sh Interop/ArrayMarshalling/ByValArray/MarshalArrayByValTest/MarshalArrayByValTest.sh |