From bfb8635b7ce4a1d2f75b4331c088e7c58e9d5fd3 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 15 Oct 2024 17:04:30 +0200 Subject: [PATCH] Misc test fixes. --- src/storekit.cs | 4 ++++ tests/cecil-tests/AttributeTest.cs | 11 +++++++---- tests/introspection/ApiProtocolTest.cs | 3 +++ tests/introspection/ApiSelectorTest.cs | 3 +++ .../api-annotations-dotnet/common-StoreKit.ignore | 2 ++ 5 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 tests/xtro-sharpie/api-annotations-dotnet/common-StoreKit.ignore diff --git a/src/storekit.cs b/src/storekit.cs index 2c234383fa85..bd0308d34a44 100644 --- a/src/storekit.cs +++ b/src/storekit.cs @@ -9,6 +9,9 @@ // Copyright 2012 Xamarin Inc. // Copyright 2020 Microsoft Corp. // + +using System.ComponentModel; + using ObjCRuntime; using Foundation; using CoreFoundation; @@ -34,6 +37,7 @@ namespace StoreKit { + [EditorBrowsable (EditorBrowsableState.Never)] [Internal] [BaseType (typeof (NSObject))] [DisableDefaultCtor] diff --git a/tests/cecil-tests/AttributeTest.cs b/tests/cecil-tests/AttributeTest.cs index 38c197e05cd6..220bdf8a6768 100644 --- a/tests/cecil-tests/AttributeTest.cs +++ b/tests/cecil-tests/AttributeTest.cs @@ -181,6 +181,9 @@ public void FindSupportedOnElementsThatDoNotExistInThatAssembly () // Walk every class/struct/enum/property/method/enum value/pinvoke/event foreach (var module in assembly.Modules) { foreach (var type in module.Types) { + if (!type.IsPubliclyVisible ()) + continue; + switch (type.Namespace) { case "AppKit": case "UIKit": @@ -289,10 +292,6 @@ static HashSet IgnoreElementsThatDoNotExistInThatAssembly { // These methods have different optional/required semantics between platforms. "PassKit.PKPaymentAuthorizationControllerDelegate_Extensions.GetPresentationWindow (PassKit.IPKPaymentAuthorizationControllerDelegate, PassKit.PKPaymentAuthorizationController)", - "Metal.MTLTextureWrapper.FirstMipmapInTail", - "Metal.MTLTextureWrapper.IsSparse", - "Metal.MTLTextureWrapper.TailSizeInBytes", - // HKSeriesBuilder doesn't implement the ISNCopying protocol on all platforms (and shouldn't on any according to the headers, so removed for XAMCORE_5_0). "HealthKit.HKSeriesBuilder.EncodeTo (Foundation.NSCoder)", @@ -325,6 +324,10 @@ static HashSet IgnoreElementsThatDoNotExistInThatAssembly { "Foundation.NSAttributedString.ReadableTypeIdentifiers", "Foundation.NSAttributedString.WritableTypeIdentifiers", "Foundation.NSAttributedString.WritableTypeIdentifiersForItemProvider", + + // Same method, but different arguments due to platform differences. We should treat this as the same method, so ignore this failure. + "StoreKit.AppStore.RequestReview (XKit.XWindowScene)", // iOS, MacCatalyst + "StoreKit.AppStore.RequestReview (XKit.XViewController)", // macOS }; } } diff --git a/tests/introspection/ApiProtocolTest.cs b/tests/introspection/ApiProtocolTest.cs index 80613da909a2..7fa9cc29b317 100644 --- a/tests/introspection/ApiProtocolTest.cs +++ b/tests/introspection/ApiProtocolTest.cs @@ -34,6 +34,9 @@ static bool ConformTo (IntPtr klass, IntPtr protocol) protected virtual bool Skip (Type type) { + if (MemberHasEditorBrowsableNever (type)) + return true; + switch (type.Namespace) { // Xcode 15: case "MetalFX": diff --git a/tests/introspection/ApiSelectorTest.cs b/tests/introspection/ApiSelectorTest.cs index 4704c66635b1..567ff8e224e6 100644 --- a/tests/introspection/ApiSelectorTest.cs +++ b/tests/introspection/ApiSelectorTest.cs @@ -38,6 +38,9 @@ public abstract class ApiSelectorTest : ApiBaseTest { protected virtual bool Skip (Type type) { + if (MemberHasEditorBrowsableNever (type)) + return true; + if (type.ContainsGenericParameters) return true; diff --git a/tests/xtro-sharpie/api-annotations-dotnet/common-StoreKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/common-StoreKit.ignore new file mode 100644 index 000000000000..1295a3d58015 --- /dev/null +++ b/tests/xtro-sharpie/api-annotations-dotnet/common-StoreKit.ignore @@ -0,0 +1,2 @@ +# This is one of our own types. +!unknown-type! XamarinSwiftFunctions bound