From 76def01736938a665ee6960d79d62f482bdac3db Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 24 Oct 2018 13:24:20 +0200 Subject: [PATCH 1/2] [introspection] MPSCnnBinaryKernel's kernelHeight/kernelWidth are missing on iOS too. --- tests/introspection/ApiSelectorTest.cs | 9 +++++++++ tests/introspection/Mac/MacApiSelectorTest.cs | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/introspection/ApiSelectorTest.cs b/tests/introspection/ApiSelectorTest.cs index 290f2b311a9d..831f8d7585e2 100644 --- a/tests/introspection/ApiSelectorTest.cs +++ b/tests/introspection/ApiSelectorTest.cs @@ -583,6 +583,15 @@ protected virtual bool Skip (Type type, string selectorName) return true; } break; + case "MPSCnnBinaryKernel": + switch (selectorName) { + // Xcode 9.4 removed both selectors from MPSCnnBinaryKernel, reported radar https://trello.com/c/7EAM0qk1 + // but apple says this was intentional. + case "kernelHeight": + case "kernelWidth": + return true; + } + break; } // old binding mistake diff --git a/tests/introspection/Mac/MacApiSelectorTest.cs b/tests/introspection/Mac/MacApiSelectorTest.cs index e25ef5851da9..27bdb8045c41 100644 --- a/tests/introspection/Mac/MacApiSelectorTest.cs +++ b/tests/introspection/Mac/MacApiSelectorTest.cs @@ -200,15 +200,6 @@ protected override bool Skip (Type type, string selectorName) case "readingOptionsForType:pasteboard:": case "writingOptionsForType:pasteboard:": return true; // Optional selectors on NSPasteboardReading/NSPasteboardWriting - // Xcode 9.4 removed both selectors from MPSCnnBinaryKernel, reported radar https://trello.com/c/7EAM0qk1 - // but apple says this was intentional. - case "kernelHeight": - case "kernelWidth": - switch (type.Name) { - case "MPSCnnBinaryKernel": - return true; - } - break; case "newWindowForTab:": // "This method can be implemented in the responder chain", optional but not protocol directly on NSResponder switch (type.Name) { case "NSViewController": From 9c0cd79f945ffaf45c055471c09d6252be1a9e5e Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 24 Oct 2018 13:24:56 +0200 Subject: [PATCH 2/2] [introspection] CoreNFC is not even available on all devices. --- tests/introspection/iOS/iOSApiCtorInitTest.cs | 5 ++++- tests/introspection/iOS/iOSApiFieldTest.cs | 10 ++++++++-- tests/introspection/iOS/iOSApiProtocolTest.cs | 4 ++++ tests/introspection/iOS/iOSApiSelectorTest.cs | 5 ++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/tests/introspection/iOS/iOSApiCtorInitTest.cs b/tests/introspection/iOS/iOSApiCtorInitTest.cs index ade3d6646a26..189879f97b2b 100644 --- a/tests/introspection/iOS/iOSApiCtorInitTest.cs +++ b/tests/introspection/iOS/iOSApiCtorInitTest.cs @@ -73,7 +73,10 @@ protected override bool Skip (Type type) return true; break; #endif // !__WATCHOS__ - case "CoreNFC": // Only available on device + case "CoreNFC": // Only available on devices that support NFC, so check if NFCNDEFReaderSession is present. + if (Class.GetHandle ("NFCNDEFReaderSession") == IntPtr.Zero) + return true; + break; case "DeviceCheck": // Only available on device if (Runtime.Arch == Arch.SIMULATOR) return true; diff --git a/tests/introspection/iOS/iOSApiFieldTest.cs b/tests/introspection/iOS/iOSApiFieldTest.cs index 2be1651bdae3..cb2999699bb0 100644 --- a/tests/introspection/iOS/iOSApiFieldTest.cs +++ b/tests/introspection/iOS/iOSApiFieldTest.cs @@ -53,7 +53,10 @@ protected override bool Skip (PropertyInfo p) case "MonoTouch.MetalKit": case "MetalPerformanceShaders": case "MonoTouch.MetalPerformanceShaders": - case "CoreNFC": // Only available on device + case "CoreNFC": // Only available on devices that support NFC, so check if NFCNDEFReaderSession is present. + if (Class.GetHandle ("NFCNDEFReaderSession") == IntPtr.Zero) + return true; + break; case "DeviceCheck": // Only available on device if (Runtime.Arch == Arch.SIMULATOR) return true; @@ -108,6 +111,10 @@ protected override bool Skip (PropertyInfo p) protected override bool Skip (string constantName, string libraryName) { switch (libraryName) { + case "CoreNFC": // Only available on devices that support NFC, so check if NFCNDEFReaderSession is present. + if (Class.GetHandle ("NFCNDEFReaderSession") == IntPtr.Zero) + return true; + break; case "IOSurface": return Runtime.Arch == Arch.SIMULATOR && !TestRuntime.CheckXcodeVersion (9, 0); } @@ -141,7 +148,6 @@ protected override bool Skip (string constantName, string libraryName) case "MTKTextureLoaderOptionTextureCPUCacheMode": case "MTKModelErrorDomain": case "MTKModelErrorKey": - case "NFCISO15693TagResponseErrorKey": // Not in simulator since no NFC on it return Runtime.Arch == Arch.SIMULATOR; default: return false; diff --git a/tests/introspection/iOS/iOSApiProtocolTest.cs b/tests/introspection/iOS/iOSApiProtocolTest.cs index 7a5d311cec7b..fb8579c298b3 100644 --- a/tests/introspection/iOS/iOSApiProtocolTest.cs +++ b/tests/introspection/iOS/iOSApiProtocolTest.cs @@ -46,6 +46,10 @@ protected override bool Skip (Type type) if (Runtime.Arch == Arch.SIMULATOR) return true; break; + case "CoreNFC": // Only available on devices that support NFC, so check if NFCNDEFReaderSession is present. + if (Class.GetHandle ("NFCNDEFReaderSession") == IntPtr.Zero) + return true; + break; } switch (type.Name) { diff --git a/tests/introspection/iOS/iOSApiSelectorTest.cs b/tests/introspection/iOS/iOSApiSelectorTest.cs index cae5efbf01b8..256178aadd23 100644 --- a/tests/introspection/iOS/iOSApiSelectorTest.cs +++ b/tests/introspection/iOS/iOSApiSelectorTest.cs @@ -62,7 +62,10 @@ protected override bool Skip (Type type) return true; break; // Xcode 9 - case "CoreNFC": + case "CoreNFC": // Only available on devices that support NFC, so check if NFCNDEFReaderSession is present. + if (Class.GetHandle ("NFCNDEFReaderSession") == IntPtr.Zero) + return true; + break; case "DeviceCheck": if (Runtime.Arch == Arch.SIMULATOR) return true;