Граф коммитов

20 Коммитов

Автор SHA1 Сообщение Дата
Sebastien Pouliot e53b94d27c
[corefoundation] Add missing CFStringTransform API. Fixes #5705 (#5712)
Since there's no `NSString` or .NET equivalent. This requires a mutable
`CFString` so the new type `CFMutableString` is also added.

* Switch `CFString` base type to `NativeObject` to ease `CFMutableString` implementation;
* Add unit tests for `CFMutableString` both for `CFStringTransform` and some unicode variety to `CFStringAppendCharacters tests` wrt `numChars` being unicode or not (bytes)

Fixes https://github.com/xamarin/xamarin-macios/issues/5705
2019-03-06 08:04:17 -05:00
Miguel de Icaza c9e424c9ab [CoreFoundation, ObjCRuntime] Add DispatchBlock APIs, in particular those that surface QOS (#5389)
* [CoreFoundation, ObjCRuntime] Add DispatchBlock APIs, in particular those that surface QOS

* Make the struct readonly

Co-Authored-By: migueldeicaza <miguel@gnome.org>

* Make the field read-only

Co-Authored-By: migueldeicaza <miguel@gnome.org>

* Add Qos to the list of accepted words

* To add a finalizer that can dispose the object, turn this into a class,
rather than being just a wrapper around the native handle.

* Fix copyright.

* Fix whitespace issues.

* Adjust visibility of existing DispatchBlock method we don't want to make public

* Refactor a bit.

* Make DispatchObject inherit from NativeObject to avoid some code duplication.
* Put all P/Invokes in BlockLiteral.
* Simplify block code somewhat.
* Sprinkle [BindingImpl (Optimizable)] where needed.
* Add both constructors and static Create methods to create DispatchBlocks.
* Add an explicit operator to get an Action delegate from a DispatchBlock, and
  an Invoke method to directly call said delegate.
* Add a few convenience API:
	* Wait with a TimeSpan overload.
	* Cancelled property.
	* Notify with an Action overload.

* Add some DispatchQueue overloads to make DispatchBlock actually usable.

* Seal DispatchBlock.

Users shouldn't subclass DispatchBlock.

* Add tests.

* DispatchBlockFlags is native-sized (nuint).

* Fix a few more nint issues.

* Add availability attributes.

* Fix introspection tests.

* Fix xtro.

* Fix xammac tests.
2019-01-17 18:40:58 +01:00
Sebastien Pouliot c1593fbd1f
[tests][intro] Adjust introspection to run without failure on iOS 6.1.6 (#4720) 2018-08-29 09:10:03 -04:00
Rolf Bjarne Kvinge 8040f2351d introspection: Adjust CMAttachmentTest for new CoreFoundation types. 2018-08-02 10:23:24 +02:00
Rolf Bjarne Kvinge 05340241ed Merge remote-tracking branch 'origin/xcode10' into xcode10-network 2018-08-01 17:10:36 +02:00
Manuel de la Pena 00eedb9381 [Network] Ensure NWAdvertiseDescriptor does take the type when exposing
a service.

As per documentation the NWAdvertiseDescriptor CreateBonjourService
should always get a type. Added the change which fixes the introspection
failures.
2018-08-01 16:55:06 +02:00
Miguel de Icaza 49bb4aa0ca Xcode10 CoreGraphics B1-B5 (#4198)
* [CoreGraphics] Add first batch of Xcode10 APIs, added an enum that we did not surface before

* [xcode10] CoreGraphics support

* Fix whitespace/formatting and add comma after last enum value.

* Make CFPropertyList follow normal INativeObject creation pattern.

* Make CFPropertyList.AsData return the error as a tuple.

* Fix CFPropertyList.AsData to not leak.

* CFPropertyList.Value: use Runtime.GetNSObject so that we don't accidentally create duplicate wrappers for the same native object.

* [CoreGraphics] Update to beta 5.

* Update xtro definitions.

* Add tests.

* Don't compare value type with null.

* Use PascalCase for named return tuples.

* [CoreFoundation] Make CFPropertyList enums native and fix code accordingly.

* [tests] Fix fetching 64-bit int to actually fetch a 64-bit int and not a nint.

* [tests] Teach introspection's ApiCMAttachmentTest about CFPropertyList.
2018-08-01 16:25:40 +02:00
miguel 70ffd63b05 Blindly try to get this to build 2018-07-27 08:49:07 -04:00
Miguel de Icaza 804e4f1e38 [tests] ApiCMAttachmentTest add custom tests for SecTrust2 and SecIdentity2 2018-07-26 14:54:09 -04:00
Miguel de Icaza 185a599ce8 [Network] Tests, use proper constructor 2018-07-25 11:43:00 -04:00
Miguel de Icaza 5555101333 Add using statements 2018-07-24 13:05:17 -04:00
miguel d3c5cececd [tests] add tests for the various Network constructors 2018-07-23 22:52:39 -04:00
Miguel de Icaza cd8e4a6f41 [Network, CoreFoundation] Fixes for the test suite 2018-07-23 16:20:19 -04:00
Miguel de Icaza 7207e1ea8a [Security, Network] address issues found by automatic instance creation 2018-07-19 12:08:48 -04:00
Sebastien Pouliot f4fccb09d7 [tvos][videotoolbox] Enable VideoToolbox.framework on tvOS (#1626)
This is just a build enablement to see xtro results. API adjustments,
including availability attributes, remains to be done.
2017-03-28 09:22:10 -05:00
Sebastien Pouliot c0d1ec3b7b [tests] Fix intro failures reported from iOS 6.1 and 7.1 devices (#629)
Also fix warnings printed while executing:

> CoreText performance note: Client called CTFontCreateWithName() using name "Arial" and got font with PostScript name "ArialMT". For best performance, only use PostScript names when calling this API.
> CoreText performance note: Set a breakpoint on CTFontLogSuboptimalRequest to debug.
2016-08-18 23:02:42 -04:00
Sebastien Pouliot 1c7cd140c0 [tests] Fix introspection failures when running on iOS 9.3 (#615)
* ApiCMAttachmentTest
 	[FAIL] ApiCMAttachmentTest.CheckFailAttachments :   CGColorConverter.Handle

* SKNode added conformance to new (in iOS10) UIFocus protocol.
	[FAIL] Selector not found for SpriteKit.SKNode : didUpdateFocusInContext:withAnimationCoordinator:
	[FAIL] Selector not found for SpriteKit.SKNode : setNeedsFocusUpdate
	[FAIL] Selector not found for SpriteKit.SKNode : shouldUpdateFocusInContext:
	[FAIL] Selector not found for SpriteKit.SKNode : updateFocusIfNeeded
	[FAIL] Selector not found for SpriteKit.SKNode : preferredFocusedView

* HKWorkoutEvent conformance to NSCopying is new in iOS10
	[FAIL] Selector not found for HealthKit.HKWorkoutEvent : copyWithZone:

* HKDocumentType was added in iOS 10 (not iOS 8) and not watchOS 2 or 3

	ref: +HK_CLASS_AVAILABLE_IOS_ONLY(10_0)

	[FAIL] iOSApiProtocolTest.ApiProtocolTest.Coding : ObjCRuntime.RuntimeException : Wrapper type 'HealthKit.HKDocumentType' is missing its native ObjectiveC class 'HKDocumentType'.
2016-08-16 19:07:01 -04:00
Sebastien Pouliot c9633e3515 [coregraphics] Update up to beta 5 (#599)
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
2016-08-12 13:45:09 +02:00
Manuel de la Pena 99a8468406 [Fix] Ensure that tests do not fail on iOS 8 by skipping a type that does not support the CMAttachment API. 2016-06-17 12:04:00 +02:00
Sebastien Pouliot 00ada0f773 Move parts of dontlink tests into new introspection tests (#32)
Those tests needs to be run with the linker disabled since they use
reflection for most of their work.

The original dontlink (for linker tests) was becoming too large in
some configuration (e.g. tvOS release with bitcode) but this was
due to other BCL assemblies (not the introspection tests)
2016-05-04 20:14:32 -04:00