From b96721c701915030aabad757a899e7ba3b5c166e Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 17 Mar 2023 10:21:16 +0100 Subject: [PATCH] [monotouch-test] Fix bool encoding in tests on X64 on Mac Catalyst. [FAIL] TestTypeEncodings : #14 String lengths are both 1. Strings differ at index 0. Expected: "B" But was: "c" -----------^ Hopefully this is right? Ref: d6d02fa05ab94b8a7eb19a8ed74c3ffe12e4265b --- src/ObjCRuntime/Registrar.cs | 2 +- tests/monotouch-test/ObjCRuntime/RegistrarTest.cs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ObjCRuntime/Registrar.cs b/src/ObjCRuntime/Registrar.cs index 4f839a737af3..22ae8b919be3 100644 --- a/src/ObjCRuntime/Registrar.cs +++ b/src/ObjCRuntime/Registrar.cs @@ -2655,7 +2655,7 @@ protected string ToSignature (TType type, ObjCMember member, ref bool success, b case "System.Double": return "d"; case "System.Boolean": // map managed 'bool' to ObjC BOOL = 'unsigned char' in OSX and 32bit iOS architectures and 'bool' in 64bit iOS architectures -#if MONOMAC +#if MONOMAC || __MACCATALYST__ return IsARM64 ? "B" : "c"; #else return Is64Bits ? "B" : "c"; diff --git a/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs b/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs index 2c5b51552464..75cd6a049d72 100644 --- a/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs +++ b/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs @@ -1450,10 +1450,8 @@ public void TestTypeEncodings () { var cl = new Class (typeof (TestTypeEncodingsClass)); var sig = Runtime.GetNSObject (Messaging.IntPtr_objc_msgSend_IntPtr (cl.Handle, Selector.GetHandle ("methodSignatureForSelector:"), Selector.GetHandle ("foo::::::::::::::::"))); -#if MONOMAC +#if MONOMAC || __MACCATALYST__ var boolEncoding = TrampolineTest.IsArm64CallingConvention ? "B" : "c"; -#elif __MACCATALYST__ - var boolEncoding = "B"; #else var boolEncoding = (IntPtr.Size == 8 || TrampolineTest.IsArmv7k || TrampolineTest.IsArm64CallingConvention) ? "B" : "c";