Skip to content

Commit 950bcb3

Browse files
committed
[monotouch-test] Fix bool encoding in tests on X64 on Mac Catalyst.
[FAIL] TestTypeEncodings : dotnet#14 String lengths are both 1. Strings differ at index 0. Expected: "B" But was: "c" -----------^ Hopefully this is right? Ref: d6d02fa
1 parent 008b716 commit 950bcb3

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/ObjCRuntime/Registrar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2655,7 +2655,7 @@ protected string ToSignature (TType type, ObjCMember member, ref bool success, b
26552655
case "System.Double": return "d";
26562656
case "System.Boolean":
26572657
// map managed 'bool' to ObjC BOOL = 'unsigned char' in OSX and 32bit iOS architectures and 'bool' in 64bit iOS architectures
2658-
#if MONOMAC
2658+
#if MONOMAC || __MACCATALYST__
26592659
return IsARM64 ? "B" : "c";
26602660
#else
26612661
return Is64Bits ? "B" : "c";

tests/monotouch-test/ObjCRuntime/RegistrarTest.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,10 +1450,8 @@ public void TestTypeEncodings ()
14501450
{
14511451
var cl = new Class (typeof (TestTypeEncodingsClass));
14521452
var sig = Runtime.GetNSObject<NSMethodSignature> (Messaging.IntPtr_objc_msgSend_IntPtr (cl.Handle, Selector.GetHandle ("methodSignatureForSelector:"), Selector.GetHandle ("foo::::::::::::::::")));
1453-
#if MONOMAC
1453+
#if MONOMAC || __MACCATALYST__
14541454
var boolEncoding = TrampolineTest.IsArm64CallingConvention ? "B" : "c";
1455-
#elif __MACCATALYST__
1456-
var boolEncoding = "B";
14571455
#else
14581456
var boolEncoding = (IntPtr.Size == 8 || TrampolineTest.IsArmv7k || TrampolineTest.IsArm64CallingConvention) ? "B" : "c";
14591457

0 commit comments

Comments
 (0)