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

809 Коммитов

Автор SHA1 Сообщение Дата
Manuel de la Pena ea1ca3dd5f
[Foundation] Expose the usage of cellular data in the NSUrlSessionHandler. (#6921)
* [foundation] Expose AllowsCellularAccess on NSUrlSessionHandler (#6059)

This property was always set to `true` but it can be useful to turn it
off (and that was not easy with the existing implementation)

* [Foundation] Ensure that we allow celullar data by default until the user says otherwise. #6762

The default value in the NSUrlSession is to allow cellular data. This
small change closes the issue, since users will not have an unexpected
result.

Later we need to provide a proper fix to allow the property to be
exposed AND used the value of the session.

Fixes: https://github.com/xamarin/xamarin-macios/issues/6762
2019-09-05 19:11:30 -04:00
Manuel de la Pena 4a08c6c7b2
[Foundation] Ensure that we allow celullar data by default until the user says otherwise. #6762 (#6916)
* [Foundation] Ensure that we allow celullar data by default until the user says otherwise. #6762

The default value in the NSUrlSession is to allow cellular data. This
small change closes the issue, since users will not have an unexpected
result.

Later we need to provide a proper fix to allow the property to be
exposed AND used the value of the session.

Fixes: https://github.com/xamarin/xamarin-macios/issues/6762
2019-09-05 16:03:10 -04:00
Rolf Bjarne Kvinge 650768c059
[monotouch-test] Apple has fixed a crash in the ImageCaptioningTest, so update the test accordingly. (#6905)
* [monotouch-test] Apple has fixed a crash in the ImageCaptioningTest, so update the test accordingly.

Apple has fixed a crash we ran into with the ImageCaptioningTest, so now we
can re-enable the code that caused the crash.

* Fix test in the simulator.

* Fix test build failure for Xamarin.Mac.
2019-09-05 03:01:37 -07:00
Rolf Bjarne Kvinge 678a422604
[registrar] Ignore method encodings when processing copyback arguments in the dynamic registrar. Fixes #6883. (#6904)
Method encodings do not change anything for us, so skip them when processing
copyback arguments so that they don't confuse the rest of the code.

Fixes https://github.com/xamarin/xamarin-macios/issues/6883.
2019-09-04 07:02:33 -07:00
Rolf Bjarne Kvinge 007f1e6882
[tests] Skip font manager test in OS versions where it crashes due to bugs in the OS. (#6894)
Calls to CTFontManagerRegisterFontDescriptors with a null callback will crash
unless on iOS 13.1, so don't run this test on earlier OS versions.

Also update AssertXcodeVersion to cope with Xcode 11.1, which is unfortunately
just guesswork until an actual Xcode 11.1 is released (currently we can't
distinguish between iOS 13.0 and iOS 13.1 using the Xcode version, because
Xcode 11b7 supports them both, so for now we assume there will be an Xcode
11.1 which will support iOS 13.1).
2019-09-03 05:43:01 -07:00
monojenkins 4b046c57db [tests] Change URL for UrlSessionTest.CreateDataTaskAsync (#6891)
The current https://www.xamarin.com is being redirected to https://dotnet.microsoft.com/apps/xamarin but it takes a long time to completely load (not sure why) and that could be why we fail since we have a 30 seconds timeout - and it took more than that to (stop) load into safari.

Switching to https://www.microsoft.com/ is a lot faster and seems to fix the issue.

Reference:
https://github.com/xamarin/maccore/issues/1939
2019-09-03 05:06:01 -07:00
Sebastien Pouliot 9e193eaca3
[foundation] Add support for NSValue/CGAffineTransform and StoreValueAtAddress overload (#6887)
Support for `NSValue`/`CGAffineTransform` exists in iOS/tvOS/watchOS,
from UIKit, but not for macOS. However this will be required for the
new protocols inside CoreImage.

Also add an overload for `StoreValueAtAddress` since the original
one was deprecated but we did not provide the new alternative to
update the code.
2019-08-30 18:00:04 -04:00
Sebastien Pouliot 7c5ad429c2
[tests] Change URL for UrlSessionTest.CreateDataTaskAsync (#6890)
The current https://www.xamarin.com is being redirected to https://dotnet.microsoft.com/apps/xamarin but it takes a long time to completely load (not sure why) and that could be why we fail since we have a 30 seconds timeout - and it took more than that to (stop) load into safari.

Switching to https://www.microsoft.com/ is a lot faster and seems to fix the issue.

Reference:
https://github.com/xamarin/maccore/issues/1939
2019-08-30 17:58:07 -04:00
Rolf Bjarne Kvinge 344dadb212
Bump the minimum iOS version to 7.0. Fixes #6213. (#6878)
Xcode 11 doesn't support anything below iOS 7.0 (the linker will automatically
change the deployment target to 7.0), so we need to drop support as well
(since our native bits will be targetting iOS 7.0, and we can't change that).

https://github.com/xamarin/xamarin-macios/issues/6213
2019-08-30 01:07:30 -07:00
monojenkins b27cdc7d47 [xcode11] [monotouch-test] Attempt to fix AudioQueueTest.ChannelAssignments (#6873)
Attempt to fix the usage of AudioQueue.ChannelAssignments so that it follows
Apple's (incomplete) documentation.

- Fixes https://github.com/xamarin/maccore/issues/1623.
2019-08-29 14:15:12 -04:00
Rolf Bjarne Kvinge ec09193daf
Build native code with -std=c++14. (#6864)
* Build native code with -std=c++14.

Apple's headers now require -std=c++14 to compile their headers in C++ mode.

This fixes a compile error that would occur with the PhotosUI framework when
compiling code for C++.

* [mmp] Use -std=c++14 when compiling.

* Fix command line output.

* [mmp] Add all source files at the end, so they all get the -x clang argument applied.

* Limit when using c++14 in mtouch according to language.
2019-08-29 08:49:06 -07:00
Sebastien Pouliot 1b8bb4b5c8
[security] Partial updates for Xcode 11 (up to beta 7) (#6867)
This includes some (3) older, unbound API from Xcode 10 and earlier.
It also move some (one) new API to the ignore list.
2019-08-29 08:17:06 -04:00
Rolf Bjarne Kvinge 73ce0f8882
[registrar] Fix verification of generic parameters to accept unrelated generic types. Fixes #6687. (#6850)
* [registrar] Fix verification of generic parameters to accept unrelated generic types. Fixes #6687.

When we export generic classes to Objective-C, we verify that any generic
parameters are constrained so that we know how to handle them.

Example:

    class MyObj<T> : NSObject where T: NSObject
    {
        [Export ("foo:")]
        public void Foo (T obj);
    }

in this case we verify that the parameter T is constrained to NSObject, so
that we can treat the argument like an NSObject.

The problem was when the function contained a generic type which was not
related to T:

    class MyObj<T> : NSObject where T: NSObject
    {
        [Export ("foo:")]
        public void Foo (Action<int> obj);
    }

in which case the same logic would kick in and reject the Action<int> type
since it's not related to NSObject (no generic arguments could be found, and
the default response was 'not valid').

So I've changed the default response for generic types that are unrelated to
the generic parameter we're verifying to accept such types.

Fixes https://github.com/xamarin/xamarin-macios/issues/6687.

* No need to use a UIViewController as the super class, NSObject works just fine for this test.

Fixes the test build on macOS.
2019-08-27 06:41:17 -07:00
Vincent Dondain 66698b49f3
[monotouch-test] Ignore FontManagerTest's RegisterFontDescriptors_WithCallback (#6833)
This test started failing on iOS 13 beta 5. It is still failing on beta 7.
This test is designed to fail at every new iOS version until it's fixed by Apple.
Let's ignore it for good, mention it in https://github.com/xamarin/xamarin-macios/issues/6212 and check it one last time at GM.
2019-08-23 10:38:49 -04:00
Vincent Dondain b02605834c [monotouch-test] Fix PinAnnotationViewTest's InitWithFrame (#6823)
FYI iOS 13 changed the tint color for the red pin, it's now (255, 69, 58, 255) instead of (255, 59, 48, 255).
Let's not test iOS colors for Apple (:
A simple NotNull check should be enough.
2019-08-22 12:15:56 +02:00
Vincent Dondain 37e7023a0a
[tests] Add check for bluetooth permission (#6796) 2019-08-21 06:40:56 -04:00
Sebastien Pouliot 4b61850243
[xcode11] Bump for beta 6 (#6798)
AVFoundation crash added to https://github.com/xamarin/xamarin-macios/issues/6212
2019-08-20 10:06:18 -04:00
Sebastien Pouliot 61c8af15d1
[naturallanguage] Update for Xcode 11 beta 1 (#6741)
No change in beta 2 to 5

* Run EmbeddingTest.Vector test on iOS and macOS only

reference: rdar 44948030

> Engineering has the following feedback for you: The tagging
> depends on the NLP assets being present on the device. The
> assets get downloaded through OTA. OTA download for NLP assets
> does not exist on watchOS and tvOS currently…only on iOS and
> macOS. It is conceivable that the assets got downloaded when you
> were on WiFi at a later point. So, the tagging should work.
2019-08-12 11:07:15 -04:00
Sebastien Pouliot 193ae8bfdf
[mediaaccessibility] Update for Xcode 11 beta 5 (#6733) 2019-08-07 19:40:32 -04:00
monojenkins eb77564659 [xcode11] Fix NLLanguageRecognizer crash (#6732)
The dispose of `nslang` was happening outside of the check if `nslang` is null. This was causing a crash when trying to recognise a string that contains just one number.
2019-08-07 13:08:27 -04:00
Sebastien Pouliot a45fd083b5
[coretext] Update for Xcode 11 beta 5 (#6731)
Beta 4 added some new API and constants
Beta 5 removed `CTFontManagerCopyRegisteredFontDescriptors` from all OS but iOS
2019-08-07 13:07:42 -04:00
Juxhin (Eugene) Bakalli 42311ca7ec Fix NLLanguageRecognizer crash (#6689)
The dispose of `nslang` was happening outside of the check if `nslang` is null. This was causing a crash when trying to recognise a string that contains just one number.

Fixes: https://github.com/xamarin/xamarin-macios/issues/6688
2019-08-07 16:44:41 +02:00
Whitney Schmidt 7b63a38698
[HealthKit] updates for beta 1 - beta 4 xcode11 (#6692)
* healthkit b1-b3 updates

* fixes for first round of comments

* remove whitespace noise

* move hkcategorytype enums

* update mono-touch tests, remove [designatedinitializer] attr

* alex nit fixes

* fix formatting for [Deprecated]

* update mono-touch tests with even more enums

* InsertQuantity -> Insert

* remove references to xcode13, which does not exist

* add HKCharacteristicTypeIdentifierActivityMoveMode to .ignore files
2019-08-02 14:06:22 -04:00
Alex Soto 54c58a2a43
[tests] Fix api tests in macOS 10.15 (#6701)
Fixes

```
RegisterFontDescriptors_WithCallback (MonoTouchFixtures.CoreText.FontManagerTest.RegisterFontDescriptors_WithCallback)
System.NotImplementedException : The method or operation is not implemented.
    at TestRuntime.CheckExactXcodeVersion (System.Int32 major, System.Int32 minor, System.Int32 beta) [0x00185] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/common/TestRuntime.cs:175
    at MonoTouchFixtures.CoreText.FontManagerTest.RegisterFontDescriptors_WithCallback () [0x0000b] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/monotouch-test/CoreText/FontManagerTest.cs:225
    at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
    at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.99.2.30/src/Xamarin.Mac/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:391
```
2019-08-02 08:19:21 -04:00
Alex Soto d10d7f0370
[xcode11] Bump to Xcode 11 Beta 5 (#6684)
* [xcode11] Bump to Xcode 11 Beta 5
2019-07-30 14:16:44 -04:00
monojenkins 407d1100e4 [Tests] Ignore some tests on the CI due to the settings of the bots. (#6672)
In some cases some bots will return a proxy present, not because of the
PAC being parsed, but due to the bot settings. Ignore the tests that
expect no proxies in the CI fixes the issue.

Fixes https://github.com/xamarin/maccore/issues/1901
2019-07-29 13:55:56 +02:00
Manuel de la Pena 626799bdae
[Tests] Ignore some tests on the CI due to the settings of the bots. (#6671)
In some cases some bots will return a proxy present, not because of the
PAC being parsed, but due to the bot settings. Ignore the tests that
expect no proxies in the CI fixes the issue.

Fixes https://github.com/xamarin/maccore/issues/1901
2019-07-29 13:55:30 +02:00
monojenkins 582ac0ac78 [d16-3] [CFNetwork] Expose methods that were ignored until the dependencies were present. (#6668)
We can know expose the methods. Bindings had to be updated considering
the fact that we have a scrut and the type of callbacks.

Fixes: https://github.com/xamarin/xamarin-macios/issues/6195
2019-07-29 11:23:33 +02:00
Manuel de la Pena e8eec97d20
[CFNetwork] Expose methods that were ignored until the dependencies were present. (#6201)
Expose methods to allow users query PAC files to get proxy settings.
2019-07-26 21:21:03 +02:00
Rolf Bjarne Kvinge 0827ab4f21
[xammac tests] Silence debug spew. (#6650) 2019-07-25 03:33:29 -07:00
Alex Soto d095f75471
[registrar] Fix a generics type issue with dynamic registrar (#6646)
* [registrar] Fix a generics type issue with dynamic registrar

Fixes xamarin/xamarin-macios#6567

This Fixes an issue in the registrar where the dynamic registrar
misses a case to check for a NSObject constraint triggered by UIKit's
`NSDiffableDataSourceSnapshot` object.

This also enables the rest of missing bindings in UIKit for Xcode 11 B4
which also works as a test case for the registrar fix. Without this fix
introspection test would throw an `AggregateException` and also
includes `NSDiffableDataSourceSnapshotTest` to check that the created
objects are usable.

* Check for Xcode 11 in tests

* Exclude the macOS in our UIKit tests ツ
2019-07-25 05:56:39 -04:00
Rolf Bjarne Kvinge 5f6e2db886
[monotouch-test] Ignore the FontManagerTest.RegisterFontDescriptors_NoCallback test, it may crash. (#6639)
This fixes a crash when running xammac tests on macOS 10.15.
2019-07-24 07:10:39 -07:00
Rolf Bjarne Kvinge dc2c269f40
[tests] Use built-in feature checks to check for API non-crashyness. (#6640)
This also required adding a few missing Metal version enum values.

Fixes https://github.com/xamarin/maccore/issues/1800.
Fixes https://github.com/xamarin/maccore/issues/1801.
2019-07-24 07:10:10 -07:00
Sebastien Pouliot 364870489e
[corelocation] Update for Xcode 11 beta 1 to 4 (#6600)
No change in beta 3 and 4
2019-07-18 14:16:07 -04:00
Sebastien Pouliot 7fcd8d7974 Bump for Xcode 11 beta 4 (#6603)
* Bump for Xcode 11 beta 4

xtro tests will fail until we have an update for sharpie, however
the introspection tests should be fine (with the small changes in
arkit.cs and uikit.cs)

xtro failure:

```
System.NotImplementedException: AVAudioInteger
  at (wrapper managed-to-native) Clang.Ast.AstReader.LoadInternal(Clang.Ast.AstReader,string)
  at Clang.Ast.AstReader.Load (System.String astPath) [0x00014] in /Users/builder/vsts-agent/_work/5/s/Clang/Ast/AstReader.cs:33
  at Extrospection.Runner.Execute (System.String pchFile, System.Collections.Generic.IEnumerable`1[T] assemblyNames) [0x0019a] in /Users/poupou/git/xcode11/xamarin-macios/tests/xtro-sharpie/Runner.cs:54
  at Extrospection.MainClass.Main (System.String[] args) [0x00046] in /Users/poupou/git/xcode11/xamarin-macios/tests/xtro-sharpie/Program.cs:20
```

due to

```diff
-typedef CF_ENUM(NSInteger, AVAudioSessionErrorCode) {
+typedef CF_ENUM(AVAudioInteger, AVAudioSessionErrorCode) {
```
https://github.com/xamarin/xamarin-macios/wiki/CoreAudioTypes-iOS-xcode11-beta4

* [tests] CoreText stopped reporting error when font files are missing

* Fix xtro (EnumCheck.cs) and update its data files

* Fix xtro results (due to some local changes)
2019-07-18 05:44:34 -04:00
Sebastien Pouliot e6e428393d
[coretext] Update for Xcode 11 beta 1-3 (#6562)
includes unit tests
2019-07-15 13:06:56 -04:00
Alex Soto 2d53b90723
[UIKit] Partial update to Xcode 11 Beta 1, 2 and 3 - Part 2 of ? (#6553)
* [UIKit] Partial update to Xcode 11 Beta 1, 2 and 3 - Part 2 of ?

Missing bindings for

* NSDiffableDataSourceSnapshot
* UICollectionViewDiffableDataSource
* UITableViewDiffableDataSource

due to a registrar issue git generics.

* Update src/UIKit/UIFont.cs

Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Update src/uikit.cs

* More feedback

This also disables

* FloatRangeTest.Equals
* FloatRangeTest.ManagedVersusNative

due to https://github.com/xamarin/maccore/issues/1885

* [UIKIt] Start fixing `UITextWritingDirection` situation

But the complete fix is for another time https://github.com/xamarin/xamarin-macios/issues/6573
2019-07-12 13:44:24 -04:00
Rolf Bjarne Kvinge 18321c6069
[xammac_tests] Fix a few issues after the latest beta. Fixes xamarin/maccore#1886. (#6575)
* [monotouch-test] Adjust EventKitCalendarTest for the latest Xcode 11 beta (3). Partial fix for xamarin/maccore#1886.
 
Partial fix for https://github.com/xamarin/maccore/issues/1886.

* [xammac_tests] Add missing resources files. Partial fix for xamarin/maccore#1886.

Partial fix for https://github.com/xamarin/maccore/issues/1886.

Fixes https://github.com/xamarin/maccore/issues/1886.
2019-07-12 09:12:10 -07:00
Rolf Bjarne Kvinge 121f04ce3d
[tests] Improve handling of permission dialogs. Fixes xamarin/maccore#1856. (#6544)
* macOS 10.15 starts putting up permission dialogs we can't automatically
  dismiss anymore, so start honoring the 'IncludeSystemPermissionTests' option
  for macOS tests.
* Improve the 'IncludeSystemPermissionTests' option to have three states: if
  set (either true or false), that takes precedence, but if not set, we now
  don't run any tests that require permission dialogs on macOS or on device if
  we're running in CI. Tests executed locally will still put up dialogs, both
  on macOS and on device.
* This needed a few changes to the html report, since the
  'IncludeSystemPermissionTests' is exposed in the UI and the code didn't
  handle the three different states.
* Update a few tests to check for permission to the contacts.

Fixes https://github.com/xamarin/maccore/issues/1856.
2019-07-12 07:05:57 -07:00
Rolf Bjarne Kvinge e8254d4110
Merge pull request #6559 from rolfbjarne/maccore-issue-1880
[xcode11] Fix monotouch-test to not crash on device.
2019-07-11 23:03:08 -07:00
Manuel de la Pena 7e96b317e8
[CoreMedia] Add support for CoreMedia on Xcode 11 beta 3. (#6513) 2019-07-11 20:14:58 +02:00
Rolf Bjarne Kvinge 612a74a0fd [monotouch-test] Don't try to set image captions on read-only files.
iOS will helpfully crash.
2019-07-11 19:04:14 +02:00
Rolf Bjarne Kvinge 8ab907a91e [monotouch-test] Don't check for the macOS system version when running on other platforms. 2019-07-11 19:04:14 +02:00
Rolf Bjarne Kvinge d457122ad2 [monotouch-test] Add permission description for CoreBluetooth. Fixes xamarin/maccore#1880.
Fixes https://github.com/xamarin/maccore/issues/1880.
2019-07-11 19:04:14 +02:00
monojenkins a7f4c7011e [registar] Search the entire interface hierarchy for protocols. Fixes #6493. (#6524)
When we're searching for metadata for marshalling blocks, we must search the
entire interface hierarchy for protocols that implement optional members.

Fixes https://github.com/xamarin/xamarin-macios/issues/6493.
2019-07-09 06:50:55 -07:00
Rolf Bjarne Kvinge 0ceced29a9
[registar] Search the entire interface hierarchy for protocols. Fixes #6493. (#6514)
When we're searching for metadata for marshalling blocks, we must search the
entire interface hierarchy for protocols that implement optional members.

Fixes https://github.com/xamarin/xamarin-macios/issues/6493.
2019-07-08 08:41:55 -07:00
Rolf Bjarne Kvinge ebb66da865
[CoreMidi] Fix creating a native MidiThruConnectionParamsStruct. (#6505)
Make sure to advance the target pointer after writing each map array.
2019-07-07 23:30:37 -07:00
Rolf Bjarne Kvinge ad0d4bad4b
[monotouch-test] Disable the MidiThruConnectionTests tests, they're randomly failing. (#6506)
Ref: https://github.com/xamarin/maccore/issues/1834
2019-07-05 08:12:24 -07:00
Sebastien Pouliot 9c3db5e889
[javascriptcore] Update for Xcode 11 beta 3 (#6499) 2019-07-05 09:22:11 -04:00
Sebastien Pouliot 22b5ac5653
[wkwebkit] Update for Xcode 11 beta 3 (#6496)
- Beta 3 fixed the umbrella header (https://github.com/xamarin/maccore/issues/1781) so the API, from beta 1, are now included
- `NSAttributedString` additions are a category (in ObjC) with only static members so they were inlined in Foundation (as suggested by btouch)
- `NSReadAccessURLDocumentOption` does not seem to work like the headers mention (waiting for real doc to appear). Unit test added.
2019-07-04 13:08:21 -04:00
Sebastien Pouliot 4a704e448e
[httpclient] Change NSUrlSessionHandler and CFNetworkHandler to throw HttpRequestException. Fix #6439 (#6477)
Our 3 different handlers were inconsistent with each others. Only the
managed version, `HttpClientHandler`, was throwing the documented
`HttpRequestException` exception.

The inconsistency make this hard to consume from .net standard libraries
even more when the type is not, itself, available in .net standard

stack trace (for NSUrlSessionHandler)

```
2019-07-02 10:58:08.352 gh6439[18579:15880723] System.Net.WebException: The Internet connection appears to be offline. ---> Foundation.NSErrorException: Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283b6d350 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <55894EBD-B898-4803-9981-46317EEFE280>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <55894EBD-B898-4803-9981-46317EEFE280>.<1>"
), NSLocalizedDescription=The Internet connection appears to be offline., NSErrorFailingURLStringKey=https://www.microsoft.com/fr-ca/, NSErrorFailingURLKey=https://www.microsoft.com/fr-ca/, _kCFStreamErrorDomainKey=1}
   --- End of inner exception stack trace ---
  at System.Net.Http.NSUrlSessionHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x001d4] in /Users/poupou/git/xcode11/xamarin-macios/src/Foundation/NSUrlSessionHandler.cs:541
  at System.Net.Http.HttpClient.SendAsyncWorker (System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken) [0x0009e] in /Users/poupou/git/xcode11/xamarin-macios/external/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs:281
```

stack trace (for CFNetworkHandler)

```
2019-07-02 11:04:35.407 gh6439[18580:15881497] CoreFoundation.CFException: The operation couldn’t be completed. Network is down
  at System.Net.Http.CFNetworkHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken, System.Boolean isFirstRequest) [0x002f2] in /Users/poupou/git/xcode11/xamarin-macios/src/System.Net.Http/CFNetworkHandler.cs:266
  at System.Net.Http.CFNetworkHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x00034] in /Users/poupou/git/xcode11/xamarin-macios/src/System.Net.Http/CFNetworkHandler.cs:199
  at System.Net.Http.HttpClient.SendAsyncWorker (System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken) [0x0009e] in /Users/poupou/git/xcode11/xamarin-macios/external/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs:281
```

references:
* https://github.com/xamarin/xamarin-macios/issues/6439
* https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient.postasync?view=netstandard-2.0#System_Net_Http_HttpClient_PostAsync_System_String_System_Net_Http_HttpContent_System_Threading_CancellationToken_
2019-07-04 09:50:27 -04:00
Vincent Dondain 85c955d0b2 [arkit] Update for Xcode 11 beta 2 and beta 3 (#6460) 2019-07-04 07:33:37 +02:00
Sebastien Pouliot 71a657d2c5
Bump for Xcode 11 beta 3 (#6480) 2019-07-02 23:34:24 -04:00
Manuel de la Pena 1416e4a945
[AudioToolBox] [AudioUnit] Add support for Xcode 11 beta 1 & beta 2. (#6434)
Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>
2019-07-02 15:55:24 +02:00
Manuel de la Pena fa78fb38d0
[BackgroundTasks] Add new Framework for Xcode 11 beta 1. (#6438) 2019-07-02 15:54:21 +02:00
Jonathan CONTE a2fc99458b [Tests][MapKit/PinAnnotationView] Changed assertion of PinTintColor property to work on other language than English (#6463)
Ensure that assertion is done to a know value to reduce the change of the test failing in case of a device being configured in a diff locale. 

Fixes issue $4114
2019-07-01 23:08:49 +02:00
Sebastien Pouliot e28a0810aa
[mediaaccessibility] Update for Xcode 11 beta 1 (#6457)
No change in beta 2

Unit tests added - but new API behaviour is not quite what I expected.
Maybe future docs will make this clearer...
2019-06-28 13:31:53 -04:00
Rolf Bjarne Kvinge da0793775e Merge remote-tracking branch 'origin/xcode11' into issue-6222-xcode11 2019-06-28 07:50:14 +02:00
Rolf Bjarne Kvinge 6e5ec5b5a4
[tests] Ignore all compiler warnings in apitest, introspection, monotouch-test and xammac tests. (#6430)
Nobody cares about them anyway, and they keep filling my terminal with useless
text.
2019-06-27 15:34:36 +02:00
Rolf Bjarne Kvinge f934cd7bee [monotouch-test] Adjust a few more tests for macOS 10.15. 2019-06-27 13:49:37 +02:00
Rolf Bjarne Kvinge 0a3555fd36 [monotouch-test] Workaround a Catalina crash. Fixes #6425.
Fixes https://github.com/xamarin/xamarin-macios/issues/6425.
2019-06-26 14:17:14 +02:00
Rolf Bjarne Kvinge 58fcbe0189 [monotouch-test] Don't test API that crashes. 2019-06-26 14:17:14 +02:00
Rolf Bjarne Kvinge 46f098349e [tests] Version check fixes. 2019-06-26 10:15:46 +02:00
Rolf Bjarne Kvinge 85ec17a506
[Network] Improve bindings for NWProtocolMetadata. (#6389)
* [Network] Improve bindings for NWProtocolMetadata.

It turns out the NWProtocolMetadata can contain metadata for different
protocols (Ip/Tls/Tcp). This is important; if someone tries to get a value for
one protocol and the metadata is for another protocol, then they invoke the
wrath of superior beings who will smite that poor someone with uninitialized
memory.

At that point there's not much left but to pray.

I don't like to depend on divine intervention, so I've modified the API here
to check if the metadata's protocol is the required type for the native API
we're calling, and if the check fails, we throw a nice and dependable managed
exception.

This is a functional breaking change; but if there are any lost souls who
likes to pray, they can always re-implement the P/Invokes themselves and skip
the sanity checks.

In addition I've renamed a few properties whose name didn't clearly specify
which protocol type they operate on.

Ref: Apple feedback FB6155967.
Ref: https://trello.com/c/1TW0BSKJ/145-fb6155967-nwipcreatemetadata-returns-uninitialized-metadata-in-ios-13

* Fix casing in exception message.

* [tests] Adjust the SecProtocolMetadataTest according to new knowledge about the Network API.

* Fix alternative property name in obsolete attribute.
2019-06-21 15:00:19 +02:00
Rolf Bjarne Kvinge 523349bf69 Merge remote-tracking branch 'origin/d16-2' into xcode11-bump-mono-d16-2 2019-06-20 10:27:04 +02:00
Rolf Bjarne Kvinge f9d39c640b
Merge pull request #6164 from monojenkins/backport-pr-6159-to-d16-2
[d16-2] [Metal] Sprinkle [return: Release] on all 'new*' selectors. Fixes #5941.
2019-06-19 17:29:43 +02:00
Sebastien Pouliot fee66b3505
[coregraphics] Update for Xcode 11 beta 1 and 2 (#6337)
along with unit tests for p/invokes
2019-06-18 17:59:08 -07:00
Vincent Dondain a797ea1fd3
Bump for Xcode 11 beta 2 (#6341)
- [tests] Fix PassKit monotouch-test
2019-06-18 15:34:07 -04:00
Manuel de la Pena fb8db95764
[Test][Security] Ensure that test does not fail depending on the device lang. (#6299)
We have a test that depends on the lang of the device. If the device is
not using 'en' set it as inconclusive.

Fixes https://github.com/xamarin/xamarin-macios/issues/6298
2019-06-17 16:21:54 +02:00
Rolf Bjarne Kvinge 8e4067d486 [monotouch-test] Fix another case of Photos framework's problems. 2019-06-14 20:02:27 +02:00
Rolf Bjarne Kvinge f0958ac24f [monotouch-test] Workaround issue with UIPasteboard.General.Images.
Ref: 71f9341c59
Ref: https://github.com/xamarin/xamarin-macios/issues/6254
2019-06-14 20:02:27 +02:00
Rolf Bjarne Kvinge 1d85078962 [monotouch-test] Adjust tests to cope with changes in Xcode 11 beta 1. 2019-06-14 20:02:27 +02:00
Sebastien Pouliot 1b02f0f616
[tests] Fix monotouch-test for "iOS Unified 32-bits - simulator" | "Release (all optimizations)" (#6281)
Photos.framework headers are broken in Xcode 11 beta 1 [1]. Optimizations
fails since the static registrar skip over the type [2]

```
	[FAIL] PHLivePhotoEditingContextTest.Linker : ObjCRuntime.RuntimeException : Can't register the class Photos.PHContentEditingInput when the dynamic registrar has been linked away.
		  at ObjCRuntime.Class.GetClassHandle (System.Type , System.Boolean , System.Boolean& ) [0x000de] in <d93fa0efd60442128943a9eb0e82eb8d>:0
		  at ObjCRuntime.Class.GetClassHandle (System.Type ) [0x00000] in <d93fa0efd60442128943a9eb0e82eb8d>:0
		  at ObjCRuntime.Class.GetHandle (System.Type ) [0x00000] in <d93fa0efd60442128943a9eb0e82eb8d>:0
		  at Foundation.NSObject.AllocIfNeeded () [0x00019] in <d93fa0efd60442128943a9eb0e82eb8d>:0
		  at Foundation.NSObject..ctor (Foundation.NSObjectFlag ) [0x00006] in <d93fa0efd60442128943a9eb0e82eb8d>:0
		  at Photos.PHContentEditingInput..ctor () [0x00000] in <d93fa0efd60442128943a9eb0e82eb8d>:0
		  at MonoTouchFixtures.Photos.PHLivePhotoEditingContextTest.Linker () [0x00001] in <6e792af97a28410a80fa790ecfb26b9c>:0
		  at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
		  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object , System.Reflection.BindingFlags , System.Reflection.Binder , System.Object[] , System.Globalization.CultureInfo ) [0x0006a] in <3440dfbcd957471aabeed02fbc939d2a>:0
PHLivePhotoEditingContextTest : 2 ms
```

references
[1] https://github.com/xamarin/xamarin-macios/issues/6212
[2] 60a5392d35
2019-06-13 13:15:28 -04:00
monojenkins 4c6ea0d2c3 [d16-2] [Tests] Try different urls before failing the test. (#6265)
Use a list of urls to try several times.

Related issue: https://github.com/xamarin/maccore/issues/1725
2019-06-12 12:45:22 -07:00
Sebastien Pouliot bf44459d8a Merge branch 'd16-2' into xcode11-d16-2-20190611 2019-06-11 13:23:04 -04:00
Manuel de la Pena 46c16eb440
[Tests] Try different urls before failing the test. (#6237)
We do have a test that fails when there are issues accessing the remote
resource. Try different urls to ensure that it is not a network issue with a specific domain.

Fixes: https://github.com/xamarin/maccore/issues/1725
2019-06-11 19:04:42 +02:00
monojenkins 9b9e57b80d [monotouch-test] Ignore MessageHandlerTest.RejectSslCertificatesServicePointManager on macOS 10.10. (#6219)
This works around (but doesn't fix) https://github.com/xamarin/maccore/issues/1645.
2019-06-07 14:25:26 -07:00
Rolf Bjarne Kvinge 8e2bbe8d2d
[monotouch-test] Attempt to fix AudioQueueTest.ChannelAssignments. Fixes xamarin/maccore#1623. (#6184)
* [monotouch-test] Attempt to fix AudioQueueTest.ChannelAssignments. Fixes xamarin/maccore#1623.

Attempt to fix the usage of AudioQueue.ChannelAssignments so that it follows
Apple's (incomplete) documentation.

Fixes https://github.com/xamarin/maccore/issues/1623.

* Simplify a little bit.
2019-05-30 23:33:33 -07:00
Rolf Bjarne Kvinge 9ed942659d Simplify nested usings. 2019-05-31 06:32:58 +00:00
Rolf Bjarne Kvinge 222a482fea Fix whitespace. 2019-05-31 06:32:58 +00:00
Rolf Bjarne Kvinge 40096a1eaf [tests] Use a higher offset when calling MTLBuffer.CreateTexture to try to comply with the requirements for the API.
Hopefully fixes this assertion:

> 07:42:06.7701360 validateStrideTextureParameters:1512: failed assertion `Linear texture: bytesPerRow (64) must be aligned to 256 bytes'

which doesn't happen on my machine.
2019-05-31 06:32:58 +00:00
Rolf Bjarne Kvinge 16e1b85289 [tests] MTLFunctionConstantValues didn't have a default ctor until Xcode 9. 2019-05-31 06:32:58 +00:00
Rolf Bjarne Kvinge 96517671f6 [Metal] Sprinkle [return: Release] on all 'new*' selectors. Fixes #5941.
Also add tests for all the API I could figure out how to use.

Fixes https://github.com/xamarin/xamarin-macios/issues/5941.
2019-05-31 06:32:58 +00:00
Rolf Bjarne Kvinge 6be7597912
[monotouch-test] Ignore MessageHandlerTest.RejectSslCertificatesServicePointManager on macOS 10.10. (#6181)
This works around (but doesn't fix) https://github.com/xamarin/maccore/issues/1645.
2019-05-30 12:45:58 -07:00
Rolf Bjarne Kvinge ad6ae52e1b
[tests] Only call MTLDevice.CreateSharedTexture macOS 10.14+. Fixes xamarin/maccore#1663. (#6180)
Fixes https://github.com/xamarin/maccore/issues/1663.
2019-05-30 12:39:21 -07:00
Rolf Bjarne Kvinge 72d7a8ad9b Merge remote-tracking branch 'origin/master' into binary-artifacts 2019-05-30 07:25:03 +02:00
Rolf Bjarne Kvinge 0ce0010824
[Metal] Sprinkle [return: Release] on all 'new*' selectors. Fixes #5941. (#6159)
* [Metal] Sprinkle [return: Release] on all 'new*' selectors. Fixes #5941.

Also add tests for all the API I could figure out how to use.

Fixes https://github.com/xamarin/xamarin-macios/issues/5941.

* [tests] MTLFunctionConstantValues didn't have a default ctor until Xcode 9.

* [tests] Use a higher offset when calling MTLBuffer.CreateTexture to try to comply with the requirements for the API.

Hopefully fixes this assertion:

> 07:42:06.7701360 validateStrideTextureParameters:1512: failed assertion `Linear texture: bytesPerRow (64) must be aligned to 256 bytes'

which doesn't happen on my machine.

* Fix whitespace.

* Simplify nested usings.

* Fix availability correctly.
2019-05-29 22:06:14 -07:00
Rolf Bjarne Kvinge b3c3ad8724 Simplify nested usings. 2019-05-29 19:27:21 +00:00
Rolf Bjarne Kvinge cf4e9e45df Fix whitespace. 2019-05-29 19:27:21 +00:00
Rolf Bjarne Kvinge b88015eabc [tests] Use a higher offset when calling MTLBuffer.CreateTexture to try to comply with the requirements for the API.
Hopefully fixes this assertion:

> 07:42:06.7701360 validateStrideTextureParameters:1512: failed assertion `Linear texture: bytesPerRow (64) must be aligned to 256 bytes'

which doesn't happen on my machine.
2019-05-29 19:27:21 +00:00
Rolf Bjarne Kvinge b79d5e89cc [tests] MTLFunctionConstantValues didn't have a default ctor until Xcode 9. 2019-05-29 19:27:21 +00:00
Rolf Bjarne Kvinge 6a4cdb6a6d [Metal] Sprinkle [return: Release] on all 'new*' selectors. Fixes #5941.
Also add tests for all the API I could figure out how to use.

Fixes https://github.com/xamarin/xamarin-macios/issues/5941.
2019-05-29 19:27:21 +00:00
Alexander Köplinger 8627c4311a Merge remote-tracking branch 'upstream/master' into binary-artifacts 2019-05-24 20:27:09 +02:00
Alexander Köplinger f1a2264350 Use some remaining test .cs files from the ios-sources dir in the mono archive
Would be nice to get rid of this, but I don't have time right now.
2019-05-24 20:26:50 +02:00
monojenkins aab104dd1a [d16-2] [xharness] Don't use a dash in the bundle identifer for watchOS projects. (#6118)
* [xharness] Don't use a dash in the bundle identifer for watchOS projects.

It causes problems with the mscorlib test project, which can't be launched properly.

I'm not sure what's the underlying cause, but here are some of the symptoms:

* The watch app actually shows up fine on the device, but:
* mlaunch isn't notified about the new process, so it thinks the app didn't
  launch.
* The new process doesn't receive any environment variables we try to give it,
  which for instance means that it won't auto-start the tests upon launch.
* If we ask mlaunch to attach with lldb, mlaunch will ask watchOS to launch
  the process in a suspended state while lldb attaches. Yet the watch app
  shows up on the device as if not asked to be suspended upon launch.

It seems that the dash (I assume, because I haven't investigated this very
deeply, I just happened to find a solution that worked) makes watchOS launch
the app as if tapped, instead of launched from an IDE.

The strangest part is that this only happens with the mscorlib test project,
not any of the other test projects we run on the watch, and they all have
dashes in their bundle identifiers... yet replacing the dash with another
character (underscore, letter, removing it altogether) all made things work as
expected.

* [monotouch-test] Adjust expected value for watchOS bundle id.

The watchOS bundle ID changed in fc5067ee67, and
the test failure wasn't caught properly.
2019-05-24 08:47:02 -07:00
Manuel de la Pena 2a42a35ba4
[Tests] Ensure that if trsut exception is not raised we do not get a NRE. (#6130)
This might be a race issue when dealing with the trust of the certs,
there is not much information in
https://github.com/xamarin/maccore/issues/1645 except the fact that we
are getting a null exception.

In this fix, we will first ensure that we did get the exception, later
confirm the exception type. To improve the debugging of the test, next
time it fails, we will get the content string to try and understand what
happened with the validation (did we return part of the stream or
headers when we shouldn't?)
2019-05-24 07:28:08 -07:00
Rolf Bjarne Kvinge 45d93dafd0
[monotouch-test] Adjust expected value for watchOS bundle id. (#6128)
The watchOS bundle ID changed in fc5067ee67, and
the test failure wasn't caught properly.
2019-05-24 06:30:05 -07:00
Marius Ungureanu 14bd63afa0 [CoreFoundation] Add tests for CFUrl retain count (#6101) 2019-05-23 22:36:54 -07:00
monojenkins f08d4e3ea8 [d16-2] [foundation] Add custom trust/certificate validation to NSUrlSessionHandler. Fix #4170 (#6110)
Basic application (size) for doing an `HttpClient.GetAsync`, release/llvm, 64bits only

- NSUrlSessionHandler (master): 6.4 MB
- NSUrlSessionHandler (PR#5936): 7.7 MB
- NSUrlSessionHandler (this PR): 6.4 MB

The size increase occurs because of the reference to .net `X509*` types.
This brings a lot of additional code, including managed cryptographic
code, inside the application - even when the feature is **not** used.

The solution is to expose an API that only use native (OS) types, which
are mostly already part of the application. This has a very low impact
on existing applications.

It's still possible to hook back to .NET validation if needed (it should
not in most cases) but, in this case, the extra price will only be
_paid_ if used (and can be lower if the code is needed by something else
from the application).

In comparison using other `HttpClient` handler produce app sizes of

- HttpClientHandler (managed): 10.4 MB
- CFNetworkHandler: 6.8 MB

Based on/supersede https://github.com/xamarin/xamarin-macios/pull/5733
Fix https://github.com/xamarin/xamarin-macios/issues/4170
2019-05-23 09:51:42 -05:00
Sebastien Pouliot 54e6940cbe
[foundation] Add custom trust/certificate validation to NSUrlSessionHandler. Fix #4170 (#6103)
Basic application (size) for doing an `HttpClient.GetAsync`, release/llvm, 64bits only

- NSUrlSessionHandler (master): 6.4 MB
- NSUrlSessionHandler (PR#5936): 7.7 MB
- NSUrlSessionHandler (this PR): 6.4 MB

The size increase occurs because of the reference to .net `X509*` types.
This brings a lot of additional code, including managed cryptographic
code, inside the application - even when the feature is **not** used.

The solution is to expose an API that only use native (OS) types, which
are mostly already part of the application. This has a very low impact
on existing applications.

It's still possible to hook back to .NET validation if needed (it should
not in most cases) but, in this case, the extra price will only be
_paid_ if used (and can be lower if the code is needed by something else
from the application).

In comparison using other `HttpClient` handler produce app sizes of

- HttpClientHandler (managed): 10.4 MB
- CFNetworkHandler: 6.8 MB

Based on/supersede https://github.com/xamarin/xamarin-macios/pull/5733
Fix https://github.com/xamarin/xamarin-macios/issues/4170
2019-05-23 08:09:10 -04:00
Rolf Bjarne Kvinge a2e9b599fe
[CoreFoundation] Fix ownership of objects returned from CFHTTPMessageCreate* P/Invokes. (#6091)
* [CoreFoundation] Fix ownership of objects returned from CFHTTPMessageCreate* P/Invokes.

* [Tests] Fix 'nint' 32 bits build

* [tests] Fix XM/Classic build.
2019-05-22 22:52:46 -07:00
Rolf Bjarne Kvinge 3d0398f915 [monotouch-test] Don't go completely overboard when trying to fill the GC's nursery. 2019-05-22 08:13:22 +02:00
Rolf Bjarne Kvinge 4fe3ce9ae9 [monotouch-test] LLVM's too smart for our tests, so ignore Symbols.FunctionNames when LLVM is enabled. 2019-05-22 08:12:03 +02:00
Rolf Bjarne Kvinge af1a8db426 [monotouch-test] Adjust for arm64_32 abi. 2019-05-22 08:11:56 +02:00
Rolf Bjarne Kvinge eab32da266 [monotouch-test] Don't go completely overboard when trying to fill the GC's nursery. 2019-05-20 18:00:18 +02:00
monojenkins daf5006281 [d16-2] [msbuild] Add reference to `System.Drawing.Common.dll` to XI projects. (#6035)
* [msbuild] Add reference to `System.Drawing.Common.dll` to XI projects.

Fixes https://github.com/mono/mono/issues/13483 :

```
@akoeplinger: Since we moved types from Mono.Android.dll and
Xamarin.iOS/WatchOS/TVOS.dll to System.Drawing.Common.dll user projects
would fail to compile. We need to add some msbuild logic to add a
reference to the assembly automatically.
```

* [msbuild] Implement the same fix for XM projects as well.

* [msbuild] Update Xamarin.iOS.Tasks.TargetTests.GetReferencedAssemblies_* tests.

We're including a new assembly, which means the
Xamarin.iOS.Tasks.TargetTests.GetReferencedAssemblies_* must be updated
accordingly.

Also modify these tests so that test assert that fails lists the actual
assembly that's missing, i.e. instead of this:

    1) Test Failure : Xamarin.iOS.Tasks.TargetTests.GetReferencedAssemblies_Executable
         #1
      Expected: 6
      But was:  7

we now print:

    1) Test Failure : Xamarin.iOS.Tasks.TargetTests.GetReferencedAssemblies_Executable
         References
      Expected: equivalent to < "mscorlib.dll", "MyLibrary.dll", "System.Core.dll", "System.dll", "System.Xml.dll", "Xamarin.iOS.dll" >
      But was:  < "mscorlib.dll", "MyLibrary.dll", "System.Core.dll", "System.dll", "System.Drawing.Common.dll", "System.Xml.dll", "Xamarin.iOS.dll" >

* [tests] Adjust Xamarin.MMP.Tests.AssemblyReferencesTests.ShouldNotAllowReference_ToSystemDrawing.

The test was verifying that referencing System.Drawing.dll and trying to use
System.Drawing.RectangleF would fail to compile (because System.Drawing.dll
shouldn't be resolved in this case).

The addition of System.Drawing.Common.dll breaks this assumption, because now
we ship System.Drawing.RectangleF, so the code that was supposed to fail to
compile works just fine instead.

So modify the test to verify that there's no System.Drawing.dll in the final
bundle.

* Remove workarounds for mono/mono#13483.

* [msbuild] Create a way out if automatically referencing System.Drawing.Common.dll causes problems.

* [msbuild] Adjust variable name and boolean logic according to review.
2019-05-10 16:16:01 +02:00
Rolf Bjarne Kvinge adbc87ff1d [monotouch-test] LLVM's too smart for our tests, so ignore Symbols.FunctionNames when LLVM is enabled. 2019-05-10 11:28:22 +02:00
Rolf Bjarne Kvinge c4c17fa293 [monotouch-test] Adjust for arm64_32 abi. 2019-05-10 11:28:22 +02:00
Ankit Jain 3a7bdc0a13 [msbuild] Add reference to `System.Drawing.Common.dll` to XI projects. (#6011)
* [msbuild] Add reference to `System.Drawing.Common.dll` to XI projects.

Fixes https://github.com/mono/mono/issues/13483 :

```
@akoeplinger: Since we moved types from Mono.Android.dll and
Xamarin.iOS/WatchOS/TVOS.dll to System.Drawing.Common.dll user projects
would fail to compile. We need to add some msbuild logic to add a
reference to the assembly automatically.
```

* [msbuild] Implement the same fix for XM projects as well.

* [msbuild] Update Xamarin.iOS.Tasks.TargetTests.GetReferencedAssemblies_* tests.

We're including a new assembly, which means the
Xamarin.iOS.Tasks.TargetTests.GetReferencedAssemblies_* must be updated
accordingly.

Also modify these tests so that test assert that fails lists the actual
assembly that's missing, i.e. instead of this:

    1) Test Failure : Xamarin.iOS.Tasks.TargetTests.GetReferencedAssemblies_Executable
         #1
      Expected: 6
      But was:  7

we now print:

    1) Test Failure : Xamarin.iOS.Tasks.TargetTests.GetReferencedAssemblies_Executable
         References
      Expected: equivalent to < "mscorlib.dll", "MyLibrary.dll", "System.Core.dll", "System.dll", "System.Xml.dll", "Xamarin.iOS.dll" >
      But was:  < "mscorlib.dll", "MyLibrary.dll", "System.Core.dll", "System.dll", "System.Drawing.Common.dll", "System.Xml.dll", "Xamarin.iOS.dll" >

* [tests] Adjust Xamarin.MMP.Tests.AssemblyReferencesTests.ShouldNotAllowReference_ToSystemDrawing.

The test was verifying that referencing System.Drawing.dll and trying to use
System.Drawing.RectangleF would fail to compile (because System.Drawing.dll
shouldn't be resolved in this case).

The addition of System.Drawing.Common.dll breaks this assumption, because now
we ship System.Drawing.RectangleF, so the code that was supposed to fail to
compile works just fine instead.

So modify the test to verify that there's no System.Drawing.dll in the final
bundle.

* Remove workarounds for mono/mono#13483.

* [msbuild] Create a way out if automatically referencing System.Drawing.Common.dll causes problems.

* [msbuild] Adjust variable name and boolean logic according to review.
2019-05-10 01:20:52 +02:00
Rolf Bjarne Kvinge d6aa896f03 [tests] Add tests for failing to marshal from managed array to NSArray, 2019-04-30 14:29:24 +00:00
Rolf Bjarne Kvinge e3bafafff0 [tests] Add tests for out/ref parameters. 2019-04-30 14:29:24 +00:00
Rolf Bjarne Kvinge 67ed868f5f [tests] Add tests for failing to marshal from managed array to NSArray, 2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge b51aaf4b8b [tests] Add tests for out/ref parameters. 2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge c8ed014af7
[runtime] Improve exception creation. (#5944)
* [runtime] Add an inner exception parameter to Runtime.CreateProductException.

This allows us to simplify code by using inner (and outer) exceptions as
a means to provide information instead of passing extra information
around in order to create decent exceptions.

One example is how we pass the selector and method name to the method
that converts from a native id to a managed NSObject instance: passing
this information is not necessary anymore if we can use two exceptions,
one for the failure to convert from an id to a NSObject instance,
wrapped in a second that tells which method/selector call ran into this
conversion problem.

* [runtime] Throw better exceptions when the dynamic registrar can't marshal something.

* [runtime] Throw a better exception when something goes wrong when trying to marshal a return value.

* [runtime] Use inner exceptions to convey failure information instead of trying to create a single exception with all we know.

* Fix merge problem.
2019-04-26 11:16:23 +02:00
Alexander Köplinger 7f717f01ae
Merge pull request #5563 from xamarin/mono-2019-02
Bump to mono:2019-02
2019-04-25 19:24:35 +02:00
Sebastien Pouliot d988124684
Remove private API (#5915)
* [pdfkit] Remove private API

* [vision] Remove VNRequest preferredMetalContext API and add API compatibility stub

Looks like it was removed between iOS 11 beta 4 and 5
http://codeworkshop.net/objc-diff/sdkdiffs/ios/11.0b5/Vision.html

* [gameplaykit] Do not expose selector for 'RemoveData'

* [cloudkit] Remove selector from deprecated 'UsesBackgroundSession' API

* [metalperformanceshaders] Remove private API

* [gamekit] Remove private API

* [avfoundation] Replace AVAssetResourceLoadingRequest 'finished' by 'isFinished'

Apple now reject the original (iOS 6) `finished` selector - even if its
replacement `isFinished` is not available until iOS 7.

* [corebluetooth] 'Primary' and 'UUID' are not mutable

This was not documented (or mis-documented in earlier macOS docs) and
the API are now replaced with empty stubs to maintain binary
compatibility with existing code.

* [coreanimation] Remove CAEmitterBehavior 'initWithType:' and 'behaviorWithType:' API

Corresponding headers were removed in Xcode 9 without any explanation
rdar #33590997 was filled - no news
'initWithType:' and 'behaviorWithType:' API now cause rejection
Tracked in https://trello.com/c/J8BDDUV9/86-33590997-coreanimation-quartzcore-api-removals

* [uikit] Remove (macOS only) API from NSLayoutManager (on other platforms)
2019-04-25 10:16:22 -04:00
Alexander Köplinger 99ea097abf Merge remote-tracking branch 'upstream/master' into mono-2019-02 2019-04-24 23:28:00 +02:00
Rolf Bjarne Kvinge bf3b45973e
[MetalPerformanceShaders] MPSImageNormalizedHistogram isn't available in iOS 11 as the headers claim. (#5942)
A simple test revels the truth:

    dyld: Symbol not found: _OBJC_CLASS_$_MPSImageNormalizedHistogram
      Referenced from: /var/containers/Bundle/Application/4DA44899-5F1D-4BF9-9C2E-B26982AE89F1/uistestappobjc.app/uistestappobjc
      Expected in: /System/Library/Frameworks/MetalPerformanceShaders.framework/MetalPerformanceShaders
     in /var/containers/Bundle/Application/4DA44899-5F1D-4BF9-9C2E-B26982AE89F1/uistestappobjc.app/uistestappobjc

This fixes this test failure on iOS 11:

    [FAIL] MPSImageNormalizedHistogramTests.Constructors : ObjCRuntime.RuntimeException : Wrapper type 'MetalPerformanceShaders.MPSImageNormalizedHistogram' is missing its native ObjectiveC class 'MPSImageNormalizedHistogram'.
2019-04-24 06:38:10 +01:00
Rolf Bjarne Kvinge 66ba411303 [UIKit] Don't crash if UIGestureRecognizer.Dispose is called multiple times. Fixes #5899. (#5921)
Fixes https://github.com/xamarin/xamarin-macios/issues/5899.
2019-04-22 15:52:06 -05:00
Alexander Köplinger 3029a43b1a Merge remote-tracking branch 'upstream/master' into mono-2019-02
# Conflicts:
#	external/mono
2019-04-10 20:53:19 +02:00
Rolf Bjarne Kvinge 06426bd7a0
[Foundation] Improve/fix NSRegularExpression and NSDataDetector bindings. Fixes #5881. (#5882)
* NSDataDetector

    * Add constructor found in header. No idea where the commented-out
      constructor came from, it's not in the header, so I removed it.
    * Add overloads that take NSTextCheckingType in addition to
      NSTextCheckingTypes. Apple's API take NSTextCheckingTypes, but all the
      documentation and samples say that you're supposed to pass one or more
      or'ed NSTextCheckingType values, so support that as well without casting
      between enums.

* NSRegularExpression

    * GetMatches had the wrong return type, so add a GetMatches2 that does it
      right. Also add a test to make sure it's really right.
    * Bind 'regularExpressionWithPattern:options:error:' with a static method.
      There's a corresponding constructor, but constructors returning out
      NSError parameters isn't the nicest API (when the NSError is important),
      so add the static method as well.
    * Add a missing [NullAllowed] on FindFirstMatch's return value.

* NSRegularExpressionOptions

    * Add missing enum value.

Fixes https://github.com/xamarin/xamarin-macios/issues/5881.
2019-04-10 15:12:24 +02:00
Alexander Köplinger 067cbf0a28 Merge remote-tracking branch 'upstream/master' into mono-2019-02
# Conflicts:
#	tools/mmp/driver.cs
2019-04-05 11:19:11 +02:00
Alexander Köplinger 121bb03627 Merge remote-tracking branch 'upstream/master' into mono-2019-02
# Conflicts:
#	external/mono
2019-04-03 23:54:57 +02:00
Vincent Dondain 86d1b42ad2 Merge branch 'xcode10.2' into master-merge-xcode10.2 2019-04-03 13:57:31 -04:00
Rolf Bjarne Kvinge dda50a78c4
[Foundation] Make adding/removing observers in NSNotificationCenter thread safe. (#5833)
NSNotificationCenter is thread-safe, so that observers can be added and
removed in multiple threads simultaneously.

Unfortunately our own helper code wasn't, so make sure to fix that by locking
around all accesses to the observer list.

And add a test case as well.
2019-04-03 11:45:11 +02:00
Vincent Dondain 9c8d8e0a50 Bump for Xcode 10.2 final (#5808)
* Bump for Xcode 10.2 final

* Bump macios-binaries so mlaunch works on 10.14.4

* [appkit] Update for Xcode 10.2 final

* [mps] Update for Xcode 10.2 final

* Bump maccore for swift5 runtime support on older macOS versions

* [AppKit] Ignore deprecated API

* [tests] Don't test QTMovie, it's broken (crashes).

QTKit is deprecated (and has been for 5 years), so just don't test QTMovie.

Fixes these crashes:

apitest:

    ***** DelegateAndDataSourceAllowsNull
    Stacktrace:

      at <unknown> <0xffffffff>
      at (wrapper managed-to-native) ObjCRuntime.Messaging.IntPtr_objc_msgSend (intptr,intptr) [0x0000a] in <e8e733c9728c43cba731719f096ad306>:0
      at QTKit.QTMovie..ctor () [0x00018] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.4.0.70/src/Xamarin.Mac/QTKit/QTMovie.g.cs:330
      at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) [0x0004f] in <3ad39e28642b49d2a535a565e6bf6837>:0
      at <unknown> <0xffffffff>
      at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) [0x00016] in <3ad39e28642b49d2a535a565e6bf6837>:0
      at System.Reflection.MonoCMethod.InternalInvoke (object,object[],bool) [0x00005] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.4.0.70/src/Xamarin.Mac/mcs/class/corlib/System.Reflection/MonoMethod.cs:667
      at System.Reflection.MonoCMethod.DoInvoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x0007a] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.4.0.70/src/Xamarin.Mac/mcs/class/corlib/System.Reflection/MonoMethod.cs:657
      at System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x00000] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.4.0.70/src/Xamarin.Mac/mcs/class/corlib/System.Reflection/MonoMethod.cs:689
      at System.Reflection.ConstructorInfo.Invoke (object[]) [0x00000] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.4.0.70/src/Xamarin.Mac/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:62
      at Xamarin.Mac.Tests.DelegateAndDataSourceTest.DelegateAndDataSourceAllowsNull () [0x00110] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/apitest/src/DelegateAndDataSourceTest.cs:65
      at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) [0x0004f] in <3ad39e28642b49d2a535a565e6bf6837>:0
      at <unknown> <0xffffffff>
      at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) [0x00016] in <3ad39e28642b49d2a535a565e6bf6837>:0
      at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x0003b] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.4.0.70/src/Xamarin.Mac/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
      at System.Reflection.MethodBase.Invoke (object,object[]) [0x00000] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.4.0.70/src/Xamarin.Mac/mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs:229
      at NUnit.Framework.Internal.Reflect/<>c__DisplayClass9_0.<InvokeMethod>b__0 () [0x00000] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/external/guiunit/src/framework/Internal/Reflect.cs:226
      at GuiUnit.InvokerHelper.Invoke () [0x0000e] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/external/guiunit/src/framework/GuiUnit/InvokerHelper.cs:18
      at Foundation.NSActionDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.4.0.70/src/Xamarin.Mac/Foundation/NSAction.cs:62
      at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) [0x0004f] in <3ad39e28642b49d2a535a565e6bf6837>:0
      at <unknown> <0xffffffff>
      at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSend (intptr,intptr) [0x0000a] in <e8e733c9728c43cba731719f096ad306>:0
      at AppKit.NSApplication.Run () [0x00012] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.4.0.70/src/Xamarin.Mac/AppKit/NSApplication.g.cs:2253
      at Xamarin.Mac.Tests.MainClass/NSRunLoopIntegration.RunMainLoop () [0x00001] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/common/mac/MacTestMain.cs:79
      at GuiUnit.TestRunner.ExecuteWithListener (string[],NUnitLite.Runner.TcpWriter) [0x0036f] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/external/guiunit/src/framework/GuiUnit/TestRunner.cs:234
      at GuiUnit.TestRunner.Execute (string[]) [0x00093] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/external/guiunit/src/framework/GuiUnit/TestRunner.cs:137
      at GuiUnit.TestRunner.Main (string[]) [0x00001] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/external/guiunit/src/framework/GuiUnit/TestRunner.cs:71
      at Xamarin.Mac.Tests.MainClass.RunTests (string[]) [0x000a9] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/common/mac/MacTestMain.cs:56
      at Xamarin.Mac.Tests.MainClass.Main (string[]) [0x00007] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/common/mac/MacTestMain.cs:35
      at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) [0x00051] in <4c10f2ab239246ba9514b976defa64c7>:0

    Native stacktrace:

    	0   apitest                             0x000000010c40b388 mono_handle_native_crash + 264
    	1   apitest                             0x000000010c388dd6 altstack_handle_and_restore + 70
    	2   CoreFoundation                      0x00007fff3b6f260b CFStringGetCString + 43
    	3   QTKit                               0x00007fff457b6542 __51-[QTKitServerController startUsingServerForObject:]_block_invoke + 1238
    	4   libdispatch.dylib                   0x00007fff67b4e63d _dispatch_client_callout + 8
    	5   libdispatch.dylib                   0x00007fff67b5a129 _dispatch_lane_barrier_sync_invoke_and_complete + 60
    	6   QTKit                               0x00007fff457b5f7a -[QTKitServerController startUsingServerForObject:] + 179
    	7   QTKit                               0x00007fff457ac602 -[QTMovie_QuickTime initWithError:forParent:] + 98
    	8   QTKit                               0x00007fff456f55b9 -[QTMovie initWithError:] + 59
    	9   apitest                             0x000000010c31fbe9 xamarin_dyn_objc_msgSend + 217
    	10  ???                                 0x0000000112791d05 0x0 + 4604894469
    	11  apitest                             0x000000010c41f659 mono_jit_runtime_invoke + 1433
    	12  apitest                             0x000000010c51a4df mono_runtime_invoke_checked + 127
    	13  apitest                             0x000000010c522e70 mono_runtime_try_invoke_array + 1856
    	14  apitest                             0x000000010c4be091 ves_icall_InternalInvoke + 657
    	15  ???                                 0x0000000111abe261 0x0 + 4591444577
    	16  ???                                 0x0000000114249463 0x0 + 4632908899

    =================================================================
    Got a SIGSEGV while executing native code. This usually indicates
    a fatal error in the mono runtime or one of the native libraries
    used by your application.
    =================================================================

    1 failing types:
    QTKit.QTMovie: Object reference not set to an instance of an object

introspection:

    ***** ApiCtorInitTest.DefaultCtorAllowed
    Stacktrace:

      at <unknown> <0xffffffff>
      at (wrapper managed-to-native) ObjCRuntime.Messaging.IntPtr_objc_msgSend (intptr,intptr) [0x0000a] in <e8e733c9728c43cba731719f096ad306>:0
      at QTKit.QTMovie..ctor () [0x00018] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.4.0.70/src/Xamarin.Mac/QTKit/QTMovie.g.cs:330
      at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) [0x0004f] in <3ad39e28642b49d2a535a565e6bf6837>:0
      at <unknown> <0xffffffff>
      at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) [0x00016] in <3ad39e28642b49d2a535a565e6bf6837>:0
      at System.Reflection.MonoCMethod.InternalInvoke (object,object[],bool) [0x00005] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.4.0.70/src/Xamarin.Mac/mcs/class/corlib/System.Reflection/MonoMethod.cs:667
      at System.Reflection.MonoCMethod.DoInvoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x0007a] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.4.0.70/src/Xamarin.Mac/mcs/class/corlib/System.Reflection/MonoMethod.cs:657
      at System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x00000] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.4.0.70/src/Xamarin.Mac/mcs/class/corlib/System.Reflection/MonoMethod.cs:689
      at System.Reflection.ConstructorInfo.Invoke (object[]) [0x00000] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.4.0.70/src/Xamarin.Mac/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:62
      at Introspection.ApiCtorInitTest.DefaultCtorAllowed () [0x000f0] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/introspection/ApiCtorInitTest.cs:267
      at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) [0x0004f] in <3ad39e28642b49d2a535a565e6bf6837>:0
      at <unknown> <0xffffffff>
      at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) [0x00016] in <3ad39e28642b49d2a535a565e6bf6837>:0
      at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x0003b] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.4.0.70/src/Xamarin.Mac/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
      at System.Reflection.MethodBase.Invoke (object,object[]) [0x00000] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.4.0.70/src/Xamarin.Mac/mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs:229
      at NUnit.Framework.Internal.Reflect/<>c__DisplayClass9_0.<InvokeMethod>b__0 () [0x00000] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/external/guiunit/src/framework/Internal/Reflect.cs:226
      at GuiUnit.InvokerHelper.Invoke () [0x0000e] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/external/guiunit/src/framework/GuiUnit/InvokerHelper.cs:18
      at Foundation.NSActionDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.4.0.70/src/Xamarin.Mac/Foundation/NSAction.cs:62
      at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) [0x0004f] in <3ad39e28642b49d2a535a565e6bf6837>:0
      at <unknown> <0xffffffff>
      at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSend (intptr,intptr) [0x0000a] in <e8e733c9728c43cba731719f096ad306>:0
      at AppKit.NSApplication.Run () [0x00012] in /Library/Frameworks/Xamarin.Mac.framework/Versions/5.4.0.70/src/Xamarin.Mac/AppKit/NSApplication.g.cs:2253
      at Xamarin.Mac.Tests.MainClass/NSRunLoopIntegration.RunMainLoop () [0x00001] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/common/mac/MacTestMain.cs:79
      at GuiUnit.TestRunner.ExecuteWithListener (string[],NUnitLite.Runner.TcpWriter) [0x0036f] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/external/guiunit/src/framework/GuiUnit/TestRunner.cs:234
      at GuiUnit.TestRunner.Execute (string[]) [0x00093] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/external/guiunit/src/framework/GuiUnit/TestRunner.cs:137
      at GuiUnit.TestRunner.Main (string[]) [0x00001] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/external/guiunit/src/framework/GuiUnit/TestRunner.cs:71
      at Xamarin.Mac.Tests.MainClass.RunTests (string[]) [0x000a9] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/common/mac/MacTestMain.cs:56
      at Xamarin.Mac.Tests.MainClass.Main (string[]) [0x00007] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/common/mac/MacTestMain.cs:35
      at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) [0x00051] in <83b8b910cba94191a35185713f274e89>:0

    Native stacktrace:

     0   introspection                       0x0000000104e33388 mono_handle_native_crash + 264
     1   introspection                       0x0000000104db0dd6 altstack_handle_and_restore + 70
     2   CoreFoundation                      0x00007fff3b6f260b CFStringGetCString + 43
     3   QTKit                               0x00007fff457b6542 __51-[QTKitServerController startUsingServerForObject:]_block_invoke + 1238
     4   libdispatch.dylib                   0x00007fff67b4e63d _dispatch_client_callout + 8
     5   libdispatch.dylib                   0x00007fff67b5a129 _dispatch_lane_barrier_sync_invoke_and_complete + 60
     6   QTKit                               0x00007fff457b5f7a -[QTKitServerController startUsingServerForObject:] + 179
     7   QTKit                               0x00007fff457ac602 -[QTMovie_QuickTime initWithError:forParent:] + 98
     8   QTKit                               0x00007fff456f55b9 -[QTMovie initWithError:] + 59
     9   introspection                       0x0000000104d47be9 xamarin_dyn_objc_msgSend + 217
     10  ???                                 0x00000001073f6de5 0x0 + 4416564709
     11  introspection                       0x0000000104e47659 mono_jit_runtime_invoke + 1433
     12  introspection                       0x0000000104f424df mono_runtime_invoke_checked + 127
     13  introspection                       0x0000000104f4ae70 mono_runtime_try_invoke_array + 1856
     14  introspection                       0x0000000104ee6091 ves_icall_InternalInvoke + 657
     15  ???                                 0x00000001072bd011 0x0 + 4415279121
     16  ???                                 0x000000010c993d63 0x0 + 4506336611

    =================================================================
    Got a SIGSEGV while executing native code. This usually indicates
    a fatal error in the mono runtime or one of the native libraries
    used by your application.
    =================================================================

    [FAIL] Default constructor not allowed for QTKit.QTMovie : Object reference not set to an instance of an object
2019-03-27 10:51:17 +01:00
Alexander Köplinger 66ebb76e71 Merge remote-tracking branch 'upstream/master' into mono-2019-02 2019-03-18 19:24:52 +01:00
Rolf Bjarne Kvinge 18b13ac876
[runtime] Use mono_array_setref instead of mono_array_set. (#5782)
* [Foundation] Add an NSArray.FromNSObjects overload that can take an array of INativeObjects.

* [runtime] Use mono_array_setref instead of mono_array_set.

Otherwise the GC won't know about the assignment, and the assigned value can
be freed if it's no longer referenced anywhere else.
2019-03-18 15:00:32 +01:00
Alexander Köplinger 2b30e0755e REVERTME: Add workaround for missing System.Drawing.Common reference 2019-03-15 16:43:09 +01:00
Rolf Bjarne Kvinge 8887b615d1
[CoreGraphics] Make CGPattern inherit from NativeObject, and add a CGPattern test. (#5734)
* [CoreGraphics] Make CGPattern inherit from NativeObject, and add a CGPattern test.

* Make test work on all platforms.
2019-03-07 16:49:12 +01:00
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
Manuel de la Pena a5232f8c5e
[Tests] Make test inconclusive if httpbin does not return the headers. (#5684)
In some cases, httpbin might return errors or other results. In that
case, we cannot assert that the auth headers are not present. We set the
test to inconclusive to ensure that we do not fail due to the external
page.

Fixes https://github.com/xamarin/maccore/issues/1453
2019-02-28 15:35:36 +01:00
Alex Soto 46fbf5e76e
[MetalPerformanceShaders] Update bindings from Xcode 9.2 to 10.2 - Part 2 of 2 (#5630)
* [MetalPerformanceShaders] Update bindings from Xcode 9.2 to 10.2 - Part 2 of 2

Fixes xamarin/xamarin-macios#3553

This is the second part of MPS bindings.

Bindings for:

- MPSNeuralNetwork.framework

* Apply some feedback and fix a test case in 10.13

Fixes xamarin/maccore#1389

* More feedback

* Fix ctor test
2019-02-27 06:36:08 -05:00
Rolf Bjarne Kvinge 3484ebbf08
[monotouch-test] ARImageTrackingConfiguration is iOS 12+, so protect accordingly. (#5594) 2019-02-13 13:49:17 +01:00
Manuel de la Pena e470035431
[Tests] Add some extra info to better debug next time test fails. (#5598)
We have issue https://github.com/xamarin/maccore/issues/701 that states
that there is no exception. Get the received response to check against
null and help debug the issue next time it happens in the CI bots.
2019-02-13 12:22:24 +01:00
Manuel de la Pena 46728f0c6e
[Tests] Do not fail with timeouts. Fixes #1332 (#5596)
The bots sometimes have issues with the network. We do not want red
builds due to a problem in the connection. Lets set the test to
inclonclusive since we cannot assert the headers that have been sent.

Fixes https://github.com/xamarin/maccore/issues/1332
2019-02-12 19:27:23 +01:00
Rolf Bjarne Kvinge 79ec1cc660
[tests] Ignore monotouch-tests that fail with bitcode. (#5566)
This is already a reported bug in mono (and has been for a while).
2019-02-07 16:01:50 +01:00
Chris Hamons 03bf340e56 [AVFAudio] Xcode 10.2 Beta 2 (#5554)
* [AVFAudio] Xcode 10.2 Beta 2

* Add manual test

* Remove unnecessary project change

* Fixed a file name typo

* fix xtro
2019-02-06 16:48:10 -05:00
Marius Ungureanu b357624861
[NSString] Add overloads which are optimized for substring handling (#5517)
* [NSString] Add overloads which are optimized for substring handling

Fixes #5134
2019-01-31 19:09:13 +02:00
Sebastien Pouliot 6eba94964a
[coremedia] Update for xcode 10.2 beta 1 (#5513)
Most additions are block-based alternatives to callback API. However,
the way we bind them, it produce identical API so they are ignored.

Fix existing API (where an array was used) and add some tests for it
2019-01-30 16:51:26 -05:00
Alex Soto fbe591a998
[MetalPerformanceShaders] Apply feedback to Part 1 2019-01-29 15:37:49 -05:00
Alex Soto 3e0bcf2b32
[MetalPerformanceShaders] Update bindings from Xcode 9.2 to 10.2 - Part 1 of 2
Fixes: xamarin/xamarin-macios#5362

This includes updates for:

* MetalPerformanceShaders.framework
* MPSCore.framework
* MPSImage.framework
* MPSMatrix.framework
* MPSRayIntersector.framework

Pending:

* MPSNeuralNetwork.framework
2019-01-29 15:37:49 -05:00
Rolf Bjarne Kvinge dbd247ed38
[NSLayoutManager] Complete bindings for NSLayoutManager. Fixes #4740. (#4853)
Fix numerous issues with NSLayoutManager[Delegate]:

* The classes are available in both AppKit and UIKit, but the bindings are
  duplicated (unsuccessfully) in both appkit.cs and uikit.cs. So create a new
  xkit.cs that is shared between XI and XM, and put a shared version of the
  bindings there.

* Bind everything that hasn't already been bound (or deprecated by Apple).

* Methods that take a nullable NSRangePointer has been bound with three overloads:

	* A protected overridable (exported) method that uses IntPtr.
	* A public method without the parameter.
	* A public method with the parameter typed as 'ref NSRange'.

	This makes sure the native method can be overridden if needed, while at
	the same time making it possible to call without providing the nullable
	parameter.

* Fix numerous ugly bindings:

	* There's a great nint/nuint confusion for parameters referring to
	  'character index' and 'glyph index'. XI seems to prefer nuint, while XM
	  seems to prefer nint. Standardize on nuint, since that's how Apple
	  created them.

	* Many methods have names than sound like Objective-C. Fix them all,
	  either right away when possible, or for XAMCORE_4_0.

	* Several parameter names have been modified to comply with our naming
	  guidelines (no abbreviations).

Fixes https://github.com/xamarin/xamarin-macios/issues/4740.
2019-01-29 15:37:48 -05:00
Vincent Dondain b59b608a7e
[healthkit] Update for Xcode 10.2 beta 1 (#5497)
- Fix `CategoryTypeIdentifierTest` for 10.2 APIs
2019-01-29 13:07:48 -05:00
Vincent Dondain f2ab1f6daf
[tests] Ignore failing GestureRecognizerTest for now (#5486)
- WIP PR https://github.com/xamarin/xamarin-macios/pull/5462 more investigation needed so ignore test which is preventing green builds
2019-01-28 10:07:06 -05:00
Sebastien Pouliot be5e3c9a33
[security] Update for Xcode 10.2 beta 1 (#5481)
The added `SecTrustSetSignedCertificateTimestamps` API existed in older
versions of the OS so I kept the Xcode headers availability (instead of
current SDK version).
2019-01-25 15:00:56 -05:00
Alex Soto 0e8393f1f7
[UIKit] Update bindings to Xcode 10.2 Beta 1 (#5475)
* [UIKit] Update bindings to Xcode 10.2 Beta 1

* Remove the test from tvOS because it will break the build...
2019-01-25 13:01:07 -05:00
Rolf Bjarne Kvinge ab12d72419
[tests] Adjust DispatchBlock tests according to minimum OS. (#5435)
* [tests] Adjust DispatchBlock tests according to minimum OS.

* [tests] Fix monotouch-test build.
2019-01-21 07:49:28 +01: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 9baec99be2
[tests] Fix `ARCondigurationTest.GetSupportedVideoFormats` on older devices (#5409)
`ARImageTrackingConfiguration` requires iOS 12 (Xcode 10) so split it in
a separate test case.

Fixes https://github.com/xamarin/maccore/issues/1335
2019-01-15 13:43:52 -05:00
Bernhard Urban 1c60e65423 [tests] fix Symbols test for tvOS with interpreter (#5399)
One more frame must be checked due to different interp2native transition
on that platform.
2019-01-14 11:58:08 -05:00
Manuel de la Pena 81ea2e3e46
[Network] Add test to ensure that auth headers are not fwd on redirects. (#5371) 2019-01-10 17:45:20 +01:00
Sebastien Pouliot aa77c673c2
[arkit] Fix crash in ARConfiguration.SupportedVideoFormats. Fixes #5347 (#5348)
Even if 'supportedVideoFormats' is static the type is abstract.

> Important
> ARConfiguration is an abstract base class, so its implementation of
> this property always returns an empty array. Read this property from
> the configuration subclass you plan to use for your AR session, such
> as ARWorldTrackingConfiguration or ARFaceTrackingConfiguration.
https://developer.apple.com/documentation/arkit/arconfiguration/2942261-supportedvideoformats?language=objc

and this behave differently in Objective-C (than .net) as every (static)
method will be different (and not a single implementation like C#).

The existing implementation (as a property) calls `ARConfiguration`
implementation which simply throws a (native) exception

> NSInvalidArgumentException Reason: Supported video formats should be called on individual configuration class

The solution is to obsolete the property (can't be subclassed in .net
since it's static) and add, only on the subclasses, a method that
call the 'supportedVideoFormats' selector on the current (not base)
type.

Added unit test to detect the addition of newer subclasses - since they
will also need to expose this method.

reference: https://github.com/xamarin/xamarin-macios/issues/5347
2019-01-04 17:29:19 -05:00
Sebastien Pouliot f55db9d7bc
[coretext] Update CTRunDelegate to work on 64 bits. Fixes #5132 (#5302)
Basic fix that does not require a breaking change.

It's _basic_ as it does not fix the performance comments made inside
the issue. Those are different (not a bug, an enhancement) and I'll
file a separate issue to track this.

Reference: https://github.com/xamarin/xamarin-macios/issues/5132
2018-12-21 08:57:32 -05:00
Bernhard Urban e154556e16 [tests] fix symbols test for interpreter (#5264)
`ves_pinvoke_method` / `do_icall` moved a frame up, so make the check
more flexible.
2018-12-13 08:52:02 -05:00
Manuel de la Pena fb4147d78d
[Foundation] Make sure we use the cookies from the cookie storage. Fixes #5148 (#5244)
The response object does not have all the cookie values, instead we must
rust the cookie storage which can be used to retrieve ALL the cookies
for a task.

The header value has to be created manually because the native objects
do not expose a valid way to get the header. Tests have been added to
ensure we return the same as the managed client.

Fixes https://github.com/xamarin/xamarin-macios/issues/5148
2018-12-10 22:59:11 +01:00
Rolf Bjarne Kvinge c814ddb567
[monotouch-test] Tweak DnsFailure a bit. (#5208)
* Make it clearer when a timeout happens that a timeout happened by asserting
  exactly that.
* Don't assert after getting the (unexpected) result from the network request,
  since asserting will throw an exception, which will be caught and stored,
  and then later in the test we assert that an exception was thrown. So
  asserting just after a successful network request effectively hides any
  failures, since we're now passing because of the assertion exception. Ops.
2018-12-03 17:43:58 +01:00
Rolf Bjarne Kvinge 8e61569615
[monotouch-test] Require iOS 9+ for the ActionTest.TimingFunction_* tests. (#5194)
Require iOS 9+ for the ActionTest.TimingFunction_* tests because Apple's
implementation was broken in iOS 8 and causes us to crash.
2018-11-28 15:09:03 +01:00
Rolf Bjarne Kvinge 3aa7582f4c
[monotouch-test] Add version check to SceneKit.ActionTest. Fixes maccore#1119. (#5099)
Fixes https://github.com/xamarin/maccore/issues/1119.
2018-11-08 18:41:19 +01:00
Rolf Bjarne Kvinge 1b32a8dba5
[monotouch-test] Improve diagnostic output when MessageHandlerTest fails. (#5085)
Reference: https://github.com/xamarin/xamarin-macios/issues/4013
2018-11-06 09:57:35 +01:00
Rolf Bjarne Kvinge ac54b7d065
[monotouch-test] Improve VTDecompressionSessionTests asserts to print better info in case of failure. (#5083)
Showing the actual failed value is much more helpful than just "sorry, it failed".

See https://github.com/xamarin/xamarin-macios/issues/4900.
2018-11-06 09:53:59 +01:00
Sebastien Pouliot 121fe236ba
[scenekit] Fix `SCNAction.TimingFunction` signature to `Func<float,float>`. Fixes #5058 (#5068)
This was incorrectly bound as `Action<float>`.
Added unit test for the API compatibility stubs.

reference: https://github.com/xamarin/xamarin-macios/issues/5058

* [tests] Adjust test not to fail

reference: https://github.com/xamarin/xamarin-macios/issues/5072
2018-11-05 14:20:03 -05:00
Sebastien Pouliot f2a05eddc7
Merge xcode10.1 into d15-9 (#5063) 2018-10-31 17:30:44 -04:00
Sebastien Pouliot 0304219723
[tests] Fix some tests to succeed when run on macOS 10.14 (#5057)
Public bots were updated today.

Fixes https://github.com/xamarin/maccore/issues/1106
Fixes https://github.com/xamarin/maccore/issues/1107
2018-10-31 08:32:36 -04:00
Vincent Dondain 51e7a47700 [coregraphics] Make MatrixOrder a normal enum instead of a nested enum (#5036)
This enum might prove useful to other APIs in the future so move outside of `CGAffineTransform`.
2018-10-24 20:10:55 -04:00
Vincent Dondain f87f3b88f8 [coregraphics] Add 'MatrixOrder' overload for Scale, Rotate and Translate (#5011)
- Fixes #4698: CGAffineTransform.Scale does not work like Swift's .scaledBy(x:y:)
  (https://github.com/xamarin/xamarin-macios/issues/4698)
- 'Scale' monotouch-test now covers the new overload for the new multiplication order.
- Changed the Scale test's values so we have different values for 'x0' (it was always 0 before) and so it matches the test case from the bug report.

* Same fix for Rotate and Translate
2018-10-22 08:42:52 -04:00
Miguel de Icaza dca1f4793f [UIKit] UIGestureRecognizer, support a way of unsubscribing without creating cycles (#4729)
* [UIKit] UIGestureRecognizer, support a way of unsubscribing without creating cycles

This now tracks all the uses of AddTarget with delegates by recording
the Token/Selector pair and making `Dispose()` release all the linkage
as well as providing an enumerator that can be used to get all the
registered Action handlers - this can then be used with .First() and
then passed to `RemoveTarget`.

This addresses https://github.com/xamarin/xamarin-macios/issues/4190

This initial patch is here for discussion of the approach, want to
review and test this before we merge.

* Simplify code a little bit.

* Add test.

* [tests] Add an NSAutoreleasePool to make GestureRecognizerTest.NoStrongCycles happy on 32-bit.
2018-10-18 12:31:39 +02:00
Rolf Bjarne Kvinge ee1f7dc33d
[CoreFoundation] Implement missing dispatch API. Fixes #4606. (#4967)
* [CoreFoundation] Add DispatchQueue.DispatchBarrierSync.

* [CoreFoundation] Bind dispatch_queue_[set|get]_specific.

* [CoreFoundation] Bind dispatch_queue_get_qos_class.

* [CoreFoundation] Bind dispatch_queue_create_with_target.

* Add tests.

* Update xtro.

* Add missing availability attributes.

* [tests] Do a version check before testing new API.

* Remove redundant code.
2018-10-17 14:42:29 +02:00
Bernhard Urban 8e72ea8330 [tests] improve MonoWeakReferenceTest to avoid false pinning (#4961)
Fixes an issue when executed with interpreter. Now, the test is closer
to what we do in the runtime test:

831e73abcd/mono/tests/weak-fields.cs
831e73abcd/mono/mini/TestHelpers.cs
2018-10-16 14:05:19 -04:00
Bernhard Urban 60b06b9c98 [tests] make Symbols.FunctionNames aware of interpreter (#4973) 2018-10-16 11:25:35 -04:00
Rolf Bjarne Kvinge 788b63d96f
[NSLayoutManager] Complete bindings for NSLayoutManager. Fixes #4740. (#4853)
Fix numerous issues with NSLayoutManager[Delegate]:

* The classes are available in both AppKit and UIKit, but the bindings are
  duplicated (unsuccessfully) in both appkit.cs and uikit.cs. So create a new
  xkit.cs that is shared between XI and XM, and put a shared version of the
  bindings there.

* Bind everything that hasn't already been bound (or deprecated by Apple).

* Methods that take a nullable NSRangePointer has been bound with three overloads:

	* A protected overridable (exported) method that uses IntPtr.
	* A public method without the parameter.
	* A public method with the parameter typed as 'ref NSRange'.

	This makes sure the native method can be overridden if needed, while at
	the same time making it possible to call without providing the nullable
	parameter.

* Fix numerous ugly bindings:

	* There's a great nint/nuint confusion for parameters referring to
	  'character index' and 'glyph index'. XI seems to prefer nuint, while XM
	  seems to prefer nint. Standardize on nuint, since that's how Apple
	  created them.

	* Many methods have names than sound like Objective-C. Fix them all,
	  either right away when possible, or for XAMCORE_4_0.

	* Several parameter names have been modified to comply with our naming
	  guidelines (no abbreviations).

Fixes https://github.com/xamarin/xamarin-macios/issues/4740.
2018-10-01 14:17:28 +02:00
Manuel de la Pena ddb0948376 [Metal] Fixe the size of structures. Fixes #4611 (#4838)
The structs MTLQuadTessellationFactorsHalf and
MTLTriangleTessellationFactorsHalf are wrong as per the header
definition:

```c
typedef struct {
    /* NOTE: edgeTessellationFactor and insideTessellationFactor are interpreted as half (16-bit floats) */
    uint16_t edgeTessellationFactor[4];
    uint16_t insideTessellationFactor[2];
} MTLQuadTessellationFactorsHalf;

typedef struct {
    /* NOTE: edgeTessellationFactor and insideTessellationFactor are interpreted as half (16-bit floats) */
    uint16_t edgeTessellationFactor[3];
    uint16_t insideTessellationFactor;
} MTLTriangleTessellationFactorsHalf;
```

We set the arrays size to be the correct one.

Fixes https://github.com/xamarin/xamarin-macios/issues/4611

* Add tests that ensure that the size of the managed structs is the same
as the native ones.

The values used have been checked against a native app compiled on 32
and 64 (iphone 5 and iphone X).
2018-09-21 09:33:27 -04:00
Vincent Dondain 49ef936701
Merge pull request #4833 from VincentDondain/master-merge-xcode10
Merge branch 'xcode10' into master
2018-09-19 18:19:35 -04:00
Rolf Bjarne Kvinge 7354052e96
[NSLayoutManager] Fix potential NRE in NSLayoutManager.GetGlyphs when one of the parameters is null, (#4832) 2018-09-19 07:37:26 +02:00
Vincent Dondain d0de806f4a Merge branch 'xcode10' into d15-9 2018-09-18 14:57:49 -04:00
Vincent Dondain 2174ec41a2 Merge branch 'xcode10' 2018-09-18 14:12:39 -04:00
Rolf Bjarne Kvinge 8e32ace58e
[Foundation] Bind NSMutableDictionary's addEntriesFromDictionary:. Fixes #4813. (#4819)
Fixes https://github.com/xamarin/xamarin-macios/issues/4813
2018-09-17 16:14:46 +02:00
Vincent Dondain 91a52a17f5 Merge branch 'xcode10' into d15-9-merge-xcode10 2018-09-14 12:53:17 -04:00
Manuel de la Pena 422da1f8d4 [Tests] Remove IPV6 flaky test with an ignore. (#4815) 2018-09-14 10:05:17 -04:00
Manuel de la Pena eeca0b8780 [Tests] force the IP version to fix tests on bots. (#4805) 2018-09-13 14:13:21 -04:00
Sebastien Pouliot 121212ed37 [tests] Fix flaky SecProtocolMetadata.EarlyDataAccepted result (#4804)
Result is mostly, but not always, `false` and that _might_ be due
to how we're testing the API.

ref: https://github.com/xamarin/maccore/issues/1026
2018-09-13 11:41:27 +02:00
Manuel de la Pena bed3770bae [Tests] Add missing tests for NWProtocolStack and fix NWParameters tests. (#4793) 2018-09-12 19:15:33 -04:00
Sebastien Pouliot 2c8f882896
[security] SecProtocolMetadata update and tests (#4792)
* Avoid `ArgumentNullException` in default/empty `SecProtocolMetadata.PeerPublicKey`
* Add two `SecProtocolMetadata.CreateSecret` API - disabled as the current tests (incomplete?) crash in unit tests
* Add basic unit tests for `[Sec|NW]ProtocolMetadata`
* Update xtro
2018-09-12 13:07:10 -04:00
Rolf Bjarne Kvinge 239d9031d6 [HealthKit] Use generated NSString-backed enums. Fixes #4183. (#4786)
This means less (duplicated) manual code, which means less errors, which also
means we're now getting some new members that previously weren't duplicated
correctly.

Fixes https://github.com/xamarin/xamarin-macios/issues/4183.
2018-09-12 11:23:02 -04:00
Manuel de la Pena e43ca080c7
[Tests] Add missing tests for NWPath. (#4765) 2018-09-12 12:35:40 +02:00
Sebastien Pouliot 6af77f3fbe
[security] Add new SecCertificateCopyKey and SecTrustEvaluateWithError API with unit tests (#4784) 2018-09-11 12:08:05 -04:00
Sebastien Pouliot 46fb26efc8
[security] Fix 'SecCertificate2.Certificate' call and add some tests (#4783) 2018-09-11 08:41:38 -04:00
Sebastien Pouliot 0841238e29
[naturallanguage] Fix helper API for `NLTagger.GetTag` and cleanup/fix other API. Fixes #4774 (#4782)
* Move `NLTag` to static class (instead of enum) since it's not used in API, except along NSString. Fixes https://github.com/xamarin/xamarin-macios/issues/4774
* Add new member to `NLLanguage` to avoid `ArgumentNullException` when it has not been evaludated (API returns `null`), see unit tests;
* Add `[Params]` to `NLTagger` constructors so they are easier to use (no need to create the array in source);
* Fix `GetTag` so it returns (`out`) the `NSRange`, it's natively a `NSRangePointer`;
* Fix `GetTag[s]` API with changes to `NLTag` de-enumification;
* Add unit tests
2018-09-11 08:40:42 -04:00
Sebastien Pouliot 0057b7c58e
[imageio] Add availability attributes to `Maker*Dictionary` fields (#4753)
and remove custom test that introspection already cover (based on
the availability attributes)
2018-09-05 13:27:46 -04:00
Manuel de la Pena fb9ae90937 [Network] Small change in NWParameters to use a property for RequiredInterface. (#4742)
Added missing tests. Also modified the Interface property in
NWParameters and fix a small typo in NWProtocolMetadata.
2018-09-05 08:07:10 -04:00
Vincent Dondain 9754d505ff [ObjCRuntime] Add missing .ctor to 'Class' (#4726)
- Fixes #4441: [generator] Binding with return value of Class [] do not do the right thing
  (https://github.com/xamarin/xamarin-macios/issues/4441)
- Turns out the logic to put INativeObjects into NSArrays was already in place. We simply needed to add the missing (IntPtr handle, bool owns) overload to `Class`.
- Uncommented AppKit `registeredImageRepClasses` since it was using `Class []`. Tested locally and it works fine.
- Reimplemented `Foundation`'s `NSSecureUnarchiveFromDataTransformer` and its test which were also using `Class []`.
2018-08-29 16:23:36 -04:00
Sebastien Pouliot 807efadf38
[coreimage] Add generator support for CIVector[] and enable it in CIMeshGenerator. Fix #4226 (#4715) 2018-08-29 13:29:34 -04:00
Sebastien Pouliot bc2dfe335f
[tests] Add missing availability attribute and adjust tests to run on iOS 7 devices. Fix #4437 (#4719)
Fix https://github.com/xamarin/xamarin-macios/issues/4437 where the Mac check
always returns `true` on iOS so the `||` condition was always `true`.
2018-08-29 09:09:43 -04:00
Sebastien Pouliot d99be7a03e
Merge d15-8 into xcode 10 2018-08-21 09:29:35 -04:00
Sebastien Pouliot d9edf5928d
[avfoundation] Deprecate 'AVMediaTypeTimedMetadata' (#4655)
AVMediaTypeTimedMetadata has been obsoleted since iOS 6 but was totally
removed (returns null) in iOS 12.

Adjust test and provide a (better) deprecation warning for developers.
2018-08-21 08:57:44 -04:00
Manuel de la Pena 92d6e94707 [NaturalLanguage] Change return type to use double instead on nuint. Fixes #4642 (#4654)
The docs or headers do not specify the exact type. Using double to be
sure.

Issue: https://github.com/xamarin/xamarin-macios/issues/4642
2018-08-20 21:44:24 -04:00
Sebastien Pouliot 213590b3c0
[tests] Re-enable AVPlayerViewController.PrepareForPrerollAds test (broken in early betas) (#4656) 2018-08-20 21:15:58 -04:00
Sebastien Pouliot c7e791a514
[tests] Re-enabled CIBarcodeGenerator tests (failed in earlier betas) (#4651) 2018-08-20 15:26:59 -04:00
Rolf Bjarne Kvinge 5f4327ab0f
[CoreGraphics] Fix CGFunction to work after being disposed. (#4644)
We have a test for CGFunction, and in iOS 12 the behavior changed where
previously the CGFunction was invoked immediately when rendering, it's now
retained and only called later.

This is troublesome for the test, because it disposes the managed CGFunction
when it thinks it's completed. Since the function is invoked way later, the
test now crashes. Ops.

The obvious fix is to change the test to dispose the CGFunction later. This
falls flat when finding out that "later" is undetermined. Native code retains
the CGFunction, and can do whatever it wishes with it until it's released, and
there's no way to know when that is.

OK: what about not disposing the CGFunction, and letting the GC do its job?
This also falls flat, because there's a circular reference between the native
CGFunction and the managed wrapper, preventing any of them from being released
automatically by the GC. The only way to break the circular reference is to
dispose the managed wrapper.

So, can we fix the circular reference? Unfortunately not, because we can't
monitor the native CGFunction's retain count, which is required in order to
switch the native->managed link between weak and strong according to the
retain count.

This leaves one solution (that I could come up with at least): make sure
everything works fine after disposing the managed wrapper.

This involves a few things:

* Only break the native->managed connection (the 'gch' GCHandle) when the
  native CGFunction is freed. This is accomplished by using the API provided
  by Apple for exactly that purpose (the 'release' callback field in the
  'CGFunctionCallbacks' struct).

* Use a static variable for the 'CGFunctionCallback' struct and its contents.
  This solves another potential problem: the GC could have collected the
  delegate to the 'EvaluateCallback' function at any point.

* Don't null out the 'evaluate' delegate in Dispose. This leaves the user with
  no way to break a potential circular reference through that delegate (since
  it will never be null), so provide a property that makes it possible for
  users to explicitly null out the delegate ('EvaluateFunction').

* Only call the 'evaluate' callback if it's not null.

This also has the additional advantage that test (and any customer code
running into the same issue) works without modifications.
2018-08-20 07:40:54 +02:00
Rolf Bjarne Kvinge 965e1f7bcc Merge remote-tracking branch 'origin/xcode10' into xcode10-rebase-15.8 2018-08-16 17:09:30 +02:00
Vincent Dondain 3548c44782
[metal] Update for Xcode 10 beta 1, 2, 3 & 4 (#4562) 2018-08-15 10:09:23 -04:00
Vincent Dondain eec95e881c Merge branch 'd15-8' into xcode10-rebase-15.8 2018-08-13 21:04:56 -04:00
Sebastien Pouliot 0b7265193a
[coreservices] Update up to beta 5 (#4590)
Also avoid creating NSString instances for hidden constants where
only the handle is every used.
2018-08-08 12:38:03 -04:00
Manuel de la Pena 82d21bc211
[Tests] Fix failing tests on iOS 8. Fixes #4437 (#4592)
Some of the tests fail because the assert is looking at the wrong iOS
version. Looking at the API definitions:

* UIStackView - Available in iOS 9, not iOS 8.
* AudioServicesPlayAlertSoundWithCompletion - Available in iOS 9, not
iOS 8.

All the other tests reported in the issue pass.

Issue: https://github.com/xamarin/xamarin-macios/issues/4437
2018-08-08 16:14:04 +02:00
Rolf Bjarne Kvinge c77f191064 [CoreGraphics] Add missing API added in Xcode 10 beta 1. (#4547)
* [CoreGraphics] Add CGPDFArray.Get* overloads that take a nint index, since the CGPDFArray.Count property returns nint.

This makes the following code work:

    for (var i = 0; i < array.Count; i++)
    	array.GetInt (i, ...)

* Don't add [MonoPInvokeCallback] to Mac code.

* [CoreGraphics] Rename CGPDFArray.ApplyBlockCallback to ApplyCallback.

Since the fact that the method is implemented using a block is not relevant
for managed code.

This also makes the method named like an equivalent method in CGPDFDictionary.

* [CoreGraphics] Change CGPDFArray.Apply to take an 'object' as the info parameter instead of IntPtr.

This makes it nicer for managed code.

* [CoreGraphics] CGPDFArray.Apply: resolve the iterated object to the actual CGPDFObject type.

* [CoreGraphics] Add an CGPDFDictionary.Apply overload that resolves the iterated object to the actual CGPDFObject type.

This method was previously only available in Classic, so I just reintroduced
it with a few changes to make the API nicer (which isn't a breaking change
since we're not building Classic anymore).

* [tests] Add test for CGPDF types.

* [tests] Don't run the new tests unless the SDK was part of Xcode 10
2018-08-02 20:30:41 -04:00
Alex Soto b808213465 [Vision] Update bindings to Xcode 10 beta 1, nothing in beta 2 (#4321) 2018-08-01 10:50:13 -04: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
Sebastien Pouliot 745ac8f1db
[foundation] Override Message property in NSErrorException. Fixes #4133 (#4176)
The default `Message` property is not every helpful. Better information
is available inside the `Error` property but it's not general (nor cross
platform) when dealing with exception.

Include unit tests (on an existing test checking NSError values)

https://github.com/xamarin/xamarin-macios/issues/4133
2018-08-01 09:18:04 -04:00
Rolf Bjarne Kvinge 215ab7fc1a
[mtouch] Unify code to detect and handle frameworks that aren't supported in the simulator. Fixes #4422. (#4510)
Unify the code to detect frameworks that aren't supported in the simulator (we
had switches in two places, now this data is stored per framework).

Also remove some of the Metal frameworks for some of the platforms from these
lists (since they're now available in the simulator in some cases), which
fixes #4422.

It also seems CoreAudioKit is now available in the simulator (it wasn't in the
first Xcode 7 beta, but apparently added in a later beta. This made our
exclusion incorrect, but we never noticed).

https://github.com/xamarin/xamarin-macios/issues/4422
2018-07-27 16:30:08 +02:00
Chris Hamons 6d039cb969
Foundation for Xcode 10 Beta 1-2 (#4375)
- Work around #4441 by commenting out binding until fixed
2018-07-13 14:27:29 -04:00
Manuel de la Pena 62017a1405
[iAd] Xcode 10 beta 3 support. (#4425) 2018-07-13 16:23:44 +02:00
Vincent Dondain 2f89775fc2 [arkit] Update to Xcode 10 beta 3 (#4406)
- Updated some ARReferenceObject APIs based on their (better) Swift names. Breaking changes but on new APIs.
- Update ARReferenceObjectTest for device (center and extent have real values on device).
- Reuploaded an arobject file from Beta 3 just in case because of: "ARReferenceObject and ARWorldMap data generated using iOS 12 beta 2 or earlier isn’t compatible with beta 3 or later. Please rescan your objects to generate new ARReferenceObject and ARWorldMap data."
2018-07-05 22:36:33 -04:00
Alex Soto 79e1392823
[Intents|UI] Update bindings to Xcode 10 Beta 3 (#4402) 2018-07-05 15:36:24 -05:00
Rolf Bjarne Kvinge b8b6ef3f5f
Merge pull request #4278 from rolfbjarne/jenkins-mojave
[tests] Run Xamarin.Mac tests on Mojave, and add more Xamarin.Mac tests.

* Add more Xamarin.Mac tests: introspection, link sdk, link all and xammac_tests.
* Fix TextureAtlasTest.Empty to not crash due to Apple not liking null callbacks. (#4003)
* Run Xamarin.Mac tests on Mojave as well, even though the build OS is an earlier OS (High Sierra).
2018-07-05 18:43:17 +02:00
Rolf Bjarne Kvinge 849453a612 [monotouch-test] Adjust DlfcnTest.OpenClose_libSystem to work with Xcode 10. Fixes #4377. (#4391)
Fixed https://github.com/xamarin/xamarin-macios/issues/4377.
2018-07-04 20:38:45 -04:00
Rolf Bjarne Kvinge 1b12348e57 [tests] Refactor API to check/assert current OS version. 2018-07-04 12:35:15 +02:00
Rolf Bjarne Kvinge bcfd6290c3 Merge remote-tracking branch 'origin/xcode10' into jenkins-mojave 2018-07-04 12:35:10 +02:00
Rolf Bjarne Kvinge 17093d4311 [tests] Make MTLDeviceTests work on macOS systems that don't support metal. (#4059) 2018-07-04 00:21:45 +02:00
Rolf Bjarne Kvinge fe8e2cc439 [monotouch-test] Cope with potential symlinks when comparing bundle paths. 2018-07-03 20:47:14 +02:00
Rolf Bjarne Kvinge 392d74754e [monotouch-test] Fix NRE in CentralManagerTest's TearDown method, and improve some failure scenarios. 2018-07-03 20:47:14 +02:00
Rolf Bjarne Kvinge d3baa2b635 [monotouch-test][EventKit] Check for permission before putting up dialogs for EKEventStore. 2018-07-03 20:47:14 +02:00
Rolf Bjarne Kvinge 517bd6b506 [monotouch-test] Fix typo in test name. 2018-07-03 20:47:14 +02:00
Rolf Bjarne Kvinge eaf1e567ac [monotouch-test][CoreGraphics] Fix P/Invokes to work on all platforms. 2018-07-03 20:47:14 +02:00
Rolf Bjarne Kvinge 51cdac8e60 [monotouch-test] Implement a cross-platform way of converting UIColor/NSColor to GCColor, and use it. 2018-07-03 20:47:14 +02:00
Rolf Bjarne Kvinge 5fbb714c09 [monotouch-test] Remove Classic tests and any version checks for versions earlier than the minimum deploymnent target. 2018-07-03 20:47:14 +02:00
Rolf Bjarne Kvinge 9703f17c91 [monotouch-test] Fix versions checks.
* Fix many version checks to be based on Xcode version instead of iOS version.
* Added/fixed a few expected values according to platform version to match behavior in older macOS versions.
2018-07-03 20:47:14 +02:00
Rolf Bjarne Kvinge cbb637630b [tests] Remove Classic-only tests. 2018-07-03 16:57:16 +02:00
Alex Soto 709e855c15
[CoreText] Update bindings to Xcode 10 Beta 1 & 2 (#4368)
* [CoreText] Update bindings to Xcode 10 Beta 1 & 2

* Adds tests and unbreaks API

* Check for Xcode 10 in tests
2018-07-03 09:48:10 -05:00
Rolf Bjarne Kvinge c3237f5d10 [tests] Fix TextureAtlasTest.Empty to not crash due to Apple not liking null callbacks. (#4003)
[tests] Fix TextureAtlasTest.Empty to not crash due to Apple not liking null callbacks.
2018-07-02 19:05:27 +02:00
Alex Soto e45838a1e8
Fix GetMatchingFontDescriptors overload with sort callback (#3871) (#4373)
It incorrectly returned array of arrays instead of array of CTFontDescriptors.

Add CTFontCollectionTest
2018-06-29 16:05:00 -05:00
Sebastien Pouliot 4da64a8355
[systemconfiguration][tvos] CaptiveNetwork API are now marked as prohibited in tvOS (#4357) 2018-06-29 09:35:05 -04:00
Rolf Bjarne Kvinge e110612118
[registrar] Improve error message when failing to create a managed wrapper for a native handle. (#4360)
* Convert it into a MM8027/MT8027 error (with documentation).
* Add information about the selector and managed method that triggered the error.

Now the problem reported in issue #4254 shows up as:

> ObjCRuntime.RuntimeException: Failed to marshal the Objective-C object 0x7f8080412810 (type: UIView). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'UIKit.UIView&' does not have a constructor that takes one IntPtr argument).
> Additional information:
> 	Selector: popoverController:willRepositionPopoverToRect:inView:
> 	Method: UIKit.UIPopoverController+_UIPopoverControllerDelegate.WillReposition(UIKit.UIPopoverController, CoreGraphics.CGRect ByRef, UIKit.UIView ByRef)

instead of just:

> ObjCRuntime.RuntimeException: Failed to marshal the Objective-C object 0x7f8080412810 (type: UIView). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'UIKit.UIView&' does not have a constructor that takes one IntPtr argument).

which makes it much easier to understand, track down, and fix/work around,
both for customers and ourselves.
2018-06-29 14:38:28 +02:00
Rolf Bjarne Kvinge d79bef79a0
[ObjCRuntime] Make Class.GetHandle not handle byref types. Fixes #4254. (#4361)
* [ObjCRuntime] Make Class.GetHandle not handle byref types. Fixes #4254.

This is a regression between d15-6 and d15-7: it's an unindented consequence
of the changes required to link away the dynamic registrar.

This unindented consequence is non-obvious: it made Class.GetHandle
successfully look up byref types, since we're now using metadata tokens to
look up a Class from the managed Type, and it turns out the metadata tokens
are the same for byref types as the corresponding non-byref type, so
Class.GetHandle treats them identically.

This was not the behavior for Class.GetHandle in d15-6, and other code relied
on this behavior (in particular calling isKindOfClass: in Runtime.GetNSObject
with a nil class returns false, and we'd end up in a different code path that
would not try to create the managed peer with a byref type).

So make sure Class.GetHandle doesn't change its behavior compared to d15-6 by
special-casing byref types to return IntPtr.Zero.

Fixes https://github.com/xamarin/xamarin-macios/issues/4254.

* Move byref check earlier to get identical behavior when the dynamic linker is optimized away.

Also add checks for pointer and array types for the same reason.
2018-06-29 14:33:55 +02:00
Rolf Bjarne Kvinge 5245cfab14
[Foundation] Fix NSDictionary string indexers. (#4335)
Creating a new NSString doesn't always lead to creating a new NSString, which
will obviously cause trouble.

The scenario is:

* An NSString with the value @"Bye" is added to an NSDictionary, with the same
  string as both the key and the value.

* The (managed) string indexer is used to try to get the value back. The
  string indexer would call 'new NSString ("Bye")', which would create a new
  managed NSString, and maybe a new native NSString (or maybe it would re-use
  an existing NSString). Then the handle of this NSString would be passed to
  the native API, and the same handle would come back as the result (since the
  same string is both the key and the value). We'd call Runtime.GetNSString on
  the returned handle, get back the same managed instance that was created
  just before the call to the native method. Finally, just before returning
  this managed instance from the indexer, we'd dispose it... since it was
  created in a 'using' block. Then we'd return a disposed NSString object from
  the indexer. Ops.

The fix is to not create a managed wrapper for the NSString handle we need to
pass to the native API, but create and free the native NSString object without
using a managed wrapper.
2018-06-28 14:57:41 +02:00
Rolf Bjarne Kvinge 06fd4029f3
[generator] Fix generated code for INativeObject properties in filters: we don't own such objects. (#4330)
Fixes a crash in the MonoTouchFixtures.CoreImage.FilterTest.ColorSpace on macOS 10.9 and 10.10:

    Assertion failed: (!space->is_singleton), function color_space_dealloc, file ColorSpaces/color-space.c, line 102.
    Stacktrace:

      at <unknown> <0xffffffff>
      at (wrapper managed-to-native) CoreGraphics.CGColorSpace.CGColorSpaceRelease (intptr) [0x00009] in <7709ef494bc84be8a727c0b1d19c4344>:0
      at CoreGraphics.CGColorSpace.Dispose (bool) [0x00016] in /Library/Frameworks/Xamarin.Mac.framework/Versions/4.99.0.103/src/Xamarin.Mac/CoreGraphics/CGColorSpace.cs:116
      at CoreGraphics.CGColorSpace.Finalize () [0x00002] in /Library/Frameworks/Xamarin.Mac.framework/Versions/4.99.0.103/src/Xamarin.Mac/CoreGraphics/CGColorSpace.cs:94
      at (wrapper runtime-invoke) object.runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr) [0x0001f] in <ea4ecc87ef1044a98fc1b5fdb59119e7>:0

    Native stacktrace:

    	0   xammac_tests                        0x000000010d55fc18 mono_handle_native_crash + 264
    	1   libsystem_platform.dylib            0x00007fff8d4a152a _sigtramp + 26
    	2   ???                                 0x0000000000000000 0x0 + 0
    	3   libsystem_c.dylib                   0x00007fff9aba76df abort + 129
    	4   libsystem_c.dylib                   0x00007fff9ab6edd8 basename + 0
    	5   CoreGraphics                        0x00007fff8c2b58b8 color_space_dealloc + 248
    	6   CoreFoundation                      0x00007fff87997af3 CFRelease + 371
    	7   ???                                 0x00000001248548cd 0x0 + 4907681997
    	8   ???                                 0x000000012416a13c 0x0 + 4900430140
    	9   xammac_tests                        0x000000010d5f7d0e mono_gc_run_finalize + 734
    	10  xammac_tests                        0x000000010d6e859a sgen_gc_invoke_finalizers + 234
    	11  xammac_tests                        0x000000010d5f9754 finalizer_thread + 756
    	12  xammac_tests                        0x000000010d6ae930 start_wrapper + 704
    	13  libsystem_pthread.dylib             0x00007fff8ae8999d _pthread_body + 131
    	14  libsystem_pthread.dylib             0x00007fff8ae8991a _pthread_body + 0
    	15  libsystem_pthread.dylib             0x00007fff8ae87351 thread_start + 13

On newer macOS versions, the API that returns a CGColorSpace returns a global
object that can't be retained/released, and thus won't crash since the
CGColorSpace is never freed.
2018-06-25 10:47:14 +02:00
Vincent Dondain 2f1859733d
[arkit] Update to Xcode 10 beta 1 (ARKit 2.0) (#4209)
I obsoleted `GetProjectPoint` in favor of `Project` because of the introduction of `Unproject` (which made me realize the naming was wrong) and based on the API doc https://developer.apple.com/documentation/arkit/arcamera/2923538-projectpoint?language=objc. 

The `CGPoint` returned is the projection of a point. An other naming option would have been `GetProjectedPoint` but I think `Project` is closer to the original and clear enough. You project/unproject something onto something else and you get the projection back.
2018-06-14 13:44:45 -04:00
Manuel de la Pena f77f44940e
[NaturalLanguage] Added the new framework for Xcode10. (#4236) 2018-06-14 19:21:44 +02:00
Sebastien Pouliot 2d6ce7459d
Bump to use Xcode 10 beta 1 (#4179)
* Bump to use Xcode 10 beta 1

* Update Versions.plist

* Add a dependency on Xcode 9.4.

* [msbuild] Fix build with Xcode 10 beta 1. (#4182)

Many years ago (in Xcode 7 according to code comment)
Developer/Platforms/iPhoneOS.platform/Developer/usr disappeared, and we coped
by looking at Developer/usr instead (and also the subsequent code to locate
the bin directory was based on the location of the usr directory).

Developer/Platforms/iPhoneOS.platform/Developer/usr reappeared in Xcode 10
beta 1, but it seems useless (for one it doesn't contain a bin directory), so
in order to try to keep things sane don't look for this directory in Xcode 10
and instead go directly for Developer/usr (which is what we've been using as
the usr directory for years anyway).

Fixes this problem when building apps with Xcode 10 beta 1:

      /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(626,3): error : Could not locate SDK bin directory [/Users/rolf/Projects/TestApp/test-app.csproj]

* [runtime] Build 32-bit mac executables using Xcode 9.4.

* [mtouch] Work around broken tvOS headers in Xcode 10 beta 1.

* [mtouch] Work around build problem with Apple's simd headers in Objective-C++ mode.

* Use version-agnostic paths to sdk directories.

* [tests][xtro] Add todo files (from unclassified) and adjust ignore files to avoid errors

* [macos][security] Re-enable SSL[Get|Set]AlpnProtocols. Fixes #4001 (#4022)

* [macos][security] Re-enable SSL[Get}Set]AlpnProtocols. Fixes #4001

This was fixed in macOS 10.13.4

https://github.com/xamarin/xamarin-macios/issues/4001

* [tests][monotouch-tests] Disable a few test cases (one crasher, other failures). Causes to be verified later

* [xharness] Fix permission dialog suppression in Xcode 10.

* [xharness] Ignore 32-bit macOS tests by default.

* [tests] Execute mmp regression tests with Xcode 9.4 since many of them are 32-bit and needs porting to 64-bit.

* [mmptest] Ignore 32-bit XM tests if we don't have a 32-bit-capable Xcode.

* [registrar] Add workaround for broken headers in Xcode 10 beta 1 (radar 40824697).

* [mtouch] Restrict another workaround for an Xcode 10 beta 1 bug to a specific Xcode version to remove it asap.

* [tests] Fix some protocol changes (public or not) find by introspection tests

* [tests][intro] Fix DefaultCtorAllowed failures

* [Intents] Obsolete several Intents classes in watchOS.

Several existing Intents classes have been marked as unavailable in watchOS in
the headers in Xcode 10 beta 1, and corresponding tests are now failing.

So obsolete the managed wrapper types, and fix tests accordingly.

* Fix xtro wrt previous Ietents/intro changes

* [tests] Minor adjustments to mtouch tests to work with Xcode 10.

* [msbuild] Update tests to cope with additional files produced by the Core ML compiler.

* [msbuild] Xcode 10 doesn't support building watchOS 1 apps, so show a clear error message explaining it.

Also update tests accordingly.

* [coreimage] Stub new filters and exclude ?removed? ones from tests

* Update GameplayKit and SpriteKit NSSecureCoding _upgrade_ and fix other non-public cases (in tests)

* [tests] Ignore some GameKit selectors that don't respond anymore (but seems to be available, at least in header files)

* [tests] Fix intro 32bits testing for filters resutls

* [msbuild] Slightly change error message to be better English.
2018-06-08 18:45:24 -07:00
Manuel de la Pena c4a64ad7d9 [Compression] Ensure we use the correct linking flags for older versions. Fixes #4129. (#4169) (#4184)
Libcompresison was added after iOS 9.0, TvOS 9.0, MacOS 10.11 and watchOS
2.0. We want to use weak in those older platforms.

Fixes issue https://github.com/xamarin/xamarin-macios/issues/4129
2018-06-05 14:56:49 -04:00
Manuel de la Pena aa7c95eca7
[Compression] Ensure we use the correct linking flags for older versions. Fixes #4129. (#4169)
* [Compression] Ensure we use the correct lonking flags for older versions. Fixes #4129.

Libcompresison was added after iOs 9.0, TvOS 9.0, Mac 10.11 and Watch
2.0. We want to use weak in those older platforms.

Fixes issue https://github.com/xamarin/xamarin-macios/issues/4129
2018-06-05 09:12:27 -07:00
kunigaku 07356b8391 [foundation] Fix empty NSData.ToArray() crash (#4103) 2018-05-18 14:52:47 -04:00
Manuel de la Pena f765d674d3 [Compression] Add compression framework bindings. (#3942) 2018-05-11 15:54:31 -04:00
Rolf Bjarne Kvinge 285062208d
[tests] Make MTLDeviceTests work on macOS systems that don't support metal. (#4059) 2018-05-09 15:14:42 +02:00
Sebastien Pouliot 380821fa1a
[coretext] Enable CTFont tests on watchOS and macOS. Fixes #3925 (#4035)
`CTFontCreateWithGraphicsFont` is actually available on macOS and watchOS,
so it's enabled, in `CGFont`, along with its unit test.

https://github.com/xamarin/xamarin-macios/issues/3925
2018-05-04 13:32:59 -04:00
Sebastien Pouliot 353ce95c70
[macos][security] Re-enable SSL[Get|Set]AlpnProtocols. Fixes #4001 (#4022)
* [macos][security] Re-enable SSL[Get}Set]AlpnProtocols. Fixes #4001

This was fixed in macOS 10.13.4

https://github.com/xamarin/xamarin-macios/issues/4001
2018-05-02 20:32:30 -04:00
Rolf Bjarne Kvinge 3385b68e5a
[monotouch-test] Fix WeakReferenceTest.WeakTest to work on watchOS/LLVM. (#4010)
Change WeakReferenceTest.WeakTest so that it doesn't fetch values that should
be garbage collected on the main thread.

Doing so on the main thread may cause those values to stay in registers as
temporary values, thus preventing the garbage collector from collecting them.

Instead do the fetching in a background thread, whose stack won't exist
anymore once it's finished.

Fixes this test failure when running on watchOS device in release mode:

    [FAIL] WeakReferenceTest.WeakTest : 't.Obj4' should be null

The reason it only happens on watchOS in release mode, is probably because
LLVM puts temporary values in different registers than Mono's AOT compiler
does.
2018-04-30 12:50:10 +02:00
Rolf Bjarne Kvinge f7ce5b91c5 [monotouch-test] Make BundleTest.TestPreferredLocalizations laxer. (#4005)
Change test to verify that all preferred localizations are in the list of
available localizations (instead of hardcoding an expected result of 'en').

This makes the TestPreferredLocalizations work if the device language is 'es',
in which case the preferred language between 'en' and 'es' is obviously 'es'.
2018-04-27 12:00:17 -04:00
Rolf Bjarne Kvinge 73f6bf0722
[tests] Determine at runtime instead of compile time whether LinkAll is enabled. Fixes #3812. (#4004)
* [tests] Determine at runtime instead of compile time whether LinkAll is enabled. Fixes #3812.

This way we can remove the LINKALL define, which also means nobody can forget
to define it when building using LinkAll.

https://github.com/xamarin/xamarin-macios/issues/3812
2018-04-27 13:11:27 +02:00
Rolf Bjarne Kvinge 7cbaa2d1a2
[tests] Fix TextureAtlasTest.Empty to not crash due to Apple not liking null callbacks. (#4003)
[tests] Fix TextureAtlasTest.Empty to not crash due to Apple not liking null callbacks.
2018-04-27 07:37:27 +02:00
Sebastien Pouliot bf159969f9
[foundation] Avoid unnecessary native calls for NSNull.Null. Fixes #3544 (#3984)
Repetitive calls to `NSNull.Null.Handle`, e.g. from `NSArray.UnsafeGetItem<T>`,
means several (one by item), costly, calls into ObjC code - but it always
return the same (native) singleton.

This manually cache the managed `NSNull.Null` static value, once it's
initialized the first time, so future calls won't have the performance
penalty.

https://github.com/xamarin/xamarin-macios/issues/3544
2018-04-26 09:24:46 -04:00