diff --git a/tests/cecil-tests/BlittablePInvokes.KnownFailures.cs b/tests/cecil-tests/BlittablePInvokes.KnownFailures.cs index 3555c72ea1..7d8d07cc53 100644 --- a/tests/cecil-tests/BlittablePInvokes.KnownFailures.cs +++ b/tests/cecil-tests/BlittablePInvokes.KnownFailures.cs @@ -66,6 +66,8 @@ namespace Cecil.Tests { "AVFoundation.AVSampleCursorSyncInfo ObjCRuntime.Messaging::AVSampleCursorSyncInfo_objc_msgSend(System.IntPtr,System.IntPtr)", "AVFoundation.AVSampleCursorSyncInfo ObjCRuntime.Messaging::AVSampleCursorSyncInfo_objc_msgSendSuper_stret(System.IntPtr,System.IntPtr)", "AVFoundation.AVSampleCursorSyncInfo ObjCRuntime.Messaging::AVSampleCursorSyncInfo_objc_msgSendSuper(System.IntPtr,System.IntPtr)", + "System.Byte GameController.GCExtendedGamepadSnapshot::GCExtendedGamepadSnapshotDataFromNSData(GameController.GCExtendedGamepadSnapshotData*,System.IntPtr)", + "System.IntPtr GameController.GCExtendedGamepadSnapshotData::NSDataFromGCExtendedGamepadSnapshotData(GameController.GCExtendedGamepadSnapshotData*)", "System.Void ObjCRuntime.Messaging::void_objc_msgSend_GCDualSenseAdaptiveTriggerPositionalAmplitudes_float(System.IntPtr,System.IntPtr,GameController.GCDualSenseAdaptiveTriggerPositionalAmplitudes,System.Single)", "System.Void ObjCRuntime.Messaging::void_objc_msgSend_GCDualSenseAdaptiveTriggerPositionalResistiveStrengths(System.IntPtr,System.IntPtr,GameController.GCDualSenseAdaptiveTriggerPositionalResistiveStrengths)", "System.Void ObjCRuntime.Messaging::void_objc_msgSendSuper_GCDualSenseAdaptiveTriggerPositionalAmplitudes_float(System.IntPtr,System.IntPtr,GameController.GCDualSenseAdaptiveTriggerPositionalAmplitudes,System.Single)", diff --git a/tests/cecil-tests/BlittablePInvokes.cs b/tests/cecil-tests/BlittablePInvokes.cs index b92d21e596..9c73ca600d 100644 --- a/tests/cecil-tests/BlittablePInvokes.cs +++ b/tests/cecil-tests/BlittablePInvokes.cs @@ -326,11 +326,13 @@ namespace Cecil.Tests { blitCache [type.Name] = new BlitAndReason (true, ""); return true; } - if (IsBlittablePointer (type)) { + var localResult = new StringBuilder (); + if (IsBlittablePointer (assembly, type, provider, localResult, blitCache)) { blitCache [type.Name] = new BlitAndReason (true, ""); return true; } - var localResult = new StringBuilder (); + result.Append (localResult); + localResult.Clear (); if (IsBlittableValueType (assembly, type, localResult, blitCache)) { blitCache [type.Name] = new BlitAndReason (true, ""); return true; @@ -365,9 +367,24 @@ namespace Cecil.Tests { return typesWeLike.Contains (t.ToString ()); } - bool IsBlittablePointer (TypeReference type) + bool IsBlittablePointer (AssemblyDefinition assembly, TypeReference type, IMarshalInfoProvider provider, StringBuilder result, Dictionary blitCache) { - return type.IsPointer || type.IsFunctionPointer; + if (type.IsFunctionPointer) + return true; + + if (!type.IsPointer) + return false; + + var localResult = new StringBuilder (); + if (!IsTypeBlittable (assembly, type.GetElementType (), provider, localResult, blitCache)) { + var pointerResult = new StringBuilder (); + pointerResult.Append ($" {type.Name}: {localResult}"); + result.Append (pointerResult); + blitCache [type.Name] = new BlitAndReason (false, pointerResult.ToString ()); + return false; + } + + return true; }