dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.36k stars 4.74k forks source link

CoreCLR tests on Mono runtime : Failures in Interop/PInvoke* tests #35225

Open SamMonoRT opened 4 years ago

SamMonoRT commented 4 years ago

Several failures seen when running the Interop/PInvoke* tests. These are CoreCLR tests run on the mono runtime from the dotnet\runtime repo.

Repro : Command to run individual tests :

cd src/mono/netcore
make run-tests-coreclr CoreClrTest="bash ../../artifacts/tests/coreclr/OSX.x64.Debug/Regressions/coreclr/Interop/PInvoke/AsAny/AsAnyTest/AsAnyTest.sh"
  1. Interop/PInvoke/AsAny/AsAnyTest/AsAnyTest.sh
  2. Interop/PInvoke/CriticalHandles/Test/Test/Test.sh
  3. Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest/PassingByRefTest.sh
  4. Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest/AsDefaultTest.sh
  5. Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest/AsLPArrayTest.sh
  6. Interop/PInvoke/CriticalHandles/StructTest/StructTest/StructTest.sh
  7. Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest/PassingByOutTest.sh
  8. Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest/AsByValArrayTest.sh
  9. Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex/InvalidParamIndex.sh
  10. Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest/PassingByOutTest.sh
  11. Interop/PInvoke/DateTime/DateTimeTest/DateTimeTest.sh
  12. Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest/ArrayTest.sh
  13. Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest/AsLPArrayTest.sh

*** Interop/PInvoke/AsAny/AsAnyTest/AsAnyTest.sh [FAIL]

      Return code:      1
      Raw output file:      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Reports/Interop.PInvoke/AsAny/AsAnyTest/AsAnyTest.output.txt
      Raw output:
      BEGIN EXECUTION
      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/corerun AsAnyTest.dll ''
      Scenario : Checking Marshal AsAny for sbyte array 
      System.ArgumentException: No PInvoke conversion exists for value passed to Object-typed parameter.
         at AsAnyTests.TestSByteArray() in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/AsAny/AsAnyTest.cs:line 629
         at AsAnyTests.Main() in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/AsAny/AsAnyTest.cs:line 303
      Expected: 100
      Actual: 101
      END EXECUTION - FAILED
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=/Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root
      > /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/AsAny/AsAnyTest/AsAnyTest.sh
      Expected: True
      Actual:   False
      Stack Trace:
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/TestWrappers/Interop.PInvoke/Interop.PInvoke.XUnitWrapper.cs(625,0): at Interop_PInvoke._AsAny_AsAnyTest_AsAnyTest_._AsAny_AsAnyTest_AsAnyTest_sh()
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs(339,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

*** Interop/PInvoke/CriticalHandles/Test/Test/Test.sh [FAIL]

      Return code:      1
      Raw output file:      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Reports/Interop.PInvoke/CriticalHandles/Test/Test/Test.output.txt
      Raw output:
      BEGIN EXECUTION
      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/corerun Test.dll ''
      Test Failure: System.Runtime.InteropServices.MarshalDirectiveException: Type System.Runtime.InteropServices.CriticalHandle which is passed to unmanaged code must have a StructLayout attribute.
         at CriticalHandleTest.InWorker(IntPtr handleValue) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/CriticalHandles/Test/Test.cs:line 117
         at CriticalHandleTest.In() in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/CriticalHandles/Test/Test.cs:line 106
         at Test.Main(String[] args) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/CriticalHandles/Test/Test.cs:line 366
      Expected: 100
      Actual: 101
      END EXECUTION - FAILED
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=/Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root
      > /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/CriticalHandles/Test/Test/Test.sh
      Expected: True
      Actual:   False
      Stack Trace:
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/TestWrappers/Interop.PInvoke/Interop.PInvoke.XUnitWrapper.cs(1110,0): at Interop_PInvoke._CriticalHandles_Test_Test_Test_._CriticalHandles_Test_Test_Test_sh()
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs(339,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

*** Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest/PassingByRefTest.sh [FAIL]

      Return code:      1
      Raw output file:      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Reports/Interop.PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest/PassingByRefTest.output.txt
      Raw output:
      BEGIN EXECUTION
      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/corerun PassingByRefTest.dll ''
      ReversePInvoke C-Style Array marshaled by ref with SizeParamIndex attribute(by ref Array size).
      Scenario 1 : byte ==> BYTE, Array_Size = byte.MinValue, Return_Array_Size = 20
      Test Failure: System.Runtime.InteropServices.MarshalDirectiveException: Byref array marshalling to managed code is not implemented.
         at ReversePInvoke_MashalArrayByRef_AsManagedTest.RunTestByRef() in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs:line 163
         at ReversePInvoke_MashalArrayByRef_AsManagedTest.Main() in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs:line 214
      Expected: 100
      Actual: 101
      END EXECUTION - FAILED
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=/Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root
      > /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest/PassingByRefTest.sh
      Expected: True
      Actual:   False
      Stack Trace:
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/TestWrappers/Interop.PInvoke/Interop.PInvoke.XUnitWrapper.cs(2662,0): at Interop_PInvoke._SizeParamIndex_ReversePInvoke_PassingByRef_PassingByRefTest_PassingByRefTest_._SizeParamIndex_ReversePInvoke_PassingByRef_PassingByRefTest_PassingByRefTest_sh()
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs(339,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

*** Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest/AsDefaultTest.sh [FAIL]

      Return code:      1
      Raw output file:      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Reports/Interop.PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest/AsDefaultTest.output.txt
      Raw output:
      BEGIN EXECUTION
      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/corerun AsDefaultTest.dll ''
      ByVal marshaling CLR array as c-style-array no attributes
      ByVal marshaling  CLR array as c-style-array with InAttribute applied
      By value marshaling CLR array as c-style-array with InAttribute and OutAttribute applied
      CStyle_Array_Int_InOut
      CStyle_Array_Int_InOut_Null
      CStyle_Array_Int_InOut_ZeroLength
      CStyle_Array_Uint_InOut
      CStyle_Array_Short_InOut
      CStyle_Array_Word_InOut
      CStyle_Array_Long64_InOut
      CStyle_Array_ULong64_InOut
      CStyle_Array_Double_InOut
      CStyle_Array_Float_InOut
      CStyle_Array_Byte_InOut
      CStyle_Array_Char_InOut
      CStyle_Array_LPSTR_InOut

EXEC : Array marshaling error : Index: 0 : Actual:0, Expected:99, [/Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/runtest.proj] [/Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/mono.proj]

      TEST FAIL: TestLibrary.AssertTestException: Assert.IsTrue: CStyle_Array_LPSTR_InOut:Equals<string>
         at TestLibrary.Assert.HandleFail(String assertionName, String message) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Assertion.cs:line 735
         at TestLibrary.Assert.IsTrue(Boolean condition, String message) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Assertion.cs:line 302
         at ArrayMarshal.TestMarshalInOut_ByVal() in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs:line 453
         at ArrayMarshal.Main() in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs:line 662
      ============ [CStyle_Array_Int] ============
      ============ [CStyle_Array_Uint] ============
      ============ [CStyle_Array_Short] ============
      ============ [CStyle_Array_Word] ============
      ============ [CStyle_Array_Long64] ============
      ============ [CStyle_Array_ULong64] ============
      ============ [CStyle_Array_Double] ============
      ============ [CStyle_Array_Float] ============
      ============ [CStyle_Array_Byte] ============
      ============ [CStyle_Array_Char] ============
      ============ [CStyle_Array_LPCSTR] ============
      ============ [CStyle_Array_LPSTR] ============
      ============ [CStyle_Array_LPCSTR] ============
      ============ [CStyle_Array_Struct] ============
      ============ [CStyle_Array_Bool] ============
      ============ [CStyle_Array_Int] ============
      ============ [CStyle_Array_Uint] ============
      ============ [CStyle_Array_Short] ============
      ============ [CStyle_Array_Word] ============
      ============ [CStyle_Array_Long64] ============
      ============ [CStyle_Array_ULong64] ============
      ============ [CStyle_Array_Double] ============
      ============ [CStyle_Array_Float] ============
      ============ [CStyle_Array_Byte] ============
      ============ [CStyle_Array_Char] ============
      ============ [CStyle_Array_LPCSTR] ============
      ============ [CStyle_Array_LPSTR] ============
      ============ [CStyle_Array_LPCSTR] ============
      ============ [CStyle_Array_Struct] ============
      ============ [CStyle_Array_Bool] ============
      ============ [CStyle_Array_Int_InOut] ============
      ============ [CStyle_Array_Int] ============
      ============ [CStyle_Array_Int_InOut_Null] ============
      ============ [CStyle_Array_Int_InOut_ZeroLength] ============
      ============ [CStyle_Array_Uint_InOut] ============
      ============ [CStyle_Array_Uint] ============
      ============ [CStyle_Array_Short_InOut] ============
      ============ [CStyle_Array_Short] ============
      ============ [CStyle_Array_Word_InOut] ============
      ============ [CStyle_Array_Word] ============
      ============ [CStyle_Array_Long64_InOut] ============
      ============ [CStyle_Array_Long64] ============
      ============ [CStyle_Array_ULong64_InOut] ============
      ============ [CStyle_Array_ULong64] ============
      ============ [CStyle_Array_Double_InOut] ============
      ============ [CStyle_Array_Double] ============
      ============ [CStyle_Array_Float_InOut] ============
      ============ [CStyle_Array_Float] ============
      ============ [CStyle_Array_Byte_InOut] ============
      ============ [CStyle_Array_Byte] ============
      ============ [CStyle_Array_Char_InOut] ============
      ============ [CStyle_Array_Char] ============
      ============ [CStyle_Array_LPSTR_InOut] ============
      ============ [CStyle_Array_LPSTR] ============
      ============ [CStyle_Array_LPCSTR] ============
      Expected: 100
      Actual: 101
      END EXECUTION - FAILED
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=/Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root
      > /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest/AsDefaultTest.sh
      Expected: True
      Actual:   False
      Stack Trace:
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/TestWrappers/Interop.PInvoke/Interop.PInvoke.XUnitWrapper.cs(334,0): at Interop_PInvoke._Array_MaralArrayAsParam_AsDefault_AsDefaultTest_AsDefaultTest_._Array_MarshalArrayAsParam_AsDefault_AsDefaultTest_AsDefaultTest_sh()
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs(339,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

*** Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest/AsLPArrayTest.sh [FAIL]

      Return code:      1
      Raw output file:      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Reports/Interop.PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest/AsLPArrayTest.output.txt
      Raw output:
      BEGIN EXECUTION
      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/corerun AsLPArrayTest.dll ''
      RunTest 1 : Marshal Array In Sequential Struct As LPArray. 

      Test FAIL: TestLibrary.AssertTestException: Assert.Fail: Expected 'System.TypeLoadException' to be thrown. TakeIntArraySeqStructByVal
         at TestLibrary.Assert.HandleFail(String assertionName, String message) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Assertion.cs:line 735
         at TestLibrary.Assert.Fail(String message, Object[] args) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Assertion.cs:line 722
         at TestLibrary.Assert.Throws[TypeLoadException](Action action, String message, AssertThrowsOptions options) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Assertion.cs:line 188
         at Test.RunTest1(String report) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs:line 176
         at Test.Main(String[] args) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs:line 429
      ============ [TakeIntArraySeqStructByVal] ============

EXEC : warning : Test error - BOOL Equals(T , int, T , int) [T = int] [/Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/runtest.proj] [/Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/mono.proj] Array Length: expected: 100, actual: 117468592 Expected: 100 Actual: 101 END EXECUTION - FAILED Test Harness Exitcode is : 1 To run the test:

set CORE_ROOT=/Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest/AsLPArrayTest.sh Expected: True Actual: False Stack Trace: /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/TestWrappers/Interop.PInvoke/Interop.PInvoke.XUnitWrapper.cs(237,0): at Interop_PInvoke._Array_MaralArrayAsField_AsLPArray_AsLPArrayTestAsLPArrayTest._Array_MarshalArrayAsField_AsLPArray_AsLPArrayTest_AsLPArrayTest_sh() /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs(339,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

*** Interop/PInvoke/CriticalHandles/StructTest/StructTest/StructTest.sh [FAIL]

      Return code:      1
      Raw output file:      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Reports/Interop.PInvoke/CriticalHandles/StructTest/StructTest/StructTest.output.txt
      Raw output:
      BEGIN EXECUTION
      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/corerun StructTest.dll ''
      Test Failure: System.Runtime.InteropServices.MarshalDirectiveException: Type System.Runtime.InteropServices.CriticalHandle which is passed to unmanaged code must have a StructLayout attribute.
         at CriticalHandleStructTest.InWorker(IntPtr handleValue) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/CriticalHandles/StructTest/StructTest.cs:line 83
         at CriticalHandleStructTest.In() in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/CriticalHandles/StructTest/StructTest.cs:line 72
         at CriticalHandleStructTest.Main(String[] args) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/CriticalHandles/StructTest/StructTest.cs:line 186
      Expected: 100
      Actual: 101
      END EXECUTION - FAILED
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=/Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root
      > /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/CriticalHandles/StructTest/StructTest/StructTest.sh
      Expected: True
      Actual:   False
      Stack Trace:
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/TestWrappers/Interop.PInvoke/Interop.PInvoke.XUnitWrapper.cs(1013,0): at Interop_PInvoke._CriticalHandles_StructTest_StructTest_StructTest_._CriticalHandles_StructTest_StructTest_StructTest_sh()
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs(339,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

*** Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest/PassingByOutTest.sh [FAIL]

      Return code:      1
      Raw output file:      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Reports/Interop.PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest/PassingByOutTest.output.txt
      Raw output:
      BEGIN EXECUTION
      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/corerun PassingByOutTest.dll ''
      ReversePInvoke C-Style Array marshaled by out with SizeParamIndex attribute(by out Array size).
      Scenario 1 : byte ==> BYTE, Array_Size = byte.MinValue, Return_Array_Size = 20
      Test Failure: System.Runtime.InteropServices.MarshalDirectiveException: Byref array marshalling to managed code is not implemented.
         at ReversePInvoke_MashalArrayByOut_AsManagedTest.RunTestByOut() in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs:line 153
         at ReversePInvoke_MashalArrayByOut_AsManagedTest.Main() in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs:line 199
      Expected: 100
      Actual: 101
      END EXECUTION - FAILED
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=/Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root
      > /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest/PassingByOutTest.sh
      Expected: True
      Actual:   False
      Stack Trace:
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/TestWrappers/Interop.PInvoke/Interop.PInvoke.XUnitWrapper.cs(2565,0): at Interop_PInvoke._SizeParamIndex_ReversePInvoke_PassingByOut_PassingByOutTest_PassingByOutTest_._SizeParamIndex_ReversePInvoke_PassingByOut_PassingByOutTest_PassingByOutTest_sh()
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs(339,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

*** Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest/AsByValArrayTest.sh [FAIL]

      Return code:      1
      Raw output file:      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Reports/Interop.PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest/AsByValArrayTest.output.txt
      Raw output:
      BEGIN EXECUTION
      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/corerun AsByValArrayTest.dll ''
      RunTest1 : Marshal array as field as ByValArray in sequential struct as parameter.

      TEST FAIL: Assert.IsTrue: TakeCharArraySeqStructByVal
      ============ [TakeIntArraySeqStructByVal] ============
      ============ [TakeUIntArraySeqStructByVal] ============
      ============ [TakeShortArraySeqStructByVal] ============
      ============ [TakeWordArraySeqStructByVal] ============
      ============ [TakeLong64ArraySeqStructByVal] ============
      ============ [TakeULong64ArraySeqStructByVal] ============
      ============ [TakeDoubleArraySeqStructByVal] ============
      ============ [TakeFloatArraySeqStructByVal] ============
      ============ [TakeByteArraySeqStructByVal] ============
      ============ [TakeCharArraySeqStructByVal] ============

EXEC : warning : Test error - BOOL Equals(T , int, T , int) [T = char] [/Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/runtest.proj] [/Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/mono.proj] Array Element Not Equal: index: 1Expected: 100 Actual: 101 END EXECUTION - FAILED Test Harness Exitcode is : 1 To run the test:

set CORE_ROOT=/Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest/AsByValArrayTest.sh Expected: True Actual: False Stack Trace: /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/TestWrappers/Interop.PInvoke/Interop.PInvoke.XUnitWrapper.cs(140,0): at Interop_PInvoke._Array_MaralArrayAsField_AsByValArray_AsByValArrayTestAsByValArrayTest._Array_MarshalArrayAsField_AsByValArray_AsByValArrayTest_AsByValArrayTest_sh() /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs(339,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

*** Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex/InvalidParamIndex.sh [FAIL]

      Unhandled Exception:
      TestLibrary.AssertTestException: Assert.Fail: Expected 'System.Runtime.InteropServices.MarshalDirectiveException' to be thrown, however 'System.DllNotFoundException' was thrown. 
         at TestLibrary.Assert.HandleFail(String assertionName, String message) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Assertion.cs:line 735
         at TestLibrary.Assert.Fail(String message, Object[] args) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Assertion.cs:line 722
         at TestLibrary.Assert.Throws[MarshalDirectiveException](Action action, String message, AssertThrowsOptions options) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Assertion.cs:line 191
         at Program.Main() in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.cs:line 21
      [ERROR] FATAL UNHANDLED EXCEPTION: TestLibrary.AssertTestException: Assert.Fail: Expected 'System.Runtime.InteropServices.MarshalDirectiveException' to be thrown, however 'System.DllNotFoundException' was thrown. 
         at TestLibrary.Assert.HandleFail(String assertionName, String message) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Assertion.cs:line 735
         at TestLibrary.Assert.Fail(String message, Object[] args) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Assertion.cs:line 722
         at TestLibrary.Assert.Throws[MarshalDirectiveException](Action action, String message, AssertThrowsOptions options) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Assertion.cs:line 191
         at Program.Main() in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.cs:line 21

      Return code:      1
      Raw output file:      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Reports/Interop.PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex/InvalidParamIndex.output.txt
      Raw output:
      BEGIN EXECUTION
      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/corerun InvalidParamIndex.dll ''
      Expected: 100
      Actual: 1
      END EXECUTION - FAILED
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=/Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root
      > /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex/InvalidParamIndex.sh
      Expected: True
      Actual:   False
      Stack Trace:
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/TestWrappers/Interop.PInvoke/Interop.PInvoke.XUnitWrapper.cs(2274,0): at Interop_PInvoke._SizeParamIndex_PInvoke_Invalid_InvalidParamIndex_InvalidParamIndex_._SizeParamIndex_PInvoke_Invalid_InvalidParamIndex_InvalidParamIndex_sh()
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs(339,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

*** Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest/PassingByOutTest.sh [FAIL]

      Return code:      1
      Raw output file:      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Reports/Interop.PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest/PassingByOutTest.output.txt
      Raw output:
      BEGIN EXECUTION
      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/corerun PassingByOutTest.dll ''

      Scenario(byte ==> BYTE): Array_Size(N->M) = 1 Starts!
      Test Failure: System.Runtime.InteropServices.MarshalDirectiveException: Not implemented.
         at ClientMarshalArrayAsSizeParamIndexByOutTest.SizeParamTypeIsByte() in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs:line 67
         at ClientMarshalArrayAsSizeParamIndexByOutTest.Main() in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs:line 236
      Expected: 100
      Actual: 101
      END EXECUTION - FAILED
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=/Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root
      > /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest/PassingByOutTest.sh
      Expected: True
      Actual:   False
      Stack Trace:
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/TestWrappers/Interop.PInvoke/Interop.PInvoke.XUnitWrapper.cs(2371,0): at Interop_PInvoke._SizeParamIndex_PInvoke_PassingByOut_PassingByOutTest_PassingByOutTest_._SizeParamIndex_PInvoke_PassingByOut_PassingByOutTest_PassingByOutTest_sh()
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs(339,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

*** Interop/PInvoke/Delegate/DelegateTest/DelegateTest.sh [FAIL]

      Return code:      1
      Raw output file:      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Reports/Interop.PInvoke/Delegate/DelegateTest/DelegateTest.output.txt
      Raw output:
      BEGIN EXECUTION
      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/corerun DelegateTest.dll ''
      Test Failure: System.Runtime.InteropServices.MarshalDirectiveException: Byref marshalling of delegates is not implemented.
         at DelegateTest.TestFunctionPointer() in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/Delegate/DelegateTest.cs:line 23
         at DelegateTest.Main(String[] args) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/Delegate/DelegateTest.cs:line 127
      Expected: 100
      Actual: 101
      END EXECUTION - FAILED
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=/Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root
      > /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Delegate/DelegateTest/DelegateTest.sh
      Expected: True
      Actual:   False
      Stack Trace:
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/TestWrappers/Interop.PInvoke/Interop.PInvoke.XUnitWrapper.cs(1401,0): at Interop_PInvoke._Delegate_DelegateTest_DelegateTest_._Delegate_DelegateTest_DelegateTest_sh()
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs(339,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

*** Interop/PInvoke/DateTime/DateTimeTest/DateTimeTest.sh [FAIL] Raw output file: /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Reports/Interop.PInvoke/DateTime/DateTimeTest/DateTimeTest.output.txt Raw output: BEGIN EXECUTION /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/corerun DateTimeTest.dll '' Test Failure: System.Runtime.InteropServices.MarshalDirectiveException: Type System.DateTime which is passed to unmanaged code must have a StructLayout attribute. at DateTimeTest.Main(String[] args) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/DateTime/DateTimeTest.cs:line 35 Expected: 100 Actual: 101 END EXECUTION - FAILED Test Harness Exitcode is : 1 To run the test:

set CORE_ROOT=/Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/DateTime/DateTimeTest/DateTimeTest.sh Expected: True Actual: False Stack Trace: /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/TestWrappers/Interop.PInvoke/Interop.PInvoke.XUnitWrapper.cs(1207,0): at Interop_PInvoke._DateTime_DateTimeTestDateTimeTest._DateTime_DateTimeTest_DateTimeTest_sh() /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs(339,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

*** Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest/ArrayTest.sh [FAIL]

      Return code:      1
      Raw output file:      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Reports/Interop.PInvoke/CriticalHandles/ArrayTest/ArrayTest/ArrayTest.output.txt
      Raw output:
      BEGIN EXECUTION
      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/corerun ArrayTest.dll ''
      Test Failure: TestLibrary.AssertTestException: Assert.Fail: Expected 'System.Runtime.InteropServices.MarshalDirectiveException' to be thrown. 
         at TestLibrary.Assert.HandleFail(String assertionName, String message) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Assertion.cs:line 735
         at TestLibrary.Assert.Fail(String message, Object[] args) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Assertion.cs:line 722
         at TestLibrary.Assert.Throws[MarshalDirectiveException](Action action, String message, AssertThrowsOptions options) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Assertion.cs:line 188
         at CriticalHandleArrayTest.Ret() in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest.cs:line 106
         at CriticalHandleArrayTest.Main(String[] args) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest.cs:line 143
      Expected: 100
      Actual: 101
      END EXECUTION - FAILED
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=/Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root
      > /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest/ArrayTest.sh
      Expected: True
      Actual:   False
      Stack Trace:
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/TestWrappers/Interop.PInvoke/Interop.PInvoke.XUnitWrapper.cs(819,0): at Interop_PInvoke._CriticalHandles_ArrayTest_ArrayTest_ArrayTest_._CriticalHandles_ArrayTest_ArrayTest_ArrayTest_sh()
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs(339,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

*** Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest/AsLPArrayTest.sh [FAIL]

      Return code:      1
      Raw output file:      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Reports/Interop.PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest/AsLPArrayTest.output.txt
      Raw output:
      BEGIN EXECUTION
      /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root/corerun AsLPArrayTest.dll ''
      ByVal marshaling CLR array as c-style-array no attributes
      ByVal marshaling  CLR array as c-style-array with InAttribute applied
      By value marshaling CLR array as c-style-array with InAttribute and OutAttribute applied
      Array marshaling error, Index: 0 , Expected:99, Actual:0

      TEST FAIL: TestLibrary.AssertTestException: Assert.IsTrue: CStyle_Array_LPSTR_InOut:Equals<string>
         at TestLibrary.Assert.HandleFail(String assertionName, String message) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Assertion.cs:line 735
         at TestLibrary.Assert.IsTrue(Boolean condition, String message) in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Common/CoreCLRTestLibrary/Assertion.cs:line 302
         at ArrayMarshal.TestMarshalByVal_InOut() in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs:line 422
         at ArrayMarshal.Main() in /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/coreclr/tests/src/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs:line 638
      ============ [CStyle_Array_Int] ============
      ============ [CStyle_Array_Uint] ============
      ============ [CStyle_Array_Short] ============
      ============ [CStyle_Array_Word] ============
      ============ [CStyle_Array_Long64] ============
      ============ [CStyle_Array_ULong64] ============
      ============ [CStyle_Array_Double] ============
      ============ [CStyle_Array_Float] ============
      ============ [CStyle_Array_Byte] ============
      ============ [CStyle_Array_Char] ============
      ============ [CStyle_Array_LPCSTR] ============
      ============ [CStyle_Array_LPSTR] ============
      ============ [CStyle_Array_LPCSTR] ============
      ============ [CStyle_Array_Struct] ============
      ============ [CStyle_Array_Bool] ============
      ============ [CStyle_Array_Int] ============
      ============ [CStyle_Array_Uint] ============
      ============ [CStyle_Array_Short] ============
      ============ [CStyle_Array_Word] ============
      ============ [CStyle_Array_Long64] ============
      ============ [CStyle_Array_ULong64] ============
      ============ [CStyle_Array_Double] ============
      ============ [CStyle_Array_Float] ============
      ============ [CStyle_Array_Byte] ============
      ============ [CStyle_Array_Char] ============
      ============ [CStyle_Array_LPCSTR] ============
      ============ [CStyle_Array_LPSTR] ============
      ============ [CStyle_Array_LPCSTR] ============
      ============ [CStyle_Array_Struct] ============
      ============ [CStyle_Array_Bool] ============
      ============ [CStyle_Array_Int_InOut] ============
      ============ [CStyle_Array_Int] ============
      ============ [CStyle_Array_Int_InOut_Null] ============
      ============ [CStyle_Array_Int_InOut_ZeroLength] ============
      ============ [CStyle_Array_Uint_InOut] ============
      ============ [CStyle_Array_Uint] ============
      ============ [CStyle_Array_Short_InOut] ============
      ============ [CStyle_Array_Short] ============
      ============ [CStyle_Array_Word_InOut] ============
      ============ [CStyle_Array_Word] ============
      ============ [CStyle_Array_Long64_InOut] ============
      ============ [CStyle_Array_Long64] ============
      ============ [CStyle_Array_ULong64_InOut] ============
      ============ [CStyle_Array_ULong64] ============
      ============ [CStyle_Array_Double_InOut] ============
      ============ [CStyle_Array_Double] ============
      ============ [CStyle_Array_Float_InOut] ============
      ============ [CStyle_Array_Float] ============
      ============ [CStyle_Array_Byte_InOut] ============
      ============ [CStyle_Array_Byte] ============
      ============ [CStyle_Array_Char_InOut] ============
      ============ [CStyle_Array_Char] ============
      ============ [CStyle_Array_LPSTR_InOut] ============
      ============ [CStyle_Array_LPSTR] ============
      ============ [CStyle_Array_LPCSTR] ============
      Expected: 100
      Actual: 101
      END EXECUTION - FAILED
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=/Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root
      > /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest/AsLPArrayTest.sh
      Expected: True
      Actual:   False
      Stack Trace:
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/artifacts/tests/coreclr/OSX.x64.Debug/TestWrappers/Interop.PInvoke/Interop.PInvoke.XUnitWrapper.cs(431,0): at Interop_PInvoke._Array_MaralArrayAsParam_AsLPArray_AsLPArrayTest_AsLPArrayTest_._Array_MarshalArrayAsParam_AsLPArray_AsLPArrayTest_AsLPArrayTest_sh()
        /Users/samarthpatel/Documents/DotNetRunTime/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs(339,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
alexischr commented 4 years ago

For the AsAnyTest.sh failures, what's needed is implementation of array marshalling mono_marshal_asany_impl, Mono's JIT icall used for marshalling under the AsAny scheme. https://github.com/mono/mono/pull/19683 fixes about half of these cases, so the program fails later:

  Scenario : Checking Marshal AsAny for sbyte array
  Scenario : Checking Marshal AsAny for byte array
  Scenario : Checking Marshal AsAny for short array
  Scenario : Checking Marshal AsAny for ushort array
  Scenario : Checking Marshal AsAny for Int array
  Scenario : Checking Marshal AsAny for uint array
  Scenario : Checking Marshal AsAny for long array
  Scenario : Checking Marshal AsAny for ulong array
  Scenario : Checking Marshal AsAny for float array
  Scenario : Checking Marshal AsAny for double array
  Scenario : Checking Marshal AsAny for char array
  System.ArgumentException: No PInvoke conversion exists for value passed to Object-typed parameter.
alexischr commented 4 years ago

PR updated with char array implementation; now fails at bool arrays. CoreCLR marshals these to windows BOOLs: https://github.com/dotnet/runtime/blob/a1562933166c55025cf65dc45d72ec423ff83c02/src/coreclr/src/System.Private.CoreLib/src/System/StubHelpers.cs#L1067

alexischr commented 4 years ago

In general, the failures are because of not implemented features, and not runtime bugs (byref array marshalling, byref delegate marshalling, the above AsAny array variants, some handling of in/out parameter types)

SamMonoRT commented 4 years ago

@lambdageek - just fyi - some missing implementations identified here.