From ac4cf307df90e70c22e303a0860a80ebefea7387 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 5 Nov 2024 17:04:42 +0100 Subject: [PATCH 1/3] [introspection] Numerous technical debt fixes. * Remove all legacy code. * Fix all warnings. * Enable warnings as errors. * Started unifying code between macOS vs iOS/tvOS/MacCatalyst. * Updated README slightly. --- tests/common/AppDelegate.cs | 3 + tests/common/PlatformInfo.cs | 98 +-- tests/introspection/ApiAvailabilityTest.cs | 575 ------------------ tests/introspection/ApiBaseTest.cs | 13 +- tests/introspection/ApiCMAttachmentTest.cs | 25 +- tests/introspection/ApiClassPtrTest.cs | 5 +- .../introspection/ApiCoreImageFiltersTest.cs | 17 +- tests/introspection/ApiCtorInitTest.cs | 11 +- tests/introspection/ApiFieldTest.cs | 5 +- tests/introspection/ApiFrameworkTest.cs | 89 +-- tests/introspection/ApiPInvokeTest.cs | 15 +- tests/introspection/ApiProtocolTest.cs | 6 - tests/introspection/ApiSelectorTest.cs | 22 +- tests/introspection/ApiSignatureTest.cs | 11 +- tests/introspection/ApiTypeTest.cs | 5 +- tests/introspection/ApiTypoTest.cs | 44 +- tests/introspection/ApiWeakPropertyTest.cs | 3 + .../AppIcons.appiconset/Contents.json | 13 - .../AppIcons.appiconset/icon-app-57.png | Bin .../AppIcons.appiconset/icon-app-57@2x.png | Bin .../AppIcons.appiconset/icon-app-60@2x.png | Bin .../AppIcons.appiconset/icon-app-72.png | Bin .../AppIcons.appiconset/icon-app-72@2x.png | Bin .../AppIcons.appiconset/icon-app-76.png | Bin .../AppIcons.appiconset/icon-app-76@2x.png | Bin .../AppIcons.appiconset/icon-app-83.5@2x.png | Bin tests/introspection/CoreSelectorTest.cs | 3 + .../{iOS => }/Entitlements.plist | 0 tests/introspection/{iOS => }/Info.plist | 0 .../{iOS => }/LaunchScreen.storyboard | 0 tests/introspection/Mac/Info.plist | 36 -- tests/introspection/Mac/MacApiPInvokeTest.cs | 76 --- .../Mac/introspection-mac.csproj | 159 ----- .../{Mac => }/MacApiCtorInitTest.cs | 5 - .../{Mac => }/MacApiFieldTest.cs | 21 - tests/introspection/MacApiPInvokeTest.cs | 29 + .../{Mac => }/MacApiProtocolTest.cs | 21 - .../{Mac => }/MacApiSelectorTest.cs | 62 +- .../{Mac => }/MacApiSignatureTest.cs | 20 - .../introspection/{Mac => }/MacApiTypoTest.cs | 14 +- .../{Mac => }/MacApiWeakPropertyTest.cs | 0 .../{Mac => }/MacCoreImageFiltersTest.cs | 0 tests/introspection/README.md | 10 +- tests/introspection/dotnet/shared.csproj | 72 ++- .../AppIcons.appiconset/Icon-app-60@3x.png | Bin 5100 -> 0 bytes .../iOS/introspection-ios.csproj | 206 ------- .../{iOS => }/iOSApiClassPtrTest.cs | 6 - .../{iOS => }/iOSApiCtorInitTest.cs | 29 +- .../{iOS => }/iOSApiFieldTest.cs | 7 +- .../{iOS => }/iOSApiPInvokeTest.cs | 7 +- .../{iOS => }/iOSApiProtocolTest.cs | 155 +---- .../{iOS => }/iOSApiSelectorTest.cs | 91 +-- .../{iOS => }/iOSApiSignatureTest.cs | 13 +- .../introspection/{iOS => }/iOSApiTypoTest.cs | 10 - .../{iOS => }/iOSApiWeakPropertyTest.cs | 3 + .../{iOS => }/iOSCoreImageFiltersTest.cs | 3 - 56 files changed, 141 insertions(+), 1877 deletions(-) delete mode 100644 tests/introspection/ApiAvailabilityTest.cs rename tests/introspection/{iOS => }/Assets.xcassets/AppIcons.appiconset/Contents.json (93%) rename tests/introspection/{iOS => }/Assets.xcassets/AppIcons.appiconset/icon-app-57.png (100%) rename tests/introspection/{iOS => }/Assets.xcassets/AppIcons.appiconset/icon-app-57@2x.png (100%) rename tests/introspection/{iOS => }/Assets.xcassets/AppIcons.appiconset/icon-app-60@2x.png (100%) rename tests/introspection/{iOS => }/Assets.xcassets/AppIcons.appiconset/icon-app-72.png (100%) rename tests/introspection/{iOS => }/Assets.xcassets/AppIcons.appiconset/icon-app-72@2x.png (100%) rename tests/introspection/{iOS => }/Assets.xcassets/AppIcons.appiconset/icon-app-76.png (100%) rename tests/introspection/{iOS => }/Assets.xcassets/AppIcons.appiconset/icon-app-76@2x.png (100%) rename tests/introspection/{iOS => }/Assets.xcassets/AppIcons.appiconset/icon-app-83.5@2x.png (100%) rename tests/introspection/{iOS => }/Entitlements.plist (100%) rename tests/introspection/{iOS => }/Info.plist (100%) rename tests/introspection/{iOS => }/LaunchScreen.storyboard (100%) delete mode 100644 tests/introspection/Mac/Info.plist delete mode 100644 tests/introspection/Mac/MacApiPInvokeTest.cs delete mode 100644 tests/introspection/Mac/introspection-mac.csproj rename tests/introspection/{Mac => }/MacApiCtorInitTest.cs (99%) rename tests/introspection/{Mac => }/MacApiFieldTest.cs (92%) create mode 100644 tests/introspection/MacApiPInvokeTest.cs rename tests/introspection/{Mac => }/MacApiProtocolTest.cs (95%) rename tests/introspection/{Mac => }/MacApiSelectorTest.cs (95%) rename tests/introspection/{Mac => }/MacApiSignatureTest.cs (96%) rename tests/introspection/{Mac => }/MacApiTypoTest.cs (65%) rename tests/introspection/{Mac => }/MacApiWeakPropertyTest.cs (100%) rename tests/introspection/{Mac => }/MacCoreImageFiltersTest.cs (100%) delete mode 100644 tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/Icon-app-60@3x.png delete mode 100644 tests/introspection/iOS/introspection-ios.csproj rename tests/introspection/{iOS => }/iOSApiClassPtrTest.cs (91%) rename tests/introspection/{iOS => }/iOSApiCtorInitTest.cs (94%) rename tests/introspection/{iOS => }/iOSApiFieldTest.cs (97%) rename tests/introspection/{iOS => }/iOSApiPInvokeTest.cs (96%) rename tests/introspection/{iOS => }/iOSApiProtocolTest.cs (81%) rename tests/introspection/{iOS => }/iOSApiSelectorTest.cs (90%) rename tests/introspection/{iOS => }/iOSApiSignatureTest.cs (95%) rename tests/introspection/{iOS => }/iOSApiTypoTest.cs (86%) rename tests/introspection/{iOS => }/iOSApiWeakPropertyTest.cs (95%) rename tests/introspection/{iOS => }/iOSCoreImageFiltersTest.cs (94%) diff --git a/tests/common/AppDelegate.cs b/tests/common/AppDelegate.cs index bc895afcec49..3d84edb4fc6b 100644 --- a/tests/common/AppDelegate.cs +++ b/tests/common/AppDelegate.cs @@ -12,6 +12,9 @@ using NUnit.Framework; using NUnit.Framework.Internal; +// Disable until we get around to enable + fix any issues. +#nullable disable + [Register ("AppDelegate")] public partial class AppDelegate : UIApplicationDelegate { public static TouchRunner Runner { get; set; } diff --git a/tests/common/PlatformInfo.cs b/tests/common/PlatformInfo.cs index dcf4b4e962bf..f1ea1ccdec16 100644 --- a/tests/common/PlatformInfo.cs +++ b/tests/common/PlatformInfo.cs @@ -22,6 +22,9 @@ using Xamarin.Utils; +// Disable until we get around to enable + fix any issues. +#nullable disable + namespace Xamarin.Tests { public sealed class PlatformInfo { static PlatformInfo GetHostPlatformInfo () @@ -34,9 +37,6 @@ static PlatformInfo GetHostPlatformInfo () #elif __TVOS__ || __IOS__ name = UIDevice.CurrentDevice.SystemName; version = UIDevice.CurrentDevice.SystemVersion; -#elif __WATCHOS__ - name = WatchKit.WKInterfaceDevice.CurrentDevice.SystemName; - version = WatchKit.WKInterfaceDevice.CurrentDevice.SystemVersion; #elif MONOMAC || __MACOS__ using (var plist = NSDictionary.FromFile ("/System/Library/CoreServices/SystemVersion.plist")) { name = (NSString) plist ["ProductName"]; @@ -51,7 +51,6 @@ static PlatformInfo GetHostPlatformInfo () var platformInfo = new PlatformInfo (); -#if NET if (name.StartsWith ("maccatalyst", StringComparison.Ordinal)) platformInfo.Name = ApplePlatform.MacCatalyst; else if (name.StartsWith ("mac", StringComparison.Ordinal)) @@ -60,39 +59,16 @@ static PlatformInfo GetHostPlatformInfo () platformInfo.Name = ApplePlatform.iOS; else if (name.StartsWith ("tvos", StringComparison.Ordinal)) platformInfo.Name = ApplePlatform.TVOS; - else if (name.StartsWith ("watchos", StringComparison.Ordinal)) - platformInfo.Name = ApplePlatform.WatchOS; else throw new FormatException ($"Unknown product name: {name}"); -#else - if (name.StartsWith ("maccatalyst", StringComparison.Ordinal)) - platformInfo.Name = PlatformName.MacCatalyst; - else if (name.StartsWith ("mac", StringComparison.Ordinal)) - platformInfo.Name = PlatformName.MacOSX; - else if (name.StartsWith ("ios", StringComparison.Ordinal) || name.StartsWith ("iphoneos", StringComparison.Ordinal)) - platformInfo.Name = PlatformName.iOS; - else if (name.StartsWith ("tvos", StringComparison.Ordinal)) - platformInfo.Name = PlatformName.TvOS; - else if (name.StartsWith ("watchos", StringComparison.Ordinal)) - platformInfo.Name = PlatformName.WatchOS; - else - throw new FormatException ($"Unknown product name: {name}"); -#endif platformInfo.Version = Version.Parse (version); -#if !NET - if (IntPtr.Size == 4) - platformInfo.Architecture = PlatformArchitecture.Arch32; - else if (IntPtr.Size == 8) - platformInfo.Architecture = PlatformArchitecture.Arch64; -#endif - return platformInfo; } #if __MACCATALYST__ - static string? _iOSSupportVersion; + static string _iOSSupportVersion; internal static string iOSSupportVersion { get { if (_iOSSupportVersion is null) { @@ -109,23 +85,11 @@ internal static string iOSSupportVersion { public static readonly PlatformInfo Host = GetHostPlatformInfo (); -#if NET public ApplePlatform Name { get; private set; } -#else - public PlatformName Name { get; private set; } - public PlatformArchitecture Architecture { get; private set; } -#endif public Version Version { get; private set; } -#if NET public bool IsMac => Name == ApplePlatform.MacOSX; public bool IsIos => Name == ApplePlatform.iOS; -#else - public bool IsMac => Name == PlatformName.MacOSX; - public bool IsIos => Name == PlatformName.iOS; - public bool IsArch32 => Architecture.HasFlag (PlatformArchitecture.Arch32); - public bool IsArch64 => Architecture.HasFlag (PlatformArchitecture.Arch64); -#endif PlatformInfo () { @@ -138,38 +102,25 @@ public static bool IsAvailableOnHostPlatform (this ICustomAttributeProvider attr return attributeProvider.IsAvailable (PlatformInfo.Host); } -#if NET [UnconditionalSuppressMessage ("Trimming", "IL2045", Justification = "Some of the attributes this method uses may have been linked away, so things might not work. It actually works though, so unless something changes, we're going to assume it's trimmer-compatible.")] -#endif public static bool IsAvailable (this ICustomAttributeProvider attributeProvider, PlatformInfo targetPlatform) { var customAttributes = attributeProvider.GetCustomAttributes (true); -#if NET customAttributes = customAttributes.ToArray (); // don't iterate twice if (customAttributes.Any (v => v is ObsoleteAttribute)) return false; -#endif return customAttributes -#if NET .OfType () -#else - .OfType () -#endif .IsAvailable (targetPlatform); } -#if NET public static bool IsAvailableOnHostPlatform (this IEnumerable attributes) -#else - public static bool IsAvailableOnHostPlatform (this IEnumerable attributes) -#endif { return attributes.IsAvailable (PlatformInfo.Host); } -#if NET static IEnumerable<(OSPlatformAttribute Attribute, ApplePlatform Platform, Version Version)> ParseAttributes (IEnumerable attributes) { foreach (var attr in attributes) { @@ -205,9 +156,7 @@ public static bool IsAvailable (this IEnumerable attributes // return attributes.Count () == 0; } -#if NET [UnconditionalSuppressMessage ("Trimming", "IL2045", Justification = "Some of the attributes this method uses may have been linked away, so things might not work. It actually works though, so unless something changes, we're going to assume it's trimmer-compatible.")] -#endif public static bool? IsAvailable (IEnumerable<(OSPlatformAttribute Attribute, ApplePlatform Platform, Version Version)> attributes, PlatformInfo targetPlatform, ApplePlatform attributePlatform) { // First we check for any unsupported attributes, and only once we know that there aren't any unsupported @@ -240,44 +189,5 @@ public static bool IsAvailable (this IEnumerable attributes return null; } -#else - public static bool IsAvailable (this IEnumerable attributes, PlatformInfo targetPlatform) - { - // always "available" from a binding perspective if - // there are no explicit annotations saying otherwise - var available = true; - - foreach (var attr in attributes) { - if (attr.Platform != targetPlatform.Name) - continue; - - switch (attr.AvailabilityKind) { - case AvailabilityKind.Introduced: - if (attr.Version is not null) - available &= targetPlatform.Version >= attr.Version; - - if (attr.Architecture != PlatformArchitecture.None && - attr.Architecture != PlatformArchitecture.All) - available &= attr.Architecture.HasFlag (targetPlatform.Architecture); - break; - case AvailabilityKind.Deprecated: - case AvailabilityKind.Obsoleted: - if (attr.Version is not null) - available &= targetPlatform.Version < attr.Version; - // FIXME: handle architecture-level _un_availability? - // we didn't do this with the old AvailabilityAttribute... - break; - case AvailabilityKind.Unavailable: - available = false; - break; - } - - if (!available) - return false; - } - - return available; - } -#endif } } diff --git a/tests/introspection/ApiAvailabilityTest.cs b/tests/introspection/ApiAvailabilityTest.cs deleted file mode 100644 index b0f223a86780..000000000000 --- a/tests/introspection/ApiAvailabilityTest.cs +++ /dev/null @@ -1,575 +0,0 @@ -// -// Availability tests for introspection -// -// Authors: -// Sebastien Pouliot -// -// Copyright 2017 Microsoft Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#if !NET // this test is in cecil-tests in .NET - -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Runtime.Versioning; -using System.Text; -using NUnit.Framework; -using ObjCRuntime; -using Xamarin.Tests; -using Xamarin.Utils; - -using ApplePlatform = ObjCRuntime.PlatformName; - -namespace Introspection { - - public class ApiAvailabilityTest : ApiBaseTest { - - protected Version Minimum { get; set; } - protected Version Maximum { get; set; } - protected Func Filter { get; set; } - protected PlatformName Platform { get; set; } - - public ApiAvailabilityTest () - { - Maximum = Version.Parse (Constants.SdkVersion); -#if __MACCATALYST__ - Platform = PlatformName.MacCatalyst; - Minimum = Xamarin.SdkVersions.MinMacCatalystVersion; -#elif __IOS__ - Platform = PlatformName.iOS; - Minimum = Xamarin.SdkVersions.MiniOSVersion; -#elif __TVOS__ - Platform = PlatformName.TvOS; - Minimum = Xamarin.SdkVersions.MinTVOSVersion; -#elif __WATCHOS__ - Platform = PlatformName.WatchOS; - Minimum = Xamarin.SdkVersions.MinWatchOSVersion; -#elif MONOMAC - Platform = PlatformName.MacOSX; - Minimum = Xamarin.SdkVersions.MinOSXVersion; -#else -#error No Platform Defined -#endif - - Filter = (AvailabilityBaseAttribute arg) => { - return (arg.AvailabilityKind != AvailabilityKind.Introduced) || (arg.Platform != Platform); - }; - } - - bool FoundInProtocols (MemberInfo m, Type t) - { - var method = m.ToString (); - foreach (var intf in t.GetInterfaces ()) { - var p = Assembly.GetType (intf.FullName); - if (p is not null) { - // here we want inherited members so we don't have to hunt inherited interfaces recursively - foreach (var pm in p.GetMembers ()) { - if (pm.ToString () != method) - continue; - return true; - } - foreach (var ca in p.GetCustomAttributes ()) { - // TODO check signature in [ProtocolMember] - if (ca.IsProperty) { - if (m.Name == "get_" + ca.Name) - return true; - if (m.Name == "set_" + ca.Name) - return true; - } - if (m.Name == ca.Name) - return true; - } - } - p = Assembly.GetType (intf.Namespace + "." + intf.Name.Substring (1)); - if (p is not null) { - // here we want inherited members so we don't have to hunt inherited interfaces recursively - foreach (var pm in p.GetMembers ()) { - if (pm.ToString () != method) - continue; - return true; - } - } - p = Assembly.GetType (intf.Namespace + "." + intf.Name.Substring (1) + "_Extensions"); - if (p is not null) { - // here we want inherited members so we don't have to hunt inherited interfaces recursively - foreach (var pm in p.GetMembers ()) { - // map extension method to original @optional - if (m.Name != pm.Name) - continue; - var parameters = (pm as MethodInfo).GetParameters (); - if (parameters.Length == 0) - continue; - var pattern = "(" + parameters [0].ParameterType.FullName; - if (parameters.Length > 1) - pattern += ", "; - var s = pm.ToString ().Replace (pattern, "("); - if (s != method) - continue; - return true; - } - } - } - return false; - } - - void CheckIntroduced (Type t, AvailabilityBaseAttribute ta, MemberInfo m) - { - var ma = CheckAvailability (m); - if (ta is null || ma is null) - return; - - // need to skip members that are copied to satisfy interfaces (protocol members) - if (FoundInProtocols (m, t)) - return; - - var taVersion = ta.Version; - var maVersion = ma.Version; - // Duplicate checks, e.g. same attribute on member and type (extranous metadata) - if (maVersion == taVersion) { - switch (t.FullName) { - case "AppKit.INSAccessibility": - // special case for [I]NSAccessibility type (10.9) / protocol (10.10) mix up - // https://github.com/xamarin/xamarin-macios/issues/10009 - // better some dupes than being inaccurate when protocol members are inlined - break; - default: - AddErrorLine ($"[FAIL] {maVersion} ({m}) == {taVersion} ({t})"); - break; - } - } - // Consistency checks, e.g. member lower than type - // note: that's valid in some cases, like a new base type being introduced - if (maVersion < taVersion) { - switch (t.FullName) { - case "CoreBluetooth.CBPeer": - switch (m.ToString ()) { - // type added later and existing property was moved - case "Foundation.NSUuid get_Identifier()": - case "Foundation.NSUuid Identifier": - return; - } - break; - case "MetricKit.MXUnitAveragePixelLuminance": - case "MetricKit.MXUnitSignalBars": - // design bug wrt generics leading to redefinition of some members in subclasses - if (m.ToString () == "System.String Symbol") - return; - break; - } - AddErrorLine ($"[FAIL] {maVersion} ({m}) < {taVersion} ({t})"); - } - } - - [Test] - public void Introduced () - { - //LogProgress = true; - Errors = 0; - foreach (Type t in Assembly.GetTypes ()) { - if (LogProgress) - Console.WriteLine ($"T: {t}"); - var ta = CheckAvailability (t); - - foreach (var p in t.GetProperties (BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)) { - if (LogProgress) - Console.WriteLine ($"P: {p}"); - CheckIntroduced (t, ta, p); - } - - // this checks getter and setters which have copies of availability attributes (in legacy) - foreach (var m in t.GetMembers (BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)) { - if (LogProgress) - Console.WriteLine ($"M: {m}"); - CheckIntroduced (t, ta, m); - } - } - AssertIfErrors ("{0} API with unneeded or incorrect version information", Errors); - } - -#if XAMCORE_4_0 - [Test] - public void Deprecated () - { - // Warn about any API deprecated before the minimum (e.g. < iOS 6). - // Those should not be exposed in future profiles. - Assert.Fail ("TODO"); - } -#endif - - string ToString (ICustomAttributeProvider cap) - { - var s = cap.ToString (); - if (cap is MemberInfo mi) { - var i = s.IndexOf (' '); - if (i != -1) { - // a method/property without the declaring type is hard to track down - s = s.Insert (i + 1, mi.DeclaringType + "::"); - } - } - return s; - } - - protected AvailabilityBaseAttribute CheckAvailability (ICustomAttributeProvider cap) - { - var attrs = cap.GetCustomAttributes (false); - foreach (var ca in attrs) { - if (!(ca is AvailabilityBaseAttribute aa)) - continue; - if (Filter (aa)) - continue; - - // FIXME should be `<=` but that another large change best done in a different PR - bool isAvailableBeforeMinimum = false; - var aaVersion = aa.Version; - if ((aa.AvailabilityKind == AvailabilityKind.Introduced) && (aaVersion < Minimum)) { - switch (aa.Architecture) { - case PlatformArchitecture.All: - case PlatformArchitecture.None: - isAvailableBeforeMinimum = true; - break; - default: - // An old API still needs the annotations when not available on all architectures - // e.g. NSMenuView is macOS 10.0 but only 32 bits - break; - } - } - if (isAvailableBeforeMinimum) - AddErrorLine ($"[FAIL] {aaVersion} <= {Minimum} (Min) on '{ToString (cap)}'."); - if (aaVersion > Maximum) - AddErrorLine ($"[FAIL] {aaVersion} > {Maximum} (Max) on '{ToString (cap)}'."); - return aa; - } - return null; - } - - bool IsUnavailable (ICustomAttributeProvider cap, out Version? version) - { - version = null; - foreach (var a in cap.GetCustomAttributes (false)) { - var ca = a; - if (ca is UnavailableAttribute ua) { - if (ua.Platform == Platform) - return true; - } - } - return false; - } - - AvailabilityBaseAttribute GetAvailable (ICustomAttributeProvider cap, out Version? version) - { - version = null; - foreach (var a in cap.GetCustomAttributes (false)) { - var ca = a; - if (ca is AvailabilityBaseAttribute aa) { - if ((aa.AvailabilityKind != AvailabilityKind.Unavailable) && (aa.Platform == Platform)) - return aa; - } - } - return null; - } - - void CheckUnavailable (Type t, bool typeUnavailable, Version? typeUnavailableVersion, MemberInfo m) - { - // Turns out Version (13, 1, 0) > Version (13, 1) since undefined fields are -1 - // However, we consider them equal, so force a 0 Build if set to -1 - if (typeUnavailableVersion is not null && typeUnavailableVersion.Build == -1) { - typeUnavailableVersion = new Version (typeUnavailableVersion.Major, typeUnavailableVersion.Minor, 0); - } - - var ma = GetAvailable (m, out var availableVersion); - if (typeUnavailable && (ma is not null)) { - if (typeUnavailableVersion is not null && availableVersion is not null) { - if (availableVersion >= typeUnavailableVersion) - AddErrorLine ($"[FAIL] {m} in {m.DeclaringType.FullName} is marked with {ma} in {availableVersion} but the type {t.FullName} is [Unavailable ({Platform})] in {typeUnavailableVersion}"); - } else { - AddErrorLine ($"[FAIL] {m} in {m.DeclaringType.FullName} is marked with {ma} but the type {t.FullName} is [Unavailable ({Platform})]"); - } - } - - var mu = IsUnavailable (m, out var unavailableVersion); - if (mu && (ma is not null)) { - if (availableVersion is not null && unavailableVersion is not null) { - // Apple is introducing and deprecating numerous APIs in the same Mac Catalyst version, - // so specifically for Mac Catalyst, we do a simple 'greater than' version check, - // instead of a 'greater than or equal' version like we do for the other platforms. - - if (Platform == ApplePlatform.MacCatalyst) { - if (availableVersion > unavailableVersion) - AddErrorLine ($"[FAIL] {m} is marked both [Unavailable ({Platform})] and {ma}, and it's available in version {availableVersion} which is > than the unavailable version {unavailableVersion}"); - } else { - if (availableVersion >= unavailableVersion) - AddErrorLine ($"[FAIL] {m} is marked both [Unavailable ({Platform})] and {ma}, and it's available in version {availableVersion} which is >= than the unavailable version {unavailableVersion}"); - } - } else { - // As documented in https://docs.microsoft.com/en-us/dotnet/standard/analyzers/platform-compat-analyzer#advanced-scenarios-for-attribute-combinations - // it is valid, and required in places to declare a type both availabile and unavailable on a given platform. - // Example: - // [SupportedOSPlatform ("macos")] - // [UnsupportedOSPlatform ("macos10.13")] - // This API was introduced on macOS but became unavailable on 10.13 - // The legacy attributes described this with Deprecated, and did not need to double declare - AddErrorLine ($"[FAIL] {m} in {m.DeclaringType.FullName} is marked both [Unavailable ({Platform})] and {ma}."); - } - } - } - - [Test] - public void Unavailable () - { - //LogProgress = true; - Errors = 0; - foreach (Type t in Assembly.GetTypes ()) { - if (SkipUnavailable (t)) - continue; - if (LogProgress) - Console.WriteLine ($"T: {t}"); - var tu = IsUnavailable (t, out var unavailableVersion); - var ta = GetAvailable (t, out var availableVersion); - if (tu && (ta is not null)) { - if (availableVersion is not null && unavailableVersion is not null) { - // Apple is introducing and deprecating numerous APIs in the same Mac Catalyst version, - // so specifically for Mac Catalyst, we do a simple 'greater than' version check, - // instead of a 'greater than or equal' version like we do for the other platforms. - if (Platform == ApplePlatform.MacCatalyst) { - if (availableVersion > unavailableVersion) - AddErrorLine ($"[FAIL] {t.FullName} is marked both [Unavailable ({Platform})] and {ta}, and it's available in version {availableVersion} which is > than the unavailable version {unavailableVersion}"); - - } else { - if (availableVersion >= unavailableVersion) - AddErrorLine ($"[FAIL] {t.FullName} is marked both [Unavailable ({Platform})] and {ta}, and it's available in version {availableVersion} which is >= than the unavailable version {unavailableVersion}"); - } - } else { - // As documented in https://docs.microsoft.com/en-us/dotnet/standard/analyzers/platform-compat-analyzer#advanced-scenarios-for-attribute-combinations - // it is valid, and required in places to declare a type both availabile and unavailable on a given platform. - // Example: - // [SupportedOSPlatform ("macos")] - // [UnsupportedOSPlatform ("macos10.13")] - // This API was introduced on macOS but became unavailable on 10.13 - // The legacy attributes described this with Deprecated, and did not need to double declare - AddErrorLine ($"[FAIL] {t.FullName} is marked both [Unavailable ({Platform})] and {ta}. Available: {availableVersion} Unavailable: {unavailableVersion}"); - } - } - - foreach (var p in t.GetProperties (BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)) { - if (SkipUnavailable (t, p.Name)) - continue; - if (LogProgress) - Console.WriteLine ($"P: {p.Name}"); - CheckUnavailable (t, tu, unavailableVersion, p); - } - - foreach (var m in t.GetMembers (BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)) { - if (SkipUnavailable (t, m.Name)) - continue; - if (LogProgress) - Console.WriteLine ($"M: {m.Name}"); - CheckUnavailable (t, tu, unavailableVersion, m); - } - } - AssertIfErrors ("{0} API with mixed [Unavailable] and availability attributes", Errors); - } - - protected virtual bool SkipUnavailable (Type type) - { -#if __MACCATALYST__ - switch (type.Namespace) { - case "AddressBook": { - // The entire framework was introduced and deprecated in the same Mac Catalyst version - return true; - } - } -#endif - - switch (type.FullName) { -#if __MACCATALYST__ - case "SafariServices.SFContentBlockerErrorCode": - case "SafariServices.SFContentBlockerErrorCodeExtensions": - // introduced and deprecated in the same Mac Catalyst version - return true; -#endif - } - return false; - } - - protected virtual bool SkipUnavailable (Type type, string memberName) - { - switch (type.FullName) { -#if __MACOS__ - case "AppKit.NSDrawer": - switch (memberName) { - case "AccessibilityChildrenInNavigationOrder": - case "get_AccessibilityChildrenInNavigationOrder": - case "set_AccessibilityChildrenInNavigationOrder": - case "AccessibilityCustomActions": - case "get_AccessibilityCustomActions": - case "set_AccessibilityCustomActions": - case "AccessibilityCustomRotors": - case "get_AccessibilityCustomRotors": - case "set_AccessibilityCustomRotors": - // NSDrawer was deprecated in macOS 10.13, but implements (and inlines) NSAccessibility, which added several new members in macOS 10.13, so ignore those members here. - return true; - } - break; - case "GLKit.GLKTextureLoader": - switch (memberName) { - case "GrayscaleAsAlpha": - case "get_GrayscaleAsAlpha": - // GLKTextureLoader is deprecated, but the GLKTextureLoaderGrayscaleAsAlpha value, which we've put inside the GLKTextureLoader class, isn't. - return true; - } - break; -#endif -#if __MACCATALYST__ - case "AudioUnit.AudioComponent": - switch (memberName) { - case "LastActiveTime": - // introduced and deprecated in the same Mac Catalyst version - return true; - } - break; - // Apple itself is inconsistent in the availability of the type compared to these selectors - case "AVFoundation.AVCaptureStillImageOutput": - switch (memberName) { - case "AutomaticallyEnablesStillImageStabilizationWhenAvailable": - case "CapturingStillImage": - case "HighResolutionStillImageOutputEnabled": - case "IsStillImageStabilizationActive": - case "IsStillImageStabilizationSupported": - return true; - } - break; -#endif - case "CarPlay.CPApplicationDelegate": - switch (memberName) { - case "DidDiscardSceneSessions": - case "GetConfiguration": - case "GetHandlerForIntent": - case "ShouldAutomaticallyLocalizeKeyCommands": - case "ShouldRestoreSecureApplicationState": - case "ShouldSaveSecureApplicationState": - // CPApplicationDelegate is deprecated in macOS 10.15, but these members are pulled in from the UIApplicationDelegate protocol (which is not deprecated) - return true; - } - break; - case "CoreMedia.CMTimebase": { - switch (memberName) { - case "SetMasterTimebase": - case "SetMasterClock": - // These APIs were introduced and deprecated in the same version - return true; - } - break; - } - case "GameKit.GKScore": { - switch (memberName) { - case "ReportLeaderboardScores": - case "ReportLeaderboardScoresAsync": - // Apple introduced and deprecated this method in the same OS version. - return true; - } - break; - } - case "Intents.INNoteContentTypeResolutionResult": { - switch (memberName) { - case "GetConfirmationRequired": - case "GetUnsupported": - // These are static members that have been re-implemented from the base class - the base class isn't deprecated, while INNoteContentTypeResolutionResult is. - return true; - } - break; - } - case "MobileCoreServices.UTType": { - switch (memberName) { - case "UniversalSceneDescriptionMobile": - case "get_UniversalSceneDescriptionMobile": - // Apple added new members to a deprecated enum - return true; - } - break; - } - case "SceneKit.SCNLayer": { - switch (memberName) { - case "CurrentViewport": - case "TemporalAntialiasingEnabled": - case "get_CurrentViewport": - case "get_TemporalAntialiasingEnabled": - case "set_TemporalAntialiasingEnabled": - case "get_UsesReverseZ": - case "set_UsesReverseZ": - case "UsesReverseZ": - // SCNLayer is deprecated in macOS 10.15, but these members are pulled in from the SCNSceneRenderer protocol (which is not deprecated) - return true; - } - break; - } - } - return false; - } - - static HashSet member_level = new HashSet (); - - void CheckDupes (MemberInfo m, Type t, ISet type_level) - { - member_level.Clear (); - foreach (var a in m.GetCustomAttributes (false)) { - var s = String.Empty; - if (a is AvailabilityBaseAttribute aa) - s = aa.ToString (); - if (s.Length > 0) { - if (type_level.Contains (s)) - AddErrorLine ($"[FAIL] Both '{t}' and '{m}' are marked with `{s}`."); - if (member_level.Contains (s)) - AddErrorLine ($"[FAIL] '{m}' is decorated more than once with `{s}`."); - else - member_level.Add (s); - } - } - } - - [Test] - public void Duplicates () - { - HashSet type_level = new HashSet (); - //LogProgress = true; - Errors = 0; - foreach (Type t in Assembly.GetTypes ()) { - if (LogProgress) - Console.WriteLine ($"T: {t}"); - - type_level.Clear (); - foreach (var a in t.GetCustomAttributes (false)) { - if (a is AvailabilityBaseAttribute aa) - type_level.Add (aa.ToString ()); - } - - foreach (var p in t.GetProperties (BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) { - if (LogProgress) - Console.WriteLine ($"P: {p}"); - CheckDupes (p, t, type_level); - } - - foreach (var m in t.GetMembers (BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) { - if (LogProgress) - Console.WriteLine ($"M: {m}"); - CheckDupes (m, t, type_level); - } - } - AssertIfErrors ("{0} API with members duplicating type-level attributes", Errors); - } - } -} - -#endif // !NET diff --git a/tests/introspection/ApiBaseTest.cs b/tests/introspection/ApiBaseTest.cs index 2c4f6cb25a72..11ba89523d89 100644 --- a/tests/introspection/ApiBaseTest.cs +++ b/tests/introspection/ApiBaseTest.cs @@ -37,6 +37,9 @@ using UIKit; #endif +// Disable until we get around to enable + fix any issues. +#nullable disable + namespace Introspection { public abstract class ApiBaseTest { @@ -104,8 +107,6 @@ protected StringBuilder ErrorData { protected TextWriter Writer { #if MONOMAC get { return Console.Out; } -#elif __WATCHOS__ - get { return Console.Out; } #else get { return AppDelegate.Runner.Writer; } #endif @@ -210,20 +211,12 @@ protected bool SkipDueToRejectedTypes (Type type) public bool MemberHasObsolete (MemberInfo member) { -#if NET return TestRuntime.HasOSPlatformAttributeForCurrentPlatform (member); -#else - return member.GetCustomAttribute () is not null; -#endif } public bool MemberHasUnsupported (MemberInfo member) { -#if NET return TestRuntime.HasOSPlatformAttributeForCurrentPlatform (member); -#else - return member.GetCustomAttribute () is not null; -#endif } public bool MemberHasEditorBrowsableNever (MemberInfo member) diff --git a/tests/introspection/ApiCMAttachmentTest.cs b/tests/introspection/ApiCMAttachmentTest.cs index 9df50aad38f4..b956c8c1148c 100644 --- a/tests/introspection/ApiCMAttachmentTest.cs +++ b/tests/introspection/ApiCMAttachmentTest.cs @@ -1,5 +1,3 @@ -#if !__WATCHOS__ - using System; using System.Drawing; using System.IO; @@ -15,11 +13,7 @@ using CoreFoundation; using CoreGraphics; using CoreText; -#if NET using CFNetwork; -#else -using CoreServices; -#endif using CoreVideo; using Foundation; using ImageIO; @@ -31,9 +25,10 @@ using UIKit; using Network; -#if NET using GColorConversionInfoTriple = CoreGraphics.CGColorConversionInfoTriple; -#endif + +// Disable until we get around to enable + fix any issues. +#nullable disable namespace Introspection { @@ -145,11 +140,7 @@ public AttachableNativeObject (INativeObject obj) nativeObj = obj; } -#if NET public NativeHandle Handle -#else - public IntPtr Handle -#endif { get { return nativeObj.Handle; } } @@ -419,11 +410,7 @@ protected INativeObject GetINativeInstance (Type t) return Runtime.GetINativeObject (array [0].LowlevelObjectForKey (SecImportExport.Identity.Handle), false); } case "SecTrust": -#if NET X509Certificate x = X509CertificateLoader.LoadCertificate (mail_google_com); -#else - X509Certificate x = new X509Certificate (mail_google_com); -#endif using (var policy = SecPolicy.CreateSslPolicy (true, "mail.google.com")) return new SecTrust (x, policy); case "SslContext": @@ -487,11 +474,7 @@ protected INativeObject GetINativeInstance (Type t) using (var cdata = NSData.FromArray (mail_google_com)) return new SecCertificate2 (new SecCertificate (cdata)); case "SecTrust2": -#if NET X509Certificate x2 = X509CertificateLoader.LoadCertificate (mail_google_com); -#else - X509Certificate x2 = new X509Certificate (mail_google_com); -#endif using (var policy = SecPolicy.CreateSslPolicy (true, "mail.google.com")) return new SecTrust2 (new SecTrust (x2, policy)); case "SecIdentity2": @@ -616,5 +599,3 @@ public void CheckFailAttachments () } } } - -#endif // !__WATCHOS__ diff --git a/tests/introspection/ApiClassPtrTest.cs b/tests/introspection/ApiClassPtrTest.cs index 3b7b2b4875c7..f1fabec05079 100644 --- a/tests/introspection/ApiClassPtrTest.cs +++ b/tests/introspection/ApiClassPtrTest.cs @@ -17,9 +17,8 @@ using Foundation; using ObjCRuntime; -#if !NET -using NativeHandle = System.IntPtr; -#endif +// Disable until we get around to enable + fix any issues. +#nullable disable namespace Introspection { diff --git a/tests/introspection/ApiCoreImageFiltersTest.cs b/tests/introspection/ApiCoreImageFiltersTest.cs index f09079b051a2..857d6d303bac 100644 --- a/tests/introspection/ApiCoreImageFiltersTest.cs +++ b/tests/introspection/ApiCoreImageFiltersTest.cs @@ -19,8 +19,6 @@ // limitations under the License. // -#if !__WATCHOS__ - using System; using System.Collections.Generic; using System.IO; @@ -36,6 +34,9 @@ using UIKit; #endif +// Disable until we get around to enable + fix any issues. +#nullable disable + namespace Introspection { [TestFixture] @@ -192,24 +193,14 @@ static void GenerateBinding (NSObject filter, TextWriter writer) var key = k.ToString (); if (key.StartsWith ("CIAttribute", StringComparison.Ordinal)) continue; -#if !NET - // CIFilter defines it for all filters - if (key == "inputImage") - continue; -#endif writer.WriteLine (); var dict = attributes [k] as NSDictionary; var type = dict [(NSString) "CIAttributeClass"]; writer.WriteLine ($"\t[CoreImageFilterProperty (\"{key}\")]"); -#if NET // by default we drop the "input" prefix, but keep the "output" prefix to avoid confusion, except for 'inputImage' if (key.StartsWith ("input", StringComparison.Ordinal) && key != "inputImage") -#else - // by default we drop the "input" prefix, but keep the "output" prefix to avoid confusion - if (key.StartsWith ("input", StringComparison.Ordinal)) -#endif key = Char.ToUpperInvariant (key [5]) + key.Substring (6); writer.WriteLine ("\t/* REMOVE-ME"); @@ -590,5 +581,3 @@ public void Keys () } } } - -#endif // !__WATCHOS__ diff --git a/tests/introspection/ApiCtorInitTest.cs b/tests/introspection/ApiCtorInitTest.cs index 740047b8d186..83b372d148f6 100644 --- a/tests/introspection/ApiCtorInitTest.cs +++ b/tests/introspection/ApiCtorInitTest.cs @@ -32,6 +32,9 @@ using Foundation; using ObjCRuntime; +// Disable until we get around to enable + fix any issues. +#nullable disable + namespace Introspection { public abstract class ApiCtorInitTest : ApiBaseTest { @@ -97,10 +100,6 @@ protected virtual bool Skip (Type type) case "NSUnitPressure": // -init should never be called on NSUnit! case "NSUnitSpeed": // -init should never be called on NSUnit! return true; -#if !NET // NSMenuView does not exist in .NET - case "NSMenuView": - return TestRuntime.IsVM; // skip on vms due to hadware problems -#endif // !NET case "MPSCnnNeuron": // Cannot directly initialize MPSCNNNeuron. Use one of the sub-classes of MPSCNNNeuron case "MPSCnnNeuronPReLU": case "MPSCnnNeuronHardSigmoid": @@ -132,11 +131,7 @@ protected virtual bool Skip (Type type) return TestRuntime.IsSimulator; #endif case "AVSpeechSynthesisVoice": // Calling description crashes the test -#if __WATCHOS__ - return TestRuntime.CheckXcodeVersion (12, 2); // CheckExactXcodeVersion is not implemented in watchOS yet but will be covered by iOS parrot below -#else return TestRuntime.CheckExactXcodeVersion (12, 2, beta: 3); -#endif case "SKView": // Causes a crash later. Filed as radar://18440271. // Apple said they won't fix this ('init' isn't a designated initializer) diff --git a/tests/introspection/ApiFieldTest.cs b/tests/introspection/ApiFieldTest.cs index 30fb311ef541..c20ffda42add 100644 --- a/tests/introspection/ApiFieldTest.cs +++ b/tests/introspection/ApiFieldTest.cs @@ -29,6 +29,9 @@ using Foundation; using ObjCRuntime; +// Disable until we get around to enable + fix any issues. +#nullable disable + namespace Introspection { [Preserve (AllMembers = true)] @@ -155,7 +158,7 @@ public void Notifications () var failed_fields = new List (); Errors = 0; - int c = 0, n = 0; + int n = 0; foreach (var p in AllProperties ()) { if (p.PropertyType.FullName != NSStringType) continue; diff --git a/tests/introspection/ApiFrameworkTest.cs b/tests/introspection/ApiFrameworkTest.cs index 96e0ef866bf7..cce1a26e547c 100644 --- a/tests/introspection/ApiFrameworkTest.cs +++ b/tests/introspection/ApiFrameworkTest.cs @@ -8,6 +8,8 @@ using Foundation; using ObjCRuntime; +// Disable until we get around to enable + fix any issues. +#nullable disable public class Application { public bool IsSimulatorBuild { @@ -53,29 +55,7 @@ public bool Skip (string @namespace) case "System": case "System.Drawing": return true; -#if __IOS__ -#if !NET - // Some CF* types that requires CFNetwork which we always link with - // ref: tools/common/CompilerFlags.cs - case "CoreServices": -#endif -#if !NET - case "WatchKit": // Apple removed WatchKit from iOS -#endif - return true; -#elif __TVOS__ && !NET - // mistakes (can't be fixed without breaking binary compatibility) - case "CoreSpotlight": - case "WebKit": - return true; -#elif __WATCHOS__ && !NET - // helpers (largely enums) for AVFoundation API - no p/invokes or obj-C API that requires native linking - case "AudioToolbox": - return true; - // mistakes (can't be fixed without breaking binary compatibility) - case "WebKit": - return true; -#elif __MACOS__ +#if __MACOS__ // always included, ref: tools/common/CompilerFlags.cs case "CFNetwork": return true; @@ -105,8 +85,6 @@ Frameworks GetFrameworks () return Frameworks.GetiOSFrameworks (app.IsSimulatorBuild); #elif __TVOS__ return Frameworks.TVOSFrameworks; -#elif __WATCHOS__ - return Frameworks.GetwatchOSFrameworks (app.IsSimulatorBuild); #elif __MACOS__ return Frameworks.MacFrameworks; #else @@ -151,66 +129,5 @@ public void NativeFrameworks () AssertIfErrors ($"{Errors} unknown frameworks found:\n{ErrorData}"); } -#if __IOS__ && !__MACCATALYST__ && !NET - [Test] - public void Simlauncher () - { - TestRuntime.AssertSimulator ("Only needed on simulator"); - - var all = GetFrameworks (); - - var namespaces = new HashSet (StringComparer.OrdinalIgnoreCase); - foreach (Type t in Assembly.GetTypes ()) { - if (!t.IsPublic) - continue; - namespaces.Add (t.Namespace); - } - - foreach (var line in File.ReadAllLines ("simlauncher64-sgen.frameworks")) { - var c = line.IndexOf (" (compatibility"); - if (c < 0) - continue; - var path = line.Substring (1, c - 1); - if (!path.StartsWith ("/System/Library/Frameworks/", StringComparison.Ordinal)) - continue; - var fx = Path.GetFileNameWithoutExtension (path); - - // match with mtouch framework list - if (!all.TryGetValue (fx, out var framework)) { - // special cases - switch (fx) { - case "CoreAudio": // AudioToolbox, AVFoundation... - case "CoreFoundation": // implied (always linked) - case "CFNetwork": // implied (StartWWAN) and included (mostly) in CoreServices - case "OpenAL": // part of OpenTK - break; - case "CoreMIDI": - // CoreMidi (case) in the fx list - break; - default: - ReportError ($"{fx} is not part of mtouch's GetFrameworks"); - break; - } - } - - // match with Xamarin.iOS.dll namespaces - if (!namespaces.Contains (fx)) { - // special cases - switch (fx) { - case "CoreAudio": // AudioToolbox, AVFoundation... - case "CFNetwork": // implied (StartWWAN) and included (mostly) in CoreServices - case "OpenAL": // part of OpenTK - break; - default: - ReportError ($"{fx} is not part of mtouch's GetFrameworks"); - break; - } - } - - } - - AssertIfErrors ($"{Errors} unknown frameworks found:\n{ErrorData}"); - } -#endif } } diff --git a/tests/introspection/ApiPInvokeTest.cs b/tests/introspection/ApiPInvokeTest.cs index e75f72d0e01e..27abbfabbe72 100644 --- a/tests/introspection/ApiPInvokeTest.cs +++ b/tests/introspection/ApiPInvokeTest.cs @@ -21,6 +21,9 @@ using ObjCRuntime; using Foundation; +// Disable until we get around to enable + fix any issues. +#nullable disable + namespace Introspection { [Preserve (AllMembers = true)] public abstract class ApiPInvokeTest : ApiBaseTest { @@ -210,7 +213,6 @@ protected void Check (Assembly a) // load from executable path = null; break; -#if NET case "libSystem.Globalization.Native": // load from executable (like __Internal above since it's part of the static library) path = null; @@ -234,7 +236,6 @@ protected void Check (Assembly a) path += ".dylib"; } break; -#endif case "libc": // we still have some rogue/not-fully-qualified DllImport path = "/usr/lib/libSystem.dylib"; @@ -392,15 +393,5 @@ public void SystemCore () if (!SkipAssembly (a)) Check (a); } - -#if !NET - [Test] - public void SystemData () - { - var a = typeof (System.Data.SqlClient.SqlCredential).Assembly; - if (!SkipAssembly (a)) - Check (a); - } -#endif } } diff --git a/tests/introspection/ApiProtocolTest.cs b/tests/introspection/ApiProtocolTest.cs index 7fa9cc29b317..9134923d90d3 100644 --- a/tests/introspection/ApiProtocolTest.cs +++ b/tests/introspection/ApiProtocolTest.cs @@ -52,12 +52,6 @@ protected virtual bool Skip (Type type) // *** NSForwarding: warning: object 0x5cbd078 of class 'JSExport' does not implement doesNotRecognizeSelector: -- abort case "JSExport": return true; -#if !NET - case "MTLCounter": - case "MTLCounterSampleBuffer": - case "MTLCounterSet": - return true; // Incorrectly bound, will be fixed for .NET. -#endif case "MPSImageLaplacianPyramid": case "MPSImageLaplacianPyramidSubtract": case "MPSImageLaplacianPyramidAdd": diff --git a/tests/introspection/ApiSelectorTest.cs b/tests/introspection/ApiSelectorTest.cs index 567ff8e224e6..c1b4f1cada57 100644 --- a/tests/introspection/ApiSelectorTest.cs +++ b/tests/introspection/ApiSelectorTest.cs @@ -26,9 +26,8 @@ using Foundation; using ObjCRuntime; -#if !NET -using NativeHandle = System.IntPtr; -#endif +// Disable until we get around to enable + fix any issues. +#nullable disable namespace Introspection { @@ -177,16 +176,6 @@ protected virtual bool Skip (Type type, string selectorName) return !TestRuntime.CheckXcodeVersion (9, 0); } break; -#if !NET - case "NSUrl": - case "ARQuickLookPreviewItem": - switch (selectorName) { - case "previewItemTitle": - // 'previewItemTitle' is inlined from the QLPreviewItem protocol and should be optional (fixed in .NET) - return true; - } - break; -#endif case "MKMapItem": // Selector not available on iOS 32-bit switch (selectorName) { case "encodeWithCoder:": @@ -402,7 +391,7 @@ protected virtual bool Skip (Type type, string selectorName) return true; } break; -#if (__WATCHOS__ || __MACOS__ || __MACCATALYST__) +#if __MACOS__ || __MACCATALYST__ case "AVPlayerItem": switch (selectorName) { // comes from AVPlayerItem+MPAdditions.h case "nowPlayingInfo": @@ -1023,7 +1012,6 @@ protected virtual bool Skip (Type type, string selectorName) case "willMoveToView:": case "view": return !TestRuntime.CheckXcodeVersion (15, 4); - break; } break; case "ASAuthorizationPublicKeyCredentialLargeBlobRegistrationOutput": @@ -1158,11 +1146,7 @@ protected virtual IntPtr GetClassForType (Type type) var fi = type.GetField ("class_ptr", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static); if (fi is null) return IntPtr.Zero; // e.g. *Delegate -#if NET return (NativeHandle) fi.GetValue (null); -#else - return (IntPtr) fi.GetValue (null); -#endif } [Test] diff --git a/tests/introspection/ApiSignatureTest.cs b/tests/introspection/ApiSignatureTest.cs index 0adc43b23378..a47c2b80c6dc 100644 --- a/tests/introspection/ApiSignatureTest.cs +++ b/tests/introspection/ApiSignatureTest.cs @@ -31,18 +31,13 @@ using Foundation; using ObjCRuntime; -#if !NET -using NativeHandle = System.IntPtr; -#endif +// Disable until we get around to enable + fix any issues. +#nullable disable namespace Introspection { public abstract class ApiSignatureTest : ApiBaseTest { -#if NET const string NFloatTypeName = "System.Runtime.InteropServices.NFloat"; -#else - const string NFloatTypeName = "System.nfloat"; -#endif [DllImport ("/usr/lib/libobjc.dylib")] // note: the returned string is not ours to free static extern IntPtr objc_getClass (string name); @@ -869,10 +864,8 @@ static bool IsDiscouraged (MemberInfo mi) } } -#if NET if (TestRuntime.HasOSPlatformAttributeForCurrentPlatform (mi)) return true; -#endif return false; } diff --git a/tests/introspection/ApiTypeTest.cs b/tests/introspection/ApiTypeTest.cs index 72f45c77fea9..d5ea37347795 100644 --- a/tests/introspection/ApiTypeTest.cs +++ b/tests/introspection/ApiTypeTest.cs @@ -9,6 +9,9 @@ using Foundation; using ObjCRuntime; +// Disable until we get around to enable + fix any issues. +#nullable disable + namespace Introspection { [TestFixture] @@ -19,7 +22,7 @@ public class ApiTypeTest : ApiBaseTest { bool Skip (Type type) { switch (type.Namespace) { -#if __IOS__ || __WATCHOS__ +#if __IOS__ // running the .cctor on the simulator works... but makes some other CoreNFC intro tests fail later // we'll still get the results from device tests case "CoreNFC": diff --git a/tests/introspection/ApiTypoTest.cs b/tests/introspection/ApiTypoTest.cs index a01bb4a8f06e..6681a40d074c 100644 --- a/tests/introspection/ApiTypoTest.cs +++ b/tests/introspection/ApiTypoTest.cs @@ -38,6 +38,9 @@ using Xamarin.Tests; using Xamarin.Utils; +// Disable until we get around to enable + fix any issues. +#nullable disable + namespace Introspection { public abstract class ApiTypoTest : ApiBaseTest { protected ApiTypoTest () @@ -729,27 +732,6 @@ public virtual bool Skip (MemberInfo methodName, string typo) "Wme", "Writeln", "Xattr", -#endif -#if !NET - "Actionfrom", - "Asal", // Typo, should be 'Basal', fixed in 'HKInsulinDeliveryReason' - "Attributefor", - "Attributest", - "Failwith", - "Imageimage", - "Libary", - "Musthold", - "Olus", // Typo, should be 'Bolus', fixed in 'HKInsulinDeliveryReason' - "Ostprandial", // Typo, should be 'Postprandial', fixed in 'HKBloodGlucoseMealTime' - "Pathpath", - "Rangefor", - "Reprandial", // Typo, should be 'Preprandial', fixed in 'HKBloodGlucoseMealTime' - "Failwith", - "Tearm", - "Theevent", - "Timestampe", // Existing binding so we can't just remove it. - "Toplevel", - "Tripple", #endif }; @@ -891,10 +873,6 @@ string GetMessage (object attribute) message = ((AdviceAttribute) attribute).Message; if (attribute is ObsoleteAttribute) message = ((ObsoleteAttribute) attribute).Message; -#if !NET - if (attribute is AvailabilityBaseAttribute) - message = ((AvailabilityBaseAttribute) attribute).Message; -#endif return message; } @@ -1038,8 +1016,6 @@ protected void AssertMatchingOSVersionAndSdkVersion () var sdk = new Version (Constants.SdkVersion); #if MONOMAC if (!NSProcessInfo.ProcessInfo.IsOperatingSystemAtLeastVersion (new NSOperatingSystemVersion (sdk.Major, sdk.Minor, sdk.Build == -1 ? 0 : sdk.Build))) -#elif __WATCHOS__ - if (!WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (sdk.Major, sdk.Minor)) #else if (!UIDevice.CurrentDevice.CheckSystemVersion (sdk.Major, sdk.Minor)) #endif @@ -1068,15 +1044,6 @@ public void ConstantsCheck () case "AssetsLibraryLibrary": case "NewsstandKitLibrary": // Removed from iOS, but we have to keep the constant around for binary compatibility. break; -#endif -#if !NET -#if __TVOS__ - case "PassKitLibrary": // not part of tvOS - break; -#endif - case "libcompression": // bad (missing) suffix - Assert.True (CheckLibrary (s), fi.Name); - break; #endif case "ChipLibrary": // Chip is removed entirely beginning Xcode 14 if (!TestRuntime.CheckXcodeVersion (14, 0)) @@ -1131,11 +1098,6 @@ public void ConstantsCheck () // Only available in macOS 10.15.4+ if (fi.Name == "AutomaticAssessmentConfigurationLibrary" && !TestRuntime.CheckXcodeVersion (11, 4)) continue; -#endif -#if __WATCHOS__ - // added with watchOS 4 (mistake) - if (fi.Name == "VisionLibrary") - continue; #endif Assert.True (CheckLibrary (s), fi.Name); } else { diff --git a/tests/introspection/ApiWeakPropertyTest.cs b/tests/introspection/ApiWeakPropertyTest.cs index f96d70abe71f..b35cc9ff3484 100644 --- a/tests/introspection/ApiWeakPropertyTest.cs +++ b/tests/introspection/ApiWeakPropertyTest.cs @@ -8,6 +8,9 @@ using Foundation; using ObjCRuntime; +// Disable until we get around to enable + fix any issues. +#nullable disable + namespace Introspection { [Preserve (AllMembers = true)] public abstract class ApiWeakPropertyTest : ApiBaseTest { diff --git a/tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/Contents.json b/tests/introspection/Assets.xcassets/AppIcons.appiconset/Contents.json similarity index 93% rename from tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/Contents.json rename to tests/introspection/Assets.xcassets/AppIcons.appiconset/Contents.json index 6be52c8f7640..284e15f9906c 100644 --- a/tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/Contents.json +++ b/tests/introspection/Assets.xcassets/AppIcons.appiconset/Contents.json @@ -43,12 +43,6 @@ "scale": "2x", "idiom": "iphone" }, - { - "filename": "icon-app-60@3x.png", - "size": "60x60", - "scale": "3x", - "idiom": "iphone" - }, { "size": "29x29", "scale": "1x", @@ -142,13 +136,6 @@ "scale": "2x", "idiom": "watch" }, - { - "role": "longLook", - "size": "44x44", - "subtype": "42mm", - "scale": "2x", - "idiom": "watch" - }, { "role": "quickLook", "size": "86x86", diff --git a/tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/icon-app-57.png b/tests/introspection/Assets.xcassets/AppIcons.appiconset/icon-app-57.png similarity index 100% rename from tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/icon-app-57.png rename to tests/introspection/Assets.xcassets/AppIcons.appiconset/icon-app-57.png diff --git a/tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/icon-app-57@2x.png b/tests/introspection/Assets.xcassets/AppIcons.appiconset/icon-app-57@2x.png similarity index 100% rename from tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/icon-app-57@2x.png rename to tests/introspection/Assets.xcassets/AppIcons.appiconset/icon-app-57@2x.png diff --git a/tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/icon-app-60@2x.png b/tests/introspection/Assets.xcassets/AppIcons.appiconset/icon-app-60@2x.png similarity index 100% rename from tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/icon-app-60@2x.png rename to tests/introspection/Assets.xcassets/AppIcons.appiconset/icon-app-60@2x.png diff --git a/tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/icon-app-72.png b/tests/introspection/Assets.xcassets/AppIcons.appiconset/icon-app-72.png similarity index 100% rename from tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/icon-app-72.png rename to tests/introspection/Assets.xcassets/AppIcons.appiconset/icon-app-72.png diff --git a/tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/icon-app-72@2x.png b/tests/introspection/Assets.xcassets/AppIcons.appiconset/icon-app-72@2x.png similarity index 100% rename from tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/icon-app-72@2x.png rename to tests/introspection/Assets.xcassets/AppIcons.appiconset/icon-app-72@2x.png diff --git a/tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/icon-app-76.png b/tests/introspection/Assets.xcassets/AppIcons.appiconset/icon-app-76.png similarity index 100% rename from tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/icon-app-76.png rename to tests/introspection/Assets.xcassets/AppIcons.appiconset/icon-app-76.png diff --git a/tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/icon-app-76@2x.png b/tests/introspection/Assets.xcassets/AppIcons.appiconset/icon-app-76@2x.png similarity index 100% rename from tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/icon-app-76@2x.png rename to tests/introspection/Assets.xcassets/AppIcons.appiconset/icon-app-76@2x.png diff --git a/tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/icon-app-83.5@2x.png b/tests/introspection/Assets.xcassets/AppIcons.appiconset/icon-app-83.5@2x.png similarity index 100% rename from tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/icon-app-83.5@2x.png rename to tests/introspection/Assets.xcassets/AppIcons.appiconset/icon-app-83.5@2x.png diff --git a/tests/introspection/CoreSelectorTest.cs b/tests/introspection/CoreSelectorTest.cs index 4bfd62aa7a99..1e2902e73e5f 100644 --- a/tests/introspection/CoreSelectorTest.cs +++ b/tests/introspection/CoreSelectorTest.cs @@ -14,6 +14,9 @@ using Foundation; using ObjCRuntime; +// Disable until we get around to enable + fix any issues. +#nullable disable + namespace Introspection { public abstract class CoreSelectorTest : ApiSelectorTest { diff --git a/tests/introspection/iOS/Entitlements.plist b/tests/introspection/Entitlements.plist similarity index 100% rename from tests/introspection/iOS/Entitlements.plist rename to tests/introspection/Entitlements.plist diff --git a/tests/introspection/iOS/Info.plist b/tests/introspection/Info.plist similarity index 100% rename from tests/introspection/iOS/Info.plist rename to tests/introspection/Info.plist diff --git a/tests/introspection/iOS/LaunchScreen.storyboard b/tests/introspection/LaunchScreen.storyboard similarity index 100% rename from tests/introspection/iOS/LaunchScreen.storyboard rename to tests/introspection/LaunchScreen.storyboard diff --git a/tests/introspection/Mac/Info.plist b/tests/introspection/Mac/Info.plist deleted file mode 100644 index e8fbeb80a54d..000000000000 --- a/tests/introspection/Mac/Info.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CFBundleDisplayName - apitest - CFBundleIdentifier - com.xamarin.introspection - CFBundleVersion - 1 - CFBundleDevelopmentRegion - en - LSMinimumSystemVersion - 12.0 - NSPrincipalClass - NSApplication - LSApplicationCategoryType - public.app-category.developer-tools - CFBundleName - introspection - LSUIElement - 1 - NSAppleMusicUsageDescription - Testing tastes - NSCameraUsageDescription - Smile! - NSContactsUsageDescription - Testing friends - NSHomeKitUsageDescription - Testing roofs - NSMicrophoneUsageDescription - Testing mike - NSPhotoLibraryUsageDescription - Testing lens - - diff --git a/tests/introspection/Mac/MacApiPInvokeTest.cs b/tests/introspection/Mac/MacApiPInvokeTest.cs deleted file mode 100644 index 3fc2317200c9..000000000000 --- a/tests/introspection/Mac/MacApiPInvokeTest.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Linq; -using System.Reflection; - -using NUnit.Framework; -using Xamarin.Tests; - -namespace Introspection { - - [TestFixture] - public class MacApiPInvokeTest : ApiPInvokeTest { - protected override bool SkipLibrary (string libraryName) - { - switch (libraryName) { - case "/System/Library/Frameworks/OpenGL.framework/OpenGL": - return true; - } - return base.SkipLibrary (libraryName); - } - - static bool IsUnified { - get { - return AppDomain.CurrentDomain.GetAssemblies ().Any (x => x.FullName.Contains ("Xamarin.Mac")); - } - } - - protected override bool Skip (Type type) - { - string typeName = type.ToString (); - bool is32Bit = IntPtr.Size == 4; - if (is32Bit && typeName.StartsWith ("MapKit", StringComparison.Ordinal)) // MapKit is 64-bit only - return true; - - switch (type.Namespace) { - case "SceneKit": - case "MonoMac.SceneKit": - if (is32Bit) - return true; - break; - } - - switch (typeName) { - case "MonoMac.GameController.GCExtendedGamepadSnapshot": // These next 4 are in the compat API, even if they don't work. - case "MonoMac.GameController.GCGamepadSnapshot": - case "MonoMac.GameController.GCExtendedGamepadSnapShotDataV100": - case "MonoMac.GameController.GCGamepadSnapShotDataV100": - return !IsUnified; - case "GameController.GCGamepadSnapShotDataV100": // These are 64-bit only - case "GameController.GCExtendedGamepadSnapShotDataV100": - return is32Bit; - case "MonoMac.AudioToolbox.AudioSession": // These are iOS APIs that were mistakenly pulled into OSX. Removed in unified but not classic - case "MonoMac.AudioUnit.AudioUnitUtils": - return !IsUnified; // If these are in unified, don't skip, we want to scream - } - - return base.Skip (type); - } - - protected override bool Skip (string symbolName) - { - switch (symbolName) { - case "SKTerminateForInvalidReceipt": // Only there for API compat - return !IsUnified; - } - return base.Skip (symbolName); - } - - protected override bool SkipAssembly (Assembly a) - { - // too many things are missing from XM 32bits bindings - // and the BCL is identical for 64 bits (no need to test it 3 times) - // return IntPtr.Size == 4; - return true; // skip everything until fixed - } - } -} diff --git a/tests/introspection/Mac/introspection-mac.csproj b/tests/introspection/Mac/introspection-mac.csproj deleted file mode 100644 index 1909259c4a0e..000000000000 --- a/tests/introspection/Mac/introspection-mac.csproj +++ /dev/null @@ -1,159 +0,0 @@ - - - - Debug - x86 - {E0E84B58-C333-1BF3-D1EC-42EE3EA0D071} - {A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Exe - introspection - introspection - Resources - v2.0 - obj\$(Platform)\$(Configuration) - Xamarin.Mac - x86_64 - - PackageReference - latest - true - - - true - full - false - bin\x86\Debug - DEBUG;MONOMAC;$(DefineConstants) - prompt - 0 - true - Mac Developer - false - false - false - false - x86 - 3rd Party Mac Developer Installer - - - true - bin\x86\Release - MONOMAC;$(DefineConstants) - prompt - 0 - true - Developer ID Application - true - false - true - false - SdkOnly - x86 - - - - - - - - - - - - - - - - - - - - - ApiBaseTest.cs - - - ApiClassPtrTest.cs - - - ApiCoreImageFiltersTest.cs - - - ApiCtorInitTest.cs - - - ApiFieldTest.cs - - - ApiPInvokeTest.cs - - - ApiProtocolTest.cs - - - ApiSelectorTest.cs - - - ApiSignatureTest.cs - - - ApiStructTest.cs - - - ApiTypoTest.cs - - - ApiWeakPropertyTest.cs - - - CoreSelectorTest.cs - - - EnvironmentVariable.cs - - - PlatformInfo.cs - - - MacMain.cs - - - Mac.cs - - - TestRuntime.cs - - - - ApiAvailabilityTest.cs - - - ApplePlatform.cs - - - Frameworks.cs - - - SdkVersions.cs - - - TestAssemblyLoader.cs - - - ApiFrameworkTest.cs - - - ApiTypeTest.cs - - - - - {88A8A1AC-0829-4C98-8F4A-9FC23DC42A06} - Touch.Client-macOS-mobile - - - - - - - - diff --git a/tests/introspection/Mac/MacApiCtorInitTest.cs b/tests/introspection/MacApiCtorInitTest.cs similarity index 99% rename from tests/introspection/Mac/MacApiCtorInitTest.cs rename to tests/introspection/MacApiCtorInitTest.cs index df2091b7d583..98cdb0fde6ac 100644 --- a/tests/introspection/Mac/MacApiCtorInitTest.cs +++ b/tests/introspection/MacApiCtorInitTest.cs @@ -36,11 +36,6 @@ protected override bool Skip (Attribute attr) protected override bool Skip (Type type) { switch (type.FullName) { -#if !NET - case "AppKit.NSDraggingInfo": - case "MonoMac.AppKit.NSDraggingInfo": // binding mistakes. - return true; -#endif // Random failures on build machine case "QuickLookUI.QLPreviewPanel": case "MonoMac.QuickLookUI.QLPreviewPanel": diff --git a/tests/introspection/Mac/MacApiFieldTest.cs b/tests/introspection/MacApiFieldTest.cs similarity index 92% rename from tests/introspection/Mac/MacApiFieldTest.cs rename to tests/introspection/MacApiFieldTest.cs index 62d57aa1503f..b39405b1e4d2 100644 --- a/tests/introspection/Mac/MacApiFieldTest.cs +++ b/tests/introspection/MacApiFieldTest.cs @@ -175,27 +175,6 @@ protected override bool Skip (string constantName, string libraryName) } } - protected override bool SkipNotification (Type declaredType, string notificationName) - { - switch (declaredType.Name) { -#if !NET - case "NSWorkspaceAccessibilityNotifications": - case "NSAccessibilityNotifications": - return true; - case "AVFragmentedMovieTrack": - switch (notificationName) { - case "AVFragmentedMovieTrackTotalSampleDataLengthDidChangeNotification": - case "AVFragmentedMovieTrackTimeRangeDidChangeNotification": - return true; - } - break; - case "NSTask": - return notificationName == "NSTaskDidTerminateNotification"; -#endif - } - return base.SkipNotification (declaredType, notificationName); - } - protected override string FindLibrary (string libraryName, bool requiresFullPath = false) { switch (libraryName) { diff --git a/tests/introspection/MacApiPInvokeTest.cs b/tests/introspection/MacApiPInvokeTest.cs new file mode 100644 index 000000000000..f98ae958fefe --- /dev/null +++ b/tests/introspection/MacApiPInvokeTest.cs @@ -0,0 +1,29 @@ +using System; +using System.Linq; +using System.Reflection; + +using NUnit.Framework; +using Xamarin.Tests; + +namespace Introspection { + + [TestFixture] + public class MacApiPInvokeTest : ApiPInvokeTest { + protected override bool SkipLibrary (string libraryName) + { + switch (libraryName) { + case "/System/Library/Frameworks/OpenGL.framework/OpenGL": + return true; + } + return base.SkipLibrary (libraryName); + } + + protected override bool SkipAssembly (Assembly a) + { + // too many things are missing from XM 32bits bindings + // and the BCL is identical for 64 bits (no need to test it 3 times) + // return IntPtr.Size == 4; + return true; // skip everything until fixed + } + } +} diff --git a/tests/introspection/Mac/MacApiProtocolTest.cs b/tests/introspection/MacApiProtocolTest.cs similarity index 95% rename from tests/introspection/Mac/MacApiProtocolTest.cs rename to tests/introspection/MacApiProtocolTest.cs index ac357c8534f0..271bc6f55860 100644 --- a/tests/introspection/Mac/MacApiProtocolTest.cs +++ b/tests/introspection/MacApiProtocolTest.cs @@ -23,20 +23,7 @@ public class MacApiProtocolTest : ApiProtocolTest { protected override bool Skip (Type type) { -#if !NET - switch (type.Namespace) { - case "Chip": - // The Chip framework is not stable, it's been added and removed and added and removed a few times already, so just skip verifying the entire framework. - // This is legacy Xamarin only, because we removed the framework for .NET. - return true; - } -#endif - switch (type.Name) { -#if !NET - case "NSDraggingInfo": - return true; // Incorrectly bound (BaseType on protocol), will be fixed for .NET. -#endif // special cases wrt sandboxing case "NSRemoteOpenPanel": case "NSRemoteSavePanel": @@ -45,10 +32,6 @@ protected override bool Skip (Type type) case "AVCaptureSynchronizedData": case "CXProvider": return TestRuntime.IsVM; // skip only on vms -#if !NET // NSMenuView does not exist in .NET - case "NSMenuView": // not longer supported - return true; -#endif // !NET case "ASAuthorizationProviderExtensionRegistrationHandler": return true; default: @@ -346,10 +329,6 @@ protected override bool Skip (Type type, string protocolName) if (type.Name == "NSTextView") return true; break; -#if !NET - case "NSDraggingInfo": - return true; // We have to keep the type to maintain backwards compatibility. -#endif case "NSAccessibility": case "NSAccessibilityElement": switch (type.Name) { diff --git a/tests/introspection/Mac/MacApiSelectorTest.cs b/tests/introspection/MacApiSelectorTest.cs similarity index 95% rename from tests/introspection/Mac/MacApiSelectorTest.cs rename to tests/introspection/MacApiSelectorTest.cs index 8344a3c4f39e..779550959ba9 100644 --- a/tests/introspection/Mac/MacApiSelectorTest.cs +++ b/tests/introspection/MacApiSelectorTest.cs @@ -117,12 +117,6 @@ protected override bool Skip (Type type) if (Mac.CheckSystemVersion (10, 15)) return true; break; -#if !NET - case "Chip": - // The Chip framework is not stable, it's been added and removed and added and removed a few times already, so just skip verifying the entire framework. - // This is legacy Xamarin only, because we removed the framework for .NET. - return true; -#endif } return base.Skip (type); @@ -154,10 +148,6 @@ protected override bool Skip (Type type, string selectorName) // The header declares this on an NSObject category but // it doesn't even respondsToSelector on NSView/NSCell... return true; -#if !NET - case "xamarinselector:removed:": - return true; -#endif case "readInBackgroundAndNotifyForModes:": case "readInBackgroundAndNotify": case "readToEndOfFileInBackgroundAndNotifyForModes:": @@ -427,47 +417,6 @@ protected override bool Skip (Type type, string selectorName) return true; } break; -#if !NET // NSMenuView does not exist in .NET - case "NSMenuView": - switch (selectorName) { - case "menuBarHeight": - return TestRuntime.IsVM; // skip on vms due to hadware problems - } - break; -#endif // !NET -#if !NET // These should be not be marked [Abstract] but can't fix w/o breaking change... - case "NSScrollView": - case "NSTextView": - switch (selectorName) { - case "contentViewAtIndex:effectiveCharacterRange:": - case "didReplaceCharacters": - case "drawCharactersInRange:forContentView:": - case "rectsForCharacterRange:": - case "replaceCharactersInRange:withString:": - case "scrollRangeToVisible:": - case "shouldReplaceCharactersInRanges:withStrings:": - case "stringAtIndex:effectiveRange:endsWithSearchBoundary:": - case "stringLength": - case "allowsMultipleSelection": - case "isEditable": - case "firstSelectedRange": - case "isSelectable": - case "selectedRanges": - case "setSelectedRanges:": - case "string": - case "visibleCharacterRanges": - return true; - } - break; -#endif - case "NSMenuDelegate": - switch (selectorName) { -#if !NET - case "menu:willHighlightItem:": - return true; // bound -#endif - } - break; case "NSResponder": switch (selectorName) { case "smartMagnifyWithEvent:": @@ -633,14 +582,6 @@ protected override bool Skip (Type type, string selectorName) if (selectorName == "encodeWithCoder:" && !Mac.CheckSystemVersion (10, 8)) return true; break; - case "PdfView": - switch (selectorName) { -#if !NET - case "menu:willHighlightItem:": - return true; -#endif - } - break; } break; case "MonoMac.SceneKit": @@ -749,7 +690,6 @@ protected override bool Skip (Type type, string selectorName) return true; } break; - break; } break; case "Metal": @@ -1082,7 +1022,7 @@ protected override void Dispose (NSObject obj, Type type) protected override bool CheckResponse (bool value, Type actualType, MethodBase method, ref string name) { - var declaredType = method.DeclaringType; + var declaredType = method.DeclaringType!; switch (name) { // NSDraggingDestination protocol diff --git a/tests/introspection/Mac/MacApiSignatureTest.cs b/tests/introspection/MacApiSignatureTest.cs similarity index 96% rename from tests/introspection/Mac/MacApiSignatureTest.cs rename to tests/introspection/MacApiSignatureTest.cs index d6a00963887d..88c9db01e086 100644 --- a/tests/introspection/Mac/MacApiSignatureTest.cs +++ b/tests/introspection/MacApiSignatureTest.cs @@ -242,19 +242,6 @@ protected override bool Check (char encodedType, Type type) return base.Check (encodedType, type); } -#if !NET - protected override bool CheckType (Type t, ref int n) - { - switch (t.Name) { - case "NSPasteboardReading": - case "NSPasteboardWriting": - return true; - } - - return base.CheckType (t, ref n); - } -#endif - protected override void CheckManagedMemberSignatures (MethodBase m, Type t, ref int n) { #if !XAMCORE_5_0 // let's review the tests exceptions if we break things @@ -265,13 +252,6 @@ protected override void CheckManagedMemberSignatures (MethodBase m, Type t, ref if (t.Name == "NSTableView") return; break; -#if !NET - case "AddEventListener": - // Fixed in NET - if (t.Name == "DomNode") - return; - break; -#endif // !NET } #endif // XAMCORE_5_0 base.CheckManagedMemberSignatures (m, t, ref n); diff --git a/tests/introspection/Mac/MacApiTypoTest.cs b/tests/introspection/MacApiTypoTest.cs similarity index 65% rename from tests/introspection/Mac/MacApiTypoTest.cs rename to tests/introspection/MacApiTypoTest.cs index 9739b1d3ff08..18358f71590b 100644 --- a/tests/introspection/Mac/MacApiTypoTest.cs +++ b/tests/introspection/MacApiTypoTest.cs @@ -9,7 +9,7 @@ namespace Introspection { [TestFixture] public class MacApiTypoTest : ApiTypoTest { - NSSpellChecker checker; + NSSpellChecker? checker; public override void TypoTest () { @@ -23,20 +23,10 @@ public override string GetTypo (string txt) { var checkRange = new NSRange (0, txt.Length); nint wordCount; - var typoRange = checker.CheckSpelling (txt, 0, "en_US", false, 0, out wordCount); + var typoRange = checker!.CheckSpelling (txt, 0, "en_US", false, 0, out wordCount); if (typoRange.Length == 0) return String.Empty; return txt.Substring ((int) typoRange.Location, (int) typoRange.Length); } - -#if !NET - public override bool Skip (Type baseType, string typo) - { - if (baseType == typeof (NSSpellCheckerCanidates)) - return true; - - return base.Skip (baseType, typo); - } -#endif } } diff --git a/tests/introspection/Mac/MacApiWeakPropertyTest.cs b/tests/introspection/MacApiWeakPropertyTest.cs similarity index 100% rename from tests/introspection/Mac/MacApiWeakPropertyTest.cs rename to tests/introspection/MacApiWeakPropertyTest.cs diff --git a/tests/introspection/Mac/MacCoreImageFiltersTest.cs b/tests/introspection/MacCoreImageFiltersTest.cs similarity index 100% rename from tests/introspection/Mac/MacCoreImageFiltersTest.cs rename to tests/introspection/MacCoreImageFiltersTest.cs diff --git a/tests/introspection/README.md b/tests/introspection/README.md index e53dab14a935..3208484b3653 100644 --- a/tests/introspection/README.md +++ b/tests/introspection/README.md @@ -1,11 +1,11 @@ # Introspection Tests -Introspection tests are executed on target (both simulator and device for -iOS) or a specific version of OSX. The application proceed to analyze itself -using: +Introspection tests are executed on specific target (both simulator and device +for iOS and tvOS) or a specific version of macOS or Mac Catalyst. The +application proceed to analyze itself using: * `System.Reflection` for managed code; and -* the ObjectiveC runtime library for native code +* the Objective-C runtime library for native code and compare the results. E.g. if using .NET reflection it can see a binding for a `NSBundle` type then it should be able to find a native `NSBundle` @@ -13,7 +13,7 @@ type using the ObjC runtime functions. Otherwise an error is raised... Since the application analyze itself it must contains everything we wish to test. That's why the introspection tests needs to be built with the -managed linker disable, i.e. **"Don't link"**. +managed linker disabled, i.e. **"Don't link"**. Pros diff --git a/tests/introspection/dotnet/shared.csproj b/tests/introspection/dotnet/shared.csproj index a20624fe5b36..66feb03fde64 100644 --- a/tests/introspection/dotnet/shared.csproj +++ b/tests/introspection/dotnet/shared.csproj @@ -15,20 +15,29 @@ true $(DefineConstants);DEBUG + + enable + + + $(NoWarn);CA1422 + + + true + Nullable - - - - - - - - - + + + + + + + + + MacMain.cs @@ -39,33 +48,33 @@ - - - - - - - - - - + + + + + + + + + + ApiCMAttachmentTest.cs - + - - - - - - - - - - + + + + + + + + + + @@ -117,9 +126,6 @@ TestRuntime.cs - - ApiAvailabilityTest.cs - Frameworks.cs diff --git a/tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/Icon-app-60@3x.png b/tests/introspection/iOS/Assets.xcassets/AppIcons.appiconset/Icon-app-60@3x.png deleted file mode 100644 index 45342a7513b6260dcd80e17e56cc1f24c60053c6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5100 zcmds5_ct4S7q@D(HZ@|_E>$6F1eF*KDrl=}JVqWX_J|dG3pF02L`iI|nnkrdXlu4q z?2$@TjmA!m+S=Fq{u%ENcbt39_k7N|_jB(3-kWM+24lMlxJpAq!)9z`@bJ>M{#Te8 zFSX7HqspbBMLmS+(KHZ**J)^Ys*MexmSMEpI2QlMtJeodBUo4xo20jH+=y*f@+{1p z@~E$GtC$SgnzAjlonr4@1cDz1Tyaq-#TXihl-*8H z_tC@&x!$JH>0P0lqblYH{Bs3w)&@`3bR<)dvz!6w?gG5Xd@6ly17y-lf3s z3;!#$ZtL7e#%1q$@ltDBve{H3YC)Ul>g145KLhLx%2`vkd38qt68awF7aNU-f!Jr% zQ@z~`60Tc_)p?auLd8-;(%y|m(FPgn^VH8rZJi^NHIxP{m>-0b@y-lF$IwXHgNpg9 zH65B;wQD3grShO)IY@1rsPBo+>@p|4_xun1|%VYo!F{jsoVG94Oo^o?5 zH`7Vgnyac;ySe4KR)5@#Yrh>?`b|k2S~R>FNt{BO%O%UdfB8~&&Y&4{1>ncVdxB zo-m`2)}VM^S#<5o947@23HCK<$Ng&zB^;ABPyjj*AwZ4UOWrl0y$FE{`qXIG!`T$d zPc-mOP1n6;jQeP!Iy4QkegbhJ3?sXJzy(R|bf$S@E@g;rR|_^%Em;*jFU|wclFUGa zhr_ZnYDrPAm`h*J1z+5a4%&E`?DKW(!1{e-o|8U{1Rc`!Z%RIjG_Lu@Z%hvkSB~*F zQ;}*`1F{??$VEMmZ!M;D8gY)kP@W4cf4*?DA-%5R>EMkU4%Vj!p|G*hy=G^={VhDV zZQBL1C*{iPvEbbm;nNFjnKG4bti7veYNRGcdu#ni8=_6_taY`+IU9xKz2~l}yB^OgZfH z{VdO6F!P64s*VHglwB=gEhC|7mv6diHiB=hquMPzNXxuA;6ve08Zd0QT`^Ni)k>w> z&-^*Q1kU1Nj=E518TN+!XT9bLi^AI@vX*xyMES4O4!G5AemZb8SGj z1;6$^^?gfltV3D)0B{vulCYG@;S@5)gBVp$wPR(x@N^Yti;>QFM04jvLnXi_f38B>#unz&J}aZ`>erRy{Ma~{M4WeTtkPm_EA7}r$SF#-*) zVlClb-HPS8aDq;mt$Y$2fc|D{u@=UGca-+RaQ)`#*|_{5;x1J?WUV^E)zV_5oqCG_ zy}VPR`XyT~1JQ9NOA%Zx@9pvdhe>poby#=2X1l9l1utUL`usZ0z}?A6eM(R~`oezkGb|$@F?=oOdvV!`~$<=a??AR=?c@Xy3k_s=zn^E4LJ zI^W9KLzEU-e@U>^>mAR*oSA5xlfJC2t;EzrhiQaLnzFQ3ZnS1y$#^?INsB%z%FIzu z&?-K{X6Pct;BJ}iH~I~KSW%_Q$U_ryuL`%bSX(8vv%NNBdyEBn?*z^tInqD4=82GWd5QkI~4{v`S z#-jFQ6|R#dWBqwi)I)W%Jnj&TVLiA-X!C1MV%S048NFdV!1F4jf%Vq_y(@!Q7*w0~ zpqU{wzFhMv*Ht9|UbR?B+x;8}m{UaZR&n8&_NJONc>*gQfBUg7i|&4#tCaJVS9F9GNy(2i@`;7T(s4HG@Z2^t4* z1T01Acx!-*-b1gk6?;i4v>sKpBVeWUS_5^Bev147l^>vFFa7hQiWvt&WwxqzhwE1d z0Qu$d-0;3a$3!+41!&|aR#REOIy3w`pz(F`E)A%BU%y~QXgvx1$LfoRUiJW_iH=;^JUx8T0qfS0RG9x{4Khc)_QJ2pL1v`;*c#?l>7`;KpIFswn(H8&zBj~;pJEQZ=-b4WPRcE0`0 z5!=dVK(WMcb}mkw&xpY;bT2;h}XnK?tpvhw?WNdz1S#%P=)d!d_?-RPNbS>zJw&jW% zG*RA@dA#M{FU_F@T;BbtN18;9uOsJ^>e8ktG+j=r)Arv131`hOdKgDOTH2mIj!Oj? z>kbA(DtHczJ%S4^8G)vQbGWG8Att^EeaqY7MdFmmY+GYqxZ^AL9i#vynzy5KC6iAl zdEVT^xhUA2pE6B;O1A{`>w?0Z(L5hzV0TF8 z_w0RnN&MY&N>q>?IoDL=uYv)m`$521>L zcMk^|_-4GGUTZ1nxUI)OEA6)jcaMW6UR@4ux~xuZ@}cB8_LB;pn!y&`DGu8p7pRhj z^7rFIok@}of)U@}1h8J$Mtur~a13KEzRt1b_hSsDLI***J=kj zERw4;iz77SGhLMZKu0~kj3hno?ET(ylZX_-HHEVyRa-T;#>L~&5Rowp4_YN-lkb`w zzB~pplO)0EPWHx&nLy0M+(Wj(y1vhspuztItxSB5EJN(*Xt`a#q!b1&)FfEbYvGoMRqsw-tcK)UyO2KeL7UpFw&pVvu(@ zdf1X%aRt)~$bjdIYB3X+e8Sic$33^yOw zkCO*?2cA||;c-kK?`?T{tTPn;AbhCxsspYYaaO&iW29h>>iX$qX0^~}!;!ql1N9TH zr|kpZVwsdX+}}1(#rFz^R6_^wL*Rwu7KuY`*5uRr@~b`VR@_er9JM_@!h;3jL2l~H zCvs|OAqSRE=rh_muAxO4B=n!K2z$te4oIGJOMk(=x1QMB5Vq4OGI9@$#^!lZgpZxR z=Y7Ao|6nU`^Ps(f5is=I$;h$8%|CC|)Xc7;Vov~hnODa>QR!-hsqyXslZ`)lwp74a zO|h8B`o!nav6y$^PBQi$8e&zs(;9(=n{mnc*TB|<70e-Dk~nz&GwyYK%ldrbX&UN@ zK!eQN-2GlXMY|LP{VgFo`C*H$$`_HhE1P$*+oTo)wIy;rc34+lL57+Lbr!I^ z=)8Hd%*k!jz-W!Ki2H&~P&E$Z7o1C*cin17!}+#gDG0qjL0%qd=I-~h(BK{?UZ%FT z*k;`+>d{tqhManmTvSs-s>7j`3AN5G5sH>ic~iJO~1(xa2r+U(W9p<~JD1HOW9JlSQNd z@{Ou#;+nC$9UTA3Zict?*S~2QQyX%Wl<}lw**Dr{d;u^{wWFM{t4IMpu8oeeDDI=? zr2m0U6NL@~e2D|MsH801;PQ2VQ8_W>V$FkJ>>hleVS# z)s=ZAa&aWVtbM5p+Y~EzNt4+<&%nu*rFv8}cFirE-TNOt-|7=l!D_F@0@*micA*() zTZZ4S5zQ1+ant#^7X8_ASK!OeWfmimJf8zD{R?^bbg*|5{p?Ax7;9-o&+5oZ2+F}N z6!sKug}^fa2HKtVG6Mnwc$_6vGM3PimyN{AMu zI3dD=t_5dZe)kAQ@UjR^gob*xh_a3YwYMcFAGR*?7RK0HnsZ8bqheg6D}NO#YUAs#IFZlPPH# za7nEQq#~1oHX1YWA1$63-)O}S(t=Jo1gh_UdL-+%O%P>mQrV5^!ga~cSCQM%VqK58 z9peWvkJ^cd=|o!ZW8+o>65W`;xpH6X8C2xGz{Jy;D8Hce=bZsY3}e#4YzMtD-m-YW z$_aC>xA)KfbwY2Dn4=aE8PV?Yt%Q8aE#|qk@IaO@csHg6wy$7I)%6CKMMV~fgGamP zyc_$DJxvJH60ylOz7*21{^XZKX46a$vg5UKl$mX;Z^o4cx(D^(tw>Qxo*JOO(l|u_qao>pv)7mx4kbC zWj%oRwlKH-b9*T+nV$MR#JMrArRdZBP-MgfCobYjZ;+BZ`>%v!y0y9k%MMhXZp!W$ zS7&Yt5J9htQHo8L^jpqYh8-IHdd$Q%j&`{xPgb+q0otD_)%eBk@Ui~<=Q_voNo4{v zwoHNVx8DCY^kn@;!F-W*;S+>60Qg6y(b2&D{RdVZ!&@Jlmw{V5;N@j<>xoO0R8qk# ze^T3Qm$Zuc@K9+%13>mv+9ZO!`<5D;Jdqtqu)DTicu~c>G`-Nt$t4yMq9Y-m$^3_X z@ALz)_ymbZWM;SU51q^wK;FLNcfSbjlX66AI&g1d>FT90&9QWfL%3JzboH$N@BWuRwBKES Wj@>R+sJ%Sj(HI+=88qlQ#s3EegqAJ< diff --git a/tests/introspection/iOS/introspection-ios.csproj b/tests/introspection/iOS/introspection-ios.csproj deleted file mode 100644 index 8e2601f88ae0..000000000000 --- a/tests/introspection/iOS/introspection-ios.csproj +++ /dev/null @@ -1,206 +0,0 @@ - - - - Debug - iPhoneSimulator - 8.0.30703 - 2.0 - {208744BD-504E-47D7-9A98-1CF02454A6DA} - {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Exe - Introspection - introspection - Xamarin.iOS - obj\$(Platform)\$(Configuration)-unified - - latest - PackageReference - ..\.. - true - - - True - full - False - bin\iPhoneSimulator\$(Configuration)-unified - DEBUG;MONOTOUCH;MONO_NATIVE_SYMLINK;$(DefineConstants) - prompt - 0 - None - True - -v -v - x86_64 - iPhone Developer - - - none - False - bin\iPhoneSimulator\$(Configuration)-unified - prompt - 0 - None - -v -v -gcc_flags="-weak_framework GameController" - x86_64 - MONOTOUCH;MONO_NATIVE_STATIC;$(DefineConstants) - - - True - full - False - bin\iPhone\$(Configuration)-unified - DEBUG;MONOTOUCH;MONO_NATIVE_STATIC;$(DefineConstants) - prompt - 0 - True - iPhone Developer - None - - ARM64 - true - - - none - False - bin\iPhone\$(Configuration)-unified - prompt - 0 - iPhone Developer - -v -v - True - None - ARM64 - MONOTOUCH;MONO_NATIVE_STATIC;$(DefineConstants) - true - - - $(RootTestsDirectory)\..\src\rsp\ios-defines.rsp - $(RootTestsDirectory)\..\src\rsp\tvos-defines.rsp - $(RootTestsDirectory)\..\src\rsp\watchos-defines.rsp - $(RootTestsDirectory)\..\src\rsp\maccatalyst-defines.rsp - - - - - - - - - - {F611ED96-54B5-4975-99BB-12F50AF95936} - Touch.Client-iOS - - - - - - - - - - - - - - - - - ApiBaseTest.cs - - - ApiClassPtrTest.cs - - - ApiCMAttachmentTest.cs - - - ApiCoreImageFiltersTest.cs - - - ApiCtorInitTest.cs - - - ApiFieldTest.cs - - - ApiPInvokeTest.cs - - - ApiProtocolTest.cs - - - ApiSelectorTest.cs - - - ApiSignatureTest.cs - - - ApiStructTest.cs - - - ApiTypoTest.cs - - - ApiWeakPropertyTest.cs - - - CoreSelectorTest.cs - - - EnvironmentVariable.cs - - - PlatformInfo.cs - - - TestRuntime.cs - - - ApiAvailabilityTest.cs - - - ApplePlatform.cs - - - Frameworks.cs - - - SdkVersions.cs - - - ApiFrameworkTest.cs - - - ApiTypeTest.cs - - - - - Info.plist - - - - - - - - - - - - - - - - - - - - xamarin1.png - - - simlauncher64-sgen.frameworks - - - - - diff --git a/tests/introspection/iOS/iOSApiClassPtrTest.cs b/tests/introspection/iOSApiClassPtrTest.cs similarity index 91% rename from tests/introspection/iOS/iOSApiClassPtrTest.cs rename to tests/introspection/iOSApiClassPtrTest.cs index 9453de33d3eb..8f5b606da26e 100644 --- a/tests/introspection/iOS/iOSApiClassPtrTest.cs +++ b/tests/introspection/iOSApiClassPtrTest.cs @@ -27,12 +27,6 @@ protected override bool Skip (Type type) if (TestRuntime.IsSimulatorOrDesktop) return true; break; -#if __WATCHOS__ - case "GameKit": - if (IntPtr.Size == 4) - return true; - break; -#endif } // While the following types are categories and contains a class_ptr diff --git a/tests/introspection/iOS/iOSApiCtorInitTest.cs b/tests/introspection/iOSApiCtorInitTest.cs similarity index 94% rename from tests/introspection/iOS/iOSApiCtorInitTest.cs rename to tests/introspection/iOSApiCtorInitTest.cs index b68250732512..2a5923076e14 100644 --- a/tests/introspection/iOS/iOSApiCtorInitTest.cs +++ b/tests/introspection/iOSApiCtorInitTest.cs @@ -14,9 +14,7 @@ using PassKit; #endif using Foundation; -#if !__WATCHOS__ using Metal; -#endif using ObjCRuntime; using UIKit; @@ -53,7 +51,6 @@ protected override bool Skip (Type type) if (TestRuntime.IsSimulatorOrDesktop && !TestRuntime.CheckXcodeVersion (7, 0)) return true; break; -#if !__WATCHOS__ case "MetalKit": case "MonoTouch.MetalKit": case "MetalPerformanceShaders": @@ -64,7 +61,6 @@ protected override bool Skip (Type type) if (!TestRuntime.CheckXcodeVersion (7, 0) || (MTLDevice.SystemDefault is null)) return true; break; -#endif // !__WATCHOS__ #if __TVOS__ case "MetalPerformanceShadersGraph": if (TestRuntime.IsSimulatorOrDesktop) @@ -96,11 +92,9 @@ protected override bool Skip (Type type) return true; // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: UISplitViewController is only supported when running under UIUserInterfaceIdiomPad case "UISplitViewController": -#if !__WATCHOS__ // Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: ADInterstitialAd is available on iPad only. case "ADInterstitialAd": return UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone; -#endif case "UIVideoEditorController": return true; @@ -184,23 +178,6 @@ protected override bool Skip (Type type) case "MTLHeapDescriptor": case "MTLSharedEventListener": return TestRuntime.IsSimulatorOrDesktop; -#if __WATCHOS__ - // The following watchOS 3.2 Beta 2 types Fails, but they can be created we verified using an ObjC app, we will revisit before stable - case "INRequestPaymentIntent": - case "INRequestRideIntent": - case "INResumeWorkoutIntent": - case "INRideVehicle": - case "INSearchCallHistoryIntent": - case "INSearchForMessagesIntent": - case "INSearchForPhotosIntent": - case "INSendMessageIntent": - case "INSendPaymentIntent": - case "INStartAudioCallIntent": - case "INStartPhotoPlaybackIntent": - case "INStartWorkoutIntent": - case "CLKComplicationWidgetMigrator": // Only available on device - return true; -#endif // iOS 11 Beta 1 case "UICollectionViewFocusUpdateContext": // [Assert] -init is not a useful initializer for this class. Use one of the designated initializers instead case "UIFocusUpdateContext": // [Assert] -init is not a useful initializer for this class. Use one of the designated initializers instead @@ -222,10 +199,6 @@ protected override bool Skip (Type type) case "INGetRestaurantGuestIntentResponse": // Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Unable to initialize 'INGetRestaurantGuestIntentResponse'. Please make sure that your intent definition file is valid. return TestRuntime.CheckXcodeVersion (10, 0); case "CMMovementDisorderManager": // Not available in simulator, added info to radar://41110708 -#if __WATCHOS__ - // Doesn't exist in the simulator; aborts on device if the required entitlement isn't available. - return true; -#endif return TestRuntime.IsSimulatorOrDesktop; case "RPSystemBroadcastPickerView": // Symbol not available in simulator return TestRuntime.IsSimulatorOrDesktop; @@ -243,7 +216,7 @@ protected override bool Skip (Type type) // MPSPredicate.mm:102: failed assertion `[MPSPredicate initWithBuffer:offset:] device: Apple A8 GPU does not support predication.' return (TestRuntime.IsDevice && (UIScreen.MainScreen.NativeBounds.Width <= 1920)); #endif -#if __TVOS__ || __WATCHOS__ +#if __TVOS__ case "NSMetadataQuery": // hangs on xcode 13 beta 1 on simulator if (TestRuntime.CheckXcodeVersion (13, 0)) diff --git a/tests/introspection/iOS/iOSApiFieldTest.cs b/tests/introspection/iOSApiFieldTest.cs similarity index 97% rename from tests/introspection/iOS/iOSApiFieldTest.cs rename to tests/introspection/iOSApiFieldTest.cs index 6890864add48..329b55e2f848 100644 --- a/tests/introspection/iOS/iOSApiFieldTest.cs +++ b/tests/introspection/iOSApiFieldTest.cs @@ -14,6 +14,9 @@ using UIKit; using NUnit.Framework; +// Disable until we get around to enable + fix any issues. +#nullable disable + namespace Introspection { [TestFixture] @@ -166,10 +169,6 @@ protected override bool Skip (string constantName, string libraryName) // Xcode 12.2 Beta 1 does not ship this but it is available in Xcode 12.0... case "HKMetadataKeyBarometricPressure": return true; -#if __WATCHOS__ - case "AVCaptureLensPositionCurrent": // looks like this was bound by mistake in watchOS - return true; -#endif default: return false; } diff --git a/tests/introspection/iOS/iOSApiPInvokeTest.cs b/tests/introspection/iOSApiPInvokeTest.cs similarity index 96% rename from tests/introspection/iOS/iOSApiPInvokeTest.cs rename to tests/introspection/iOSApiPInvokeTest.cs index 3713c6e0255a..d145785ff124 100644 --- a/tests/introspection/iOS/iOSApiPInvokeTest.cs +++ b/tests/introspection/iOSApiPInvokeTest.cs @@ -29,10 +29,8 @@ protected override bool Skip (string symbolName) var simulator = TestRuntime.IsSimulatorOrDesktop; switch (symbolName) { // Metal support inside simulator is only available in recent iOS9 SDK -#if !__WATCHOS__ case "MTLCreateSystemDefaultDevice": return simulator && !UIDevice.CurrentDevice.CheckSystemVersion (9, 0); -#endif // still most Metal helpers are not available on the simulator (even when the framework is present, it's missing symbols) case "MPSSupportsMTLDevice": case "MPSGetPreferredDevice": @@ -78,10 +76,7 @@ protected override bool SkipAssembly (Assembly a) // we only want to check this on a version of iOS that // 1. is the current SDK target (or a newer one) var sdk = new Version (Constants.SdkVersion); -#if __WATCHOS__ - if (!TestRuntime.CheckSystemVersion (ApplePlatform.WatchOS, sdk.Major, sdk.Minor)) - return true; -#elif __IOS__ || __TVOS__ +#if __IOS__ || __TVOS__ if (!UIDevice.CurrentDevice.CheckSystemVersion (sdk.Major, sdk.Minor)) return true; #else diff --git a/tests/introspection/iOS/iOSApiProtocolTest.cs b/tests/introspection/iOSApiProtocolTest.cs similarity index 81% rename from tests/introspection/iOS/iOSApiProtocolTest.cs rename to tests/introspection/iOSApiProtocolTest.cs index 2688b0c310ac..656579917953 100644 --- a/tests/introspection/iOS/iOSApiProtocolTest.cs +++ b/tests/introspection/iOSApiProtocolTest.cs @@ -101,17 +101,6 @@ protected override bool Skip (Type type) // but that web page doesn't explain anything (it's mostly empty, so this is probably just lagging documentation) // I also tried enabling every entitlement in Xcode, but it still didn't work. return true; -#if __WATCHOS__ && !NET - case "INCarAirCirculationModeResolutionResult": - case "INCarAudioSourceResolutionResult": - case "INCarDefrosterResolutionResult": - case "INCarSeatResolutionResult": - case "INRadioTypeResolutionResult": - case "INRelativeSettingResolutionResult": - case "INRelativeReferenceResolutionResult": - // These were bound by mistake, and they're gone in NET. - return true; -#endif case "SNClassificationResult": // Class is not being created properly return true; case "SNClassifySoundRequest": // Class is not being created properly @@ -387,74 +376,7 @@ protected override bool Skip (Type type, string protocolName) case "DDDevice": case "DDDeviceEvent": return true; -#if __WATCHOS__ - case "CLKComplicationTemplate": - case "CLKComplicationTemplateCircularSmallRingImage": - case "CLKComplicationTemplateCircularSmallRingText": - case "CLKComplicationTemplateCircularSmallSimpleImage": - case "CLKComplicationTemplateCircularSmallSimpleText": - case "CLKComplicationTemplateCircularSmallStackImage": - case "CLKComplicationTemplateCircularSmallStackText": - case "CLKComplicationTemplateModularLargeColumns": - case "CLKComplicationTemplateModularLargeStandardBody": - case "CLKComplicationTemplateModularLargeTable": - case "CLKComplicationTemplateModularLargeTallBody": - case "CLKComplicationTemplateModularSmallColumnsText": - case "CLKComplicationTemplateModularSmallRingImage": - case "CLKComplicationTemplateModularSmallRingText": - case "CLKComplication": - case "CLKComplicationTemplateModularSmallSimpleImage": - case "CLKTextProvider": - case "CLKComplicationTemplateModularSmallSimpleText": - case "CLKTimeIntervalTextProvider": - case "CLKComplicationTemplateModularSmallStackImage": - case "CLKTimeTextProvider": - case "CLKComplicationTemplateModularSmallStackText": - case "CLKComplicationTemplateUtilitarianLargeFlat": - case "CLKComplicationTemplateUtilitarianSmallFlat": - case "CLKComplicationTemplateUtilitarianSmallRingImage": - case "CLKComplicationTemplateUtilitarianSmallRingText": - case "CLKComplicationTemplateUtilitarianSmallSquare": - case "CLKComplicationTimelineEntry": - case "CLKDateTextProvider": - case "CLKImageProvider": - case "CLKRelativeDateTextProvider": - case "CLKSimpleTextProvider": - case "WKAlertAction": - // watchOS 3 - case "CLKComplicationTemplateExtraLargeSimpleImage": - case "CLKComplicationTemplateExtraLargeSimpleText": - case "CLKComplicationTemplateExtraLargeStackImage": - case "CLKComplicationTemplateExtraLargeStackText": - case "CLKComplicationTemplateExtraLargeColumnsText": - case "CLKComplicationTemplateExtraLargeRingImage": - case "CLKComplicationTemplateExtraLargeRingText": - // watchOS 5 / Xcode 10 GM - case "CLKComplicationTemplateGraphicBezelCircularText": - case "CLKComplicationTemplateGraphicCircular": - case "CLKComplicationTemplateGraphicCircularClosedGaugeImage": - case "CLKComplicationTemplateGraphicCircularClosedGaugeText": - case "CLKComplicationTemplateGraphicCircularImage": - case "CLKComplicationTemplateGraphicCircularOpenGaugeImage": - case "CLKComplicationTemplateGraphicCircularOpenGaugeRangeText": - case "CLKComplicationTemplateGraphicCircularOpenGaugeSimpleText": - case "CLKComplicationTemplateGraphicCornerCircularImage": - case "CLKComplicationTemplateGraphicCornerGaugeImage": - case "CLKComplicationTemplateGraphicCornerGaugeText": - case "CLKComplicationTemplateGraphicCornerStackText": - case "CLKComplicationTemplateGraphicCornerTextImage": - case "CLKComplicationTemplateGraphicRectangularLargeImage": - case "CLKComplicationTemplateGraphicRectangularStandardBody": - case "CLKComplicationTemplateGraphicRectangularTextGauge": - case "CLKFullColorImageProvider": - case "CLKGaugeProvider": - case "CLKSimpleGaugeProvider": - case "CLKTimeIntervalGaugeProvider": - // watchOS 6 / Xcode 11 - case "CLKComplicationTemplateGraphicCircularStackImage": - case "CLKComplicationTemplateGraphicCircularStackText": - return true; -#elif __TVOS__ +#if __TVOS__ case "TVTopShelfAction": case "TVTopShelfCarouselContent": case "TVTopShelfCarouselItem": @@ -653,74 +575,7 @@ protected override bool Skip (Type type, string protocolName) case "DDDevice": case "DDDeviceEvent": return true; -#if __WATCHOS__ - case "CLKComplicationTemplate": - case "CLKComplicationTemplateCircularSmallRingImage": - case "CLKComplicationTemplateCircularSmallRingText": - case "CLKComplicationTemplateCircularSmallSimpleImage": - case "CLKComplicationTemplateCircularSmallSimpleText": - case "CLKComplicationTemplateCircularSmallStackImage": - case "CLKComplicationTemplateCircularSmallStackText": - case "CLKComplicationTemplateModularLargeColumns": - case "CLKComplicationTemplateModularLargeStandardBody": - case "CLKComplicationTemplateModularLargeTable": - case "CLKComplicationTemplateModularLargeTallBody": - case "CLKComplicationTemplateModularSmallColumnsText": - case "CLKComplicationTemplateModularSmallRingImage": - case "CLKComplicationTemplateModularSmallRingText": - case "CLKComplicationTemplateModularSmallSimpleImage": - case "CLKComplicationTemplateModularSmallSimpleText": - case "CLKComplicationTemplateModularSmallStackImage": - case "CLKComplicationTemplateModularSmallStackText": - case "CLKComplicationTemplateUtilitarianLargeFlat": - case "CLKComplicationTemplateUtilitarianSmallFlat": - case "CLKComplicationTemplateUtilitarianSmallRingImage": - case "CLKComplicationTemplateUtilitarianSmallRingText": - case "CLKComplicationTemplateUtilitarianSmallSquare": - case "CLKComplicationTimelineEntry": - case "CLKDateTextProvider": - case "CLKImageProvider": - case "CLKRelativeDateTextProvider": - case "CLKSimpleTextProvider": - case "CLKTextProvider": - case "CLKTimeIntervalTextProvider": - case "CLKTimeTextProvider": - case "CLKComplication": - case "WKAlertAction": - // watchOS 3 - case "CLKComplicationTemplateExtraLargeSimpleImage": - case "CLKComplicationTemplateExtraLargeSimpleText": - case "CLKComplicationTemplateExtraLargeStackImage": - case "CLKComplicationTemplateExtraLargeStackText": - case "CLKComplicationTemplateExtraLargeColumnsText": - case "CLKComplicationTemplateExtraLargeRingImage": - case "CLKComplicationTemplateExtraLargeRingText": - // watchOS 5 / Xcode 10 GM - case "CLKComplicationTemplateGraphicBezelCircularText": - case "CLKComplicationTemplateGraphicCircular": - case "CLKComplicationTemplateGraphicCircularClosedGaugeImage": - case "CLKComplicationTemplateGraphicCircularClosedGaugeText": - case "CLKComplicationTemplateGraphicCircularImage": - case "CLKComplicationTemplateGraphicCircularOpenGaugeImage": - case "CLKComplicationTemplateGraphicCircularOpenGaugeRangeText": - case "CLKComplicationTemplateGraphicCircularOpenGaugeSimpleText": - case "CLKComplicationTemplateGraphicCornerCircularImage": - case "CLKComplicationTemplateGraphicCornerGaugeImage": - case "CLKComplicationTemplateGraphicCornerGaugeText": - case "CLKComplicationTemplateGraphicCornerStackText": - case "CLKComplicationTemplateGraphicCornerTextImage": - case "CLKComplicationTemplateGraphicRectangularLargeImage": - case "CLKComplicationTemplateGraphicRectangularStandardBody": - case "CLKComplicationTemplateGraphicRectangularTextGauge": - case "CLKFullColorImageProvider": - case "CLKGaugeProvider": - case "CLKSimpleGaugeProvider": - case "CLKTimeIntervalGaugeProvider": - // watchOS 6 / Xcode 11 - case "CLKComplicationTemplateGraphicCircularStackImage": - case "CLKComplicationTemplateGraphicCircularStackText": - return true; -#elif __TVOS__ +#if __TVOS__ case "TVTopShelfAction": case "TVTopShelfCarouselContent": case "TVTopShelfCarouselItem": @@ -822,10 +677,6 @@ protected override bool Skip (Type type, string protocolName) // iOS 16 case "DDDevice": return true; -#if __WATCHOS__ - case "CLKComplicationTimelineEntry": - return true; -#endif // Xcode 10 case "ILClassificationUIExtensionContext": // Conformance not in headers return true; @@ -1126,11 +977,9 @@ protected override bool Skip (Type type, string protocolName) return !TestRuntime.CheckXcodeVersion (8, 0); } break; -#if !__WATCHOS__ // Undocumented conformance (members were inlinded in 'UIViewController' before so all subtypes should conform) case "UIStateRestoring": return type.Name == "UIViewController" || type.IsSubclassOf (typeof (UIViewController)); -#endif #if __IOS__ || __TVOS__ case "UIFocusItemContainer": case "UICoordinateSpace": diff --git a/tests/introspection/iOS/iOSApiSelectorTest.cs b/tests/introspection/iOSApiSelectorTest.cs similarity index 90% rename from tests/introspection/iOS/iOSApiSelectorTest.cs rename to tests/introspection/iOSApiSelectorTest.cs index 11224b11ae6d..a6ca6ce82bd1 100644 --- a/tests/introspection/iOS/iOSApiSelectorTest.cs +++ b/tests/introspection/iOSApiSelectorTest.cs @@ -18,6 +18,9 @@ #endif using NUnit.Framework; +// Disable until we get around to enable + fix any issues. +#nullable disable + namespace Introspection { [TestFixture] @@ -34,12 +37,6 @@ public iOSApiSelectorTest () protected override bool Skip (Type type) { switch (type.Namespace) { -#if __WATCHOS__ - case "GameKit": - if (IntPtr.Size == 4) - return true; - break; -#endif // they don't answer on the simulator (Apple implementation does not work) but fine on devices case "GameController": case "MonoTouch.GameController": @@ -127,52 +124,6 @@ protected override bool Skip (Type type) case "MTLRasterizationRateLayerDescriptor": case "MTLRasterizationRateMapDescriptor": return TestRuntime.IsSimulatorOrDesktop; -#if __WATCHOS__ - // The following watchOS 3.2 Beta 2 types Fails, but they can be created we verified using an ObjC app, we will revisit before stable - case "INPersonResolutionResult": - case "INPlacemarkResolutionResult": - case "INPreferences": - case "INRadioTypeResolutionResult": - case "INRelativeReferenceResolutionResult": - case "INRelativeSettingResolutionResult": - case "INRideCompletionStatus": - case "INSpeakableStringResolutionResult": - case "INStringResolutionResult": - case "INTemperatureResolutionResult": - case "INWorkoutGoalUnitTypeResolutionResult": - case "INWorkoutLocationTypeResolutionResult": - case "INBillPayeeResolutionResult": - case "INBillTypeResolutionResult": - case "INBooleanResolutionResult": - case "INCallRecordTypeResolutionResult": - case "INCarAirCirculationModeResolutionResult": - case "INCarAudioSourceResolutionResult": - case "INCarDefrosterResolutionResult": - case "INCarSeatResolutionResult": - case "INCarSignalOptionsResolutionResult": - case "INCurrencyAmountResolutionResult": - case "INDateComponentsRangeResolutionResult": - case "INDateComponentsResolutionResult": - case "INDoubleResolutionResult": - case "INImage": - case "INIntegerResolutionResult": - case "INInteraction": - case "INMessageAttributeOptionsResolutionResult": - case "INPaymentAmountResolutionResult": - case "INMessageAttributeResolutionResult": - case "INPaymentMethod": - case "INPaymentStatusResolutionResult": - case "INPaymentAccountResolutionResult": - return true; - case "CMMovementDisorderManager": - // From Xcode 10 beta 2: - // This requires a special entitlement: - // Usage of CMMovementDisorderManager requires a special entitlement. Please see for more information https://developer.apple.com/documentation/coremotion/cmmovementdisordermanager - // but that web page doesn't explain anything (it's mostly empty, so this is probably just lagging documentation) - // I also tried enabling every entitlement in Xcode, but it still didn't work. - return true; -#endif - default: return base.Skip (type); } @@ -448,26 +399,7 @@ protected override bool CheckResponse (bool value, Type actualType, MethodBase m } break; #endif -#if __WATCHOS__ - case "INUserContext": - switch (name) { - case "encodeWithCoder:": - if (!TestRuntime.CheckXcodeVersion (12, 0)) - return true; - break; - } - break; - case "HKHealthStore": - switch (name) { - case "workoutSessionMirroringStartHandler": - if (TestRuntime.IsSimulatorOrDesktop) - return true; - break; } - break; -#endif - break; - } switch (name) { // UIResponderStandardEditActions - stuffed inside UIResponder @@ -805,11 +737,6 @@ protected override bool CheckResponse (bool value, Type actualType, MethodBase m case "HKElectrocardiogramVoltageMeasurement": // NSCopying conformance added in Xcode 14 return !TestRuntime.CheckXcodeVersion (14, 0); -#if __WATCHOS__ - case "INParameter": - // NSCopying conformance added in Xcode 10 - return !TestRuntime.CheckXcodeVersion (10, 0); -#endif } break; @@ -932,18 +859,6 @@ protected override bool CheckStaticResponse (bool value, Type actualType, Type d break; } break; -#if __WATCHOS__ - case "fetchAllRecordZonesOperation": - case "fetchCurrentUserRecordOperation": - case "notificationFromRemoteNotificationDictionary:": - case "containerWithIdentifier:": - case "defaultContainer": - case "defaultRecordZone": - // needs investigation, seems all class selectors from CloudKit don't answer - if (declaredType.Namespace == "CloudKit") - return true; - break; -#endif case "affectsColorAppearance": switch (declaredType.Name) { case "UITraitTypesettingLanguage": diff --git a/tests/introspection/iOS/iOSApiSignatureTest.cs b/tests/introspection/iOSApiSignatureTest.cs similarity index 95% rename from tests/introspection/iOS/iOSApiSignatureTest.cs rename to tests/introspection/iOSApiSignatureTest.cs index e0a33ed967d5..f15bc3417f1c 100644 --- a/tests/introspection/iOS/iOSApiSignatureTest.cs +++ b/tests/introspection/iOSApiSignatureTest.cs @@ -16,6 +16,9 @@ using Foundation; using UIKit; +// Disable until we get around to enable + fix any issues. +#nullable disable + namespace Introspection { [TestFixture] @@ -182,16 +185,6 @@ protected override void CheckManagedMemberSignatures (MethodBase m, Type t, ref return; break; #endif // !XAMCORE_5_0 -#if !NET - case "get_ImagePickerControllerDelegate": - case "set_ImagePickerControllerDelegate": - case "get_NavigationControllerDelegate": - case "set_NavigationControllerDelegate": - // fixed in NET - alternative are the Weak* delegates - if (t.Name == "UIImagePickerController") - return; - break; -#endif #if !XAMCORE_5_0 // let's review the tests exceptions if we break things case "get_Model": case "set_Model": diff --git a/tests/introspection/iOS/iOSApiTypoTest.cs b/tests/introspection/iOSApiTypoTest.cs similarity index 86% rename from tests/introspection/iOS/iOSApiTypoTest.cs rename to tests/introspection/iOSApiTypoTest.cs index 42bb6fce8466..0af54108c03d 100644 --- a/tests/introspection/iOS/iOSApiTypoTest.cs +++ b/tests/introspection/iOSApiTypoTest.cs @@ -9,28 +9,19 @@ namespace Introspection { [TestFixture] public class iOSApiTypoTest : ApiTypoTest { -#if !__WATCHOS__ UITextChecker checker = new UITextChecker (); -#endif public override string GetTypo (string txt) { -#if __WATCHOS__ - return string.Empty; -#else var checkRange = new NSRange (0, txt.Length); var typoRange = checker.RangeOfMisspelledWordInString (txt, checkRange, checkRange.Location, false, "en_US"); if (typoRange.Length == 0) return String.Empty; return txt.Substring ((int) typoRange.Location, (int) typoRange.Length); -#endif } public override void TypoTest () { -#if __WATCHOS__ - Assert.Ignore ("Need to find alternative for UITextChecker on WatchOS."); -#else // the dictionary used by iOS varies with versions and // we don't want to maintain special cases for each version var sdk = new Version (Constants.SdkVersion); @@ -42,7 +33,6 @@ public override void TypoTest () TestRuntime.AssertSimulatorOrDesktop ("Typos only detected on simulator"); base.TypoTest (); -#endif } } } diff --git a/tests/introspection/iOS/iOSApiWeakPropertyTest.cs b/tests/introspection/iOSApiWeakPropertyTest.cs similarity index 95% rename from tests/introspection/iOS/iOSApiWeakPropertyTest.cs rename to tests/introspection/iOSApiWeakPropertyTest.cs index d2438e4e3d5f..20de3b39454b 100644 --- a/tests/introspection/iOS/iOSApiWeakPropertyTest.cs +++ b/tests/introspection/iOSApiWeakPropertyTest.cs @@ -5,6 +5,9 @@ using NUnit.Framework; +// Disable until we get around to enable + fix any issues. +#nullable disable + namespace Introspection { [TestFixture] diff --git a/tests/introspection/iOS/iOSCoreImageFiltersTest.cs b/tests/introspection/iOSCoreImageFiltersTest.cs similarity index 94% rename from tests/introspection/iOS/iOSCoreImageFiltersTest.cs rename to tests/introspection/iOSCoreImageFiltersTest.cs index 0e7beb6d662b..ba9a8ea4cb39 100644 --- a/tests/introspection/iOS/iOSCoreImageFiltersTest.cs +++ b/tests/introspection/iOSCoreImageFiltersTest.cs @@ -8,8 +8,6 @@ // Copyright 2012-2013 Xamarin Inc. All rights reserved. // -#if !__WATCHOS__ - using System; using System.Reflection; using CoreImage; @@ -34,4 +32,3 @@ protected override bool Skip (Type type) } } } -#endif // !__WATCHOS__ From 28462ffd8649798fbae24c386b205e14d232afde Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 6 Nov 2024 10:29:56 +0100 Subject: [PATCH 2/3] Update autoformat script. --- tools/autoformat.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/autoformat.sh b/tools/autoformat.sh index 2121ef35d991..9d632006f51e 100755 --- a/tools/autoformat.sh +++ b/tools/autoformat.sh @@ -55,8 +55,6 @@ dotnet format whitespace "$SRC_DIR/tests/introspection/dotnet/iOS/introspection. dotnet format whitespace "$SRC_DIR/tests/introspection/dotnet/MacCatalyst/introspection.csproj" dotnet format whitespace "$SRC_DIR/tests/introspection/dotnet/macOS/introspection.csproj" dotnet format whitespace "$SRC_DIR/tests/introspection/dotnet/tvOS/introspection.csproj" -dotnet format whitespace "$SRC_DIR/tests/introspection/iOS/introspection-ios.csproj" -dotnet format whitespace "$SRC_DIR/tests/introspection/Mac/introspection-mac.csproj" dotnet format whitespace "$SRC_DIR/tests/monotouch-test/dotnet/iOS/monotouch-test.csproj" dotnet format whitespace "$SRC_DIR/tests/monotouch-test/dotnet/MacCatalyst/monotouch-test.csproj" dotnet format whitespace "$SRC_DIR/tests/monotouch-test/dotnet/macOS/monotouch-test.csproj" From a5daff7039a1982efffebde14d686dc5898bbf8a Mon Sep 17 00:00:00 2001 From: GitHub Actions Autoformatter Date: Wed, 6 Nov 2024 09:32:48 +0000 Subject: [PATCH 3/3] Auto-format source code --- tests/introspection/ApiCMAttachmentTest.cs | 3 +-- tests/introspection/iOSApiSelectorTest.cs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/introspection/ApiCMAttachmentTest.cs b/tests/introspection/ApiCMAttachmentTest.cs index b956c8c1148c..59c92ba185ee 100644 --- a/tests/introspection/ApiCMAttachmentTest.cs +++ b/tests/introspection/ApiCMAttachmentTest.cs @@ -140,8 +140,7 @@ public AttachableNativeObject (INativeObject obj) nativeObj = obj; } - public NativeHandle Handle - { + public NativeHandle Handle { get { return nativeObj.Handle; } } } diff --git a/tests/introspection/iOSApiSelectorTest.cs b/tests/introspection/iOSApiSelectorTest.cs index a6ca6ce82bd1..15f7cdaf1cd8 100644 --- a/tests/introspection/iOSApiSelectorTest.cs +++ b/tests/introspection/iOSApiSelectorTest.cs @@ -399,7 +399,7 @@ protected override bool CheckResponse (bool value, Type actualType, MethodBase m } break; #endif - } + } switch (name) { // UIResponderStandardEditActions - stuffed inside UIResponder