* [tests] Remove Classic SDK tests.
* Remove XI/Classic support.
This also means we can remove support for the legacy registrars.
* [monotouch-test] Remove legacy registrar tests.
* [tests/mtouch] Remove Classic tests (and legacy registrar logic).
* [tests/scripted] Fix tests to reference Xamarin.iOS.dll.
The current API use `string`, not `NSString` is added as a step forward.
The `NSString` is more correct but it does not ease discoverability (e.g.
code completion) so an enum-based overload is added (as the preferred API).
https://bugzilla.xamarin.com/show_bug.cgi?id=32535
https://bugzilla.xamarin.com/show_bug.cgi?id=37175
NSUrlSession's Create*Task methods may return an object of the wrong
type (NSUrlSessionTask instead of NSUrl[Data|Download|Upload]SessionTask),
so we need to bypass our type check when creating the managed object,
otherwise we end up throwing InvalidCastExceptions randomly. We will
return the type that is declared on the headers so if the native side
returns a cat and headers says it barks we'll we make it bark :).
https://bugzilla.xamarin.com/show_bug.cgi?id=44322
AVAssetDownloadUrlSession.CreateSession according to headers it
should return an AVAssetDownloadUrlSession but it is returning
an apple internal type NSURLBackgroundSession so with our
current bindings it throws an InvalidCastException, adding
ForcedTypeAttribute will create the managed type wihout
the actual typecheck. Added test verifing that the API
no longer throws.
It turns out `MTLHeapDescriptor` does not exists on the simulator.
```Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_MTLHeapDescriptor", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64```
A `[DisableDefaultCtor]` was used (by mistake / lack of documentation)
and this was hiding the issue (on our bots).
However on device introspection was not happy:
iOSApiSelectorTest
[FAIL] Selector not found for Metal.MTLHeapDescriptor : cpuCacheMode
[FAIL] Selector not found for Metal.MTLHeapDescriptor : setCpuCacheMode:
[FAIL] Selector not found for Metal.MTLHeapDescriptor : size
[FAIL] Selector not found for Metal.MTLHeapDescriptor : setSize:
[FAIL] Selector not found for Metal.MTLHeapDescriptor : storageMode
[FAIL] Selector not found for Metal.MTLHeapDescriptor : setStorageMode:
[FAIL] iOSApiSelectorTest.ApiSelectorTest.InstanceMethods : 6 errors found in 18339 instance selector validated
Note that these are the properties, not the `init` that's mentioned here.
So first `init` is possible, on devices, from Xcode:
MTLHeapDescriptor *hd = [[MTLHeapDescriptor alloc] init];
NSLog (@"%@", [hd description]);
gives
<MTLHeapDescriptorInternal: 0x17401da50>
{
cpuCacheMode = MTLCPUCacheModeDefaultCache;
size = 0;
storageMode = MTLStorageModePrivate;
}
so we need to remove our `[DisableDefaultCtor]`.
That does not fix the selectors above... but note the *Internal type
returned, they are forwarded and that's generally something that
respondToSelector (that introspection uses) does not cover.
But, to be sure, we add unit tests showing all the properties are
working like expected :-)
* [healthkit] Change binding for HKDetailedCdaErrors
* Hide [Fields]
* Easier access to the information from NSError
* Unit test (mostly to make sure of the returned type)
* [healthkit] Remove HKDetailedCDAValidationErrorKey from watchOS profile
It's used from an NSError returned from an API that is not available in
watchOS.
Fixes the following test failures:
[FAIL] BlockSignatureTest.WithoutUserDelegateTypeAttribute : System.ExecutionEngineException : Attempting to JIT compile method '(wrapper native-to-managed) MonoTouchFixtures.ObjCRuntime.BlockSignatureTest:<WithoutUserDelegateTypeAttribute>m__0 (intptr,intptr)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.
at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:GetFunctionPointerForDelegateInternal (System.Delegate)
at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate (System.Delegate d) [0x00011] in /work/maccore/xcode8/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs:1714
at ObjCRuntime.BlockLiteral.SetupBlock (System.Delegate trampoline, System.Delegate userDelegate) [0x0000b] in /work/maccore/xcode8/xamarin-macios/src/ObjCRuntime/Blocks.cs:92
at MonoTouchFixtures.ObjCRuntime.BlockSignatureTest.WithoutUserDelegateTypeAttribute () [0x00049] in /work/maccore/xcode8/xamarin-macios/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs:2585
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /work/maccore/xcode8/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:309
[FAIL] BlockSignatureTest.WithUserDelegateTypeAttribute : System.ExecutionEngineException : Attempting to JIT compile method '(wrapper native-to-managed) MonoTouchFixtures.ObjCRuntime.BlockSignatureTest:<WithUserDelegateTypeAttribute>m__2 (intptr,intptr)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.
at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:GetFunctionPointerForDelegateInternal (System.Delegate)
at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate (System.Delegate d) [0x00011] in /work/maccore/xcode8/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs:1714
at ObjCRuntime.BlockLiteral.SetupBlock (System.Delegate trampoline, System.Delegate userDelegate) [0x0000b] in /work/maccore/xcode8/xamarin-macios/src/ObjCRuntime/Blocks.cs:92
at MonoTouchFixtures.ObjCRuntime.BlockSignatureTest.WithUserDelegateTypeAttribute () [0x00049] in /work/maccore/xcode8/xamarin-macios/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs:2596
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /work/maccore/xcode8/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:309
Enabling CloudKit on watchOS required to remove some default .ctor that
watchOS does not _support_.
This commit fix this by either
* replacing the default .ctor with something that works across all
platforms (best); or
* removing the default .ctor only on watchOS;
The commit also mark as abstract three existing types for watchOS (and
for XAMCORE_4_0) that were found reviewing the bindings.
Runtime
- Added support for Vector2d, Vector3d and Vector4d SIMD types
- Added support for GKBox, GKQuad and GKTriangle SIMD types
GameplayKit
- Apple introduced GKQuadTreeNode and GKQuadTree in Xcode 7.1 and
removed those types in a later Xcode (7.2?) but we kept them around.
Now apple introduced again both types but renamed them to GKQuadtreeNode
and GKQuadtree (lowercase t), this is a breaking change and since we do
care about binary compat we are just changing the registration name and
keeping the same managed name deprecating old methods and introducing
the new ones.
- Added tests for new SIMD types
Xcode8 SDK changed untyped enums (always 32 bits) into NSInteger. In this
case we can continue with the existing API (and ignore them in xtro)
reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=42682
The P/Invoke callback method that's called by native code
has a simpler function signature than what the user delegate
has.
Example P/Invoke callback signature:
static unsafe void Invoke (IntPtr block, IntPtr obj)
which ends up calling this delegate:
System.Action<NSDictionary>
The NSDictionary parameter has been simplifed to just IntPtr.
The problem is that we need to encode the block signature according
to the signature of the user delegate (Apple uses the signature
in some cases, and fails/aborts if the signature doesn't match
what the code expects).
So add more metadata to make it possible to find the signature
of the user delegate at runtime.
The generator generates code like this:
block_scheduledCompletion.SetupBlock (Trampolines.SDActionArity1V2.Handler, scheduledCompletion);
where SDActionArity1V2.Handler is defined as this:
static internal readonly DActionArity1V2 Handler = Invoke;
this means we can get the type of `Trampolines.SDActionArity1V2.Handler` at runtime
(which would be `DActionArity1V2` in this case), so put a new attribute (`UserDelegateTypeAttribute`)
at that type:
[UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
[UserDelegateType (typeof (global::System.Action<NSDictionary>))]
internal delegate void DActionArity1V2 (IntPtr block, IntPtr obj);
Then at runtime we check if the target delegate's type has this attribute,
and then we use the type specified by this new attribute instead when
computing the ObjC signature of the block.
https://bugzilla.xamarin.com/show_bug.cgi?id=43592
A problem, that exists with the current API, is that several constants
are hidden but many are needed in some dictionaries - and not all of
them can be turned into _classic_ StrongDictionary.
This initial PR does not solve all the (old) problems, but it does offer
some useful overloads that makes the API usable for basic usages and
expose the NSDictionary-based API.
This is a static selector that needs to be overridden, which is not the
usual pattern in C#. We re-define it using [New] on subclasses.
Unit tests added for all NSDimension subclasses.
reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=43444
Apple removed CGColorConverter even if it was publicly exposed in iOS 9.3,
not that I recall any API that consumed it...
It was replaced by a new, very close, type named CGColorConversionInfo and
the existing code and tests were updated to the new API.
So for `CGColorConverter` we're
* iOS: Obsoleted + code removal
* tvOS: Obsoleted + code removal
* watchOS: the API can be removed as it was not exposed in a stable release
* macOS: it was not enabled (did not work)
* [tests] Adjust ApiCMAttachmentTest so it knows how to create the new CGColorConversionInfo type
* [spritekit] Update for iOS 10 beta 1
* [spritekit] Add missing MarshalDirective
* [runtime] Add missing simd function signatures
- Add matrix_float2x2 and matrix_float3x3 natives types.
* [introspection] Fix ApiSignatureTest
- We now avoid checking {?=[X]} encoded signatures.
- We now calculate the right size for matrix_float2x2, matrix_float3x3 and matrix_float4x4.
- Fix SKWarpGeometryGrid wrong bindings revealed by tests (IntPtr instead of Vector2).
* [monotouch-test] Add SKUniform and SKWarpGeometryGrid tests
- Split in two to ease review;
- Unit tests added for NSUrlSessionTaskMetrics and
NSUrlSessionTaskTransactionMetrics as they don't respond to selectors
like expected (but just like other NSUrlSession* types)
Xcode8 SDK (for tvOS 10) marked those API with __TVOS_UNAVAILABLE making
them only available on iOS.
Since the API are not yet released in stable (C8) so we can removing
them proactively. It will be easier to add them back later (if the
situation change) than removing/obsoleting them.
Xcode8 SDK (for tvOS 10) marked those API with __TVOS_UNAVAILABLE making
them only available on iOS.
Since the API are not yet released in stable (C8) so we can removing
them proactively. It will be easier to add them back later (if the
situation change) than removing/obsoleting them.
Jul 15 15:44:26 castor monotouchtest[42732]: [default] [ERROR] error while getting ubiquityIdentityToken: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.bird.token was invalidated." UserInfo={NSDebugDescription=The connection to service named com.apple.bird.token was invalidated.}
^ the above is printed several times after this
* Mostly missing checks
* FontTest: Apple never fixed that and the way we link now, without
dlsym, makes the test crash
dyld: lazy symbol binding failed: Symbol not found: _CTFontCreateWithFontDescriptorAndOptions
Referenced from: /var/mobile/Applications/6025D222-F50E-46E0-8BF5-9C45D4C7DACB/monotouchtest.app/monotouchtest
Expected in: /System/Library/Frameworks/CoreText.framework/CoreText
Tested with iOS 7.1 on an iPad 3
- Dynamic registrar needs to ignore new CBManager base class;
- CGImageMetadataTag.Value returns a mutable array on iOS10;
- MPMediaItem properties needed 9.2 / 10.0 check;
- MSMessage not available before Xcode 8;
- Metal not available before Xcode 6;
- MetalPerformanceShaders not available before Xcode 7;
Category methods are exposed like extension methods, and the first parameter
specifies the class, which means we need to skip the first type when generating
the ObjC signature.
https://bugzilla.xamarin.com/show_bug.cgi?id=42489
There can be circular dependencies between Objective-C classes,
so make sure we don't fail compilation when that occurs by
forward declaring any Objective-C classes/protocols.
The test case in question does not contain a circular dependency,
but the same issue occurs due to types not being generated in the
correct order (a correct order could be constructed for the test
case, but there's no general solution since circular dependencies
can exist).
https://bugzilla.xamarin.com/show_bug.cgi?id=42454
Category methods are exposed like extension methods, and the first parameter
specifies the class, which means we need to skip the first type when generating
the ObjC signature.
https://bugzilla.xamarin.com/show_bug.cgi?id=42489
- Includes tests.
- Add availability flags.
- Turn new fields into properties.
- Verify bindings on iOS 9.3.
- Added protection in MPNowPlayingInfoCenter if native fields
are not available (depending on the iOS version).
There can be circular dependencies between Objective-C classes,
so make sure we don't fail compilation when that occurs by
forward declaring any Objective-C classes/protocols.
The test case in question does not contain a circular dependency,
but the same issue occurs due to types not being generated in the
correct order (a correct order could be constructed for the test
case, but there's no general solution since circular dependencies
can exist).
https://bugzilla.xamarin.com/show_bug.cgi?id=42454
Does not affect the Jenkins bots (which don't run classic tests) but
fails on wrench (who still runs them right now). There's a difference
in how equality is checked between classic and unified and that expose
a, not really important, change in iOS10.
Fix issues with monotouch-tests with beta2
* TLSMaximumSupportedProtocol returns Unknown, which also means default,
instead of SslProtocol.Tls_1_2
* Setting NSZone.Name crash the app
* The MDLMesh tests are broken in a different way than beta1
* [callkit] Disable CTCallCenter default ctor as it breaks introspection
> [FAIL] Default constructor not allowed for CoreTelephony.CTCallCenter : SIGILL
The exception, that we catch, puts the process in an unstable state.
This cause weird results and crash later (wrong dispatch queue on main
thread) when testing MapKit.
Crashed Thread: 0 tid_a07 Dispatch queue: CTCallCenter
Exception Type: EXC_BAD_ACCESS (SIGABRT)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000004
Exception Note: EXC_CORPSE_NOTIFY
VM Regions Near 0x4:
-->
__TEXT 0000000000097000-00000000004d2000 [ 4332K] r-x/rwx SM=COW /Users/USER/Library/Developer/CoreSimulator/Devices/9446B344-62A2-42A8-A8EE-9FE7AC6BA5C8/data/Containers/Bundle/Application/81183608-DADF-4226-B7FE-4B43759D679A/introspection.app/introspection
Application Specific Information:
BUG IN CLIENT OF LIBDISPATCH: dispatch_barrier_sync called on queue already owned by current thread
abort() called
CoreSimulator 278 - Device: iPhone 5 - Runtime: iOS 10.0 (14A5297c) - DeviceType: iPhone 5
Some beta2 adjustments (removals) to get green tests and be able to merge it so bindings of beta2 can start
* [tests] NEFlowMetaData conformance to NSSecureCoding and NSCopying is new in beta2 (and check fails on OSX 10.11)
* [uikit] Add [UIScrollView|UITableViewController].refreshControl to fix monotouch-test build
UIRefreshControlHosting was removed in beta2 but we still need the
refreshControl property on UIScrollView and UITableViewController
to build monotouch-test
* Added support in DictionaryContainer for CGRect/CGPoint/CGSize and CMTime
* Added support for [StrongDictionary] using CGRect/CGPoint/CGSize and CMTime
* Added tests using DictionaryContainers for CGRect/CGPoint/CGSize and CMTime
* [Foundation] NSUbiquitousKeyValueStore is not available on watchOS.
Fixes an issue found by the introspection tests when running on a
watchOS device.
* [monotouch-test] Fix watchOS build with regards to NSUbiquitousKeyValueStore changes.
Also use https instead of http to avoid a network roundtrip
(since http://www.xamarin.com just redirects to https).
This will hopefully fix this random test failure:
[FAIL] UrlSessionTest.CreateDataTaskAsync : CreateUploadTask a
https://bugzilla.xamarin.com/show_bug.cgi?id=41343
* NSDictionary<TKey, TValue>.FromObjectsAndKeys keys and values are twisted up
* Fixed it in XAMCORE_4_0
* Obsoleted the 2 existing methods
* introduced FromObjectsAndKeys (TValue [] objects, TKey [] keys, nint count)
* Added unit tests with different types for TKey and TValue
* [tests][monotouch] More adjustments for iOS10 related failures/changes
- some might be Apple bugs and need to be reverted later
* Fix more failures on monotouch-tests wrt iOS 10
* MutableContactTest.cs: Wrong assert was changed (which is why each one
needs it's own unique string)
* TrustTest.cs: Fixed as results vary on < iOS9, iOS9 and iOS10
* NetworkReachabilityTest.cs: Fixed as results vary on < iOS9, iOS9 and iOS10
Those
[FAIL] UserDefaultsTest.Ctor_UserName : System.NullReferenceException : Object reference not set to an instance of an object
[FAIL] UserDefaultsTest.SetString : StringForKey-2
are due to
http://stackoverflow.com/questions/37840288/ios-10-nsuserdefaults-does-not-work
and should disappear once the bots are rebooted.
Fixes NSCharacterSetTest.NSMutableCharacterSet_TestStaticSets when
running with the P/Invoke wrapper (for exceptions) enabled (i.e.
watchOS), since otherwise the wrapper would truncate char parameters
to byte.