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

1291 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 38a2442839
[tests] Run the OutOverriddenWithoutOutAttribute test on all platforms on .NET (#17827) 2023-03-17 07:57:59 +01:00
Steve Hawley 61ad2a9dec
CGEventCreate fixed broken call, added tests (#17805)
Fixes https://github.com/xamarin/xamarin-macios/issues/17656
2023-03-16 11:00:12 -04:00
Rolf Bjarne Kvinge c398f333fc
[monotouch-test] Be more accepting in the NSTextInputClient test. (#17795)
It seems we can get different results depending on OS versions, but I had no
success figuring out the conditions that make the results differ, so just
accept all variations we get.
2023-03-15 14:33:44 +01:00
Rolf Bjarne Kvinge 29633a6231
[generator] Make the block callbacks UnmanagedCallersOnly functions in .NET. (#17741)
This also required updating a manual binding since it poked into
generated internals.

Contributes towards https://github.com/xamarin/xamarin-macios/issues/15783.
2023-03-14 10:08:28 +01:00
Rolf Bjarne Kvinge d6d02fa05a
[monotouch-test] Fix bool encoding in tests on ARM64 on Mac Catalyst. (#17695)
Fixes:

    [FAIL] TestTypeEncodings :   #14
        String lengths are both 1. Strings differ at index 0.
        Expected: "B"
        But was:  "c"
        -----------^
2023-03-08 10:43:52 +01:00
Rolf Bjarne Kvinge a4ae14870f
[generator] Generate block callback signatures using only blittable types. (#17712)
Change the generated block callbacks so that we only use blittable types
(so that the callbacks can become [UnmanagedCallersOnly]).

This involved two changes:

* Use pointer types instead of ref/out types ('int*' instead of 'ref/out int').
* Use 'byte' instead of 'bool'.

Contributes towards https://github.com/xamarin/xamarin-macios/issues/15783.
2023-03-07 17:38:36 +01:00
Rolf Bjarne Kvinge 63e6d9b4e8
[src] Commit some of the response files. (#17718)
We'll soon build and run tests on Windows, and some tests use these response files,
so it makes building these tests on Windows easier if we don't have to re-create
the response files (our generation logic is all written in make, which is not the
easiest on Windows).
2023-03-07 17:32:27 +01:00
Rolf Bjarne Kvinge 666bd9ae9e
[tests] Fix NSTextInputClient tests on macOS Ventura. (#17713)
Fixes:

    apitest.NSTextInputClient
        [FAIL] NSTextInputClient_ShouldGetBaselineDelta :   NSTextInputClient_ShouldGetBaselineDelta - Returned wrong baseline delta value
            Expected: True
            But was:  False
              at apitest.NSTextInputClient.NSTextInputClient_ShouldGetBaselineDelta () [0x0000e] in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/monotouch-test/AppKit/NSTextInputClient.cs:108
        [FAIL] NSTextInputClient_ShouldGetFirstRect :   NSTextInputClient_ShouldGetFirstRect - Returned wrong rect
            Expected: {X=0,Y=0,Width=12,Height=14}
            But was:  {X=0,Y=0,Width=0,Height=14}
              at apitest.NSTextInputClient.NSTextInputClient_ShouldGetFirstRect () [0x00030] in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/monotouch-test/AppKit/NSTextInputClient.cs:84
2023-03-07 07:47:39 +01:00
Rolf Bjarne Kvinge fb3df91407
[tests] Adjust EveryFrameworkSmokeTest to not run when every assembly is linked. (#17696)
It expects the executable to be linked will every system framework we've
bound, which doesn't happen when linker is enabled for all assemblies.
2023-03-06 13:38:07 +01:00
Rolf Bjarne Kvinge 3f742de4aa
[monotouch-test] Fix NWBrowserTest to not throw assertions on background threads. (#17697)
Exceptions on background threads will crash the process.
2023-03-06 12:48:39 +01:00
Rolf Bjarne Kvinge d75b697ebc
[tests] Adjust UrlSessionTests to ignore more failure scenarios in CI. (#17649)
Should fix random test failures like this:

    MonoTouchFixtures.Foundation.UrlSessionTest
        [FAIL] CreateDataTaskAsync :   CreateDataTask a Exception
            Expected: null
            But was:  <Foundation.NSErrorException: Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={_kCFStreamErrorCodeKey=57, NSUnderlyingError=0x6000011f4990 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={NSErrorPeerAddressKey=<CFData 0x600003deaa80 [0x7ff865b1f1c0]>{length = 16, capacity = 16, bytes = 0x100201bb6007a9b70000000000000000}, _kCFStreamErrorCodeKey=57, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <5E766082-B379-491A-BCB0-EA1B36E54A8B>.<15>, _NSURLErrorRelatedURLSessionTaskErrorKey=("LocalDataTask <5E766082-B379-491A-BCB0-EA1B36E54A8B>.<15>"), NSLocalizedDescription=The network connection was lost., NSErrorFailingURLStringKey=https://www.microsoft.com/, NSErrorFailingURLKey=https://www.microsoft.com/, _kCFStreamErrorDomainKey=1}
                at MonoTouchFixtures.Foundation.UrlSessionTest+<>c__DisplayClass1_0.<CreateDataTaskAsync>b__0 () [0x00039] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/Foundation/UrlSessionTest.cs:64 >
                at MonoTouchFixtures.Foundation.UrlSessionTest.CreateDataTaskAsync () [0x000b7] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/Foundation/UrlSessionTest.cs:71
2023-03-02 10:38:41 +01:00
Rolf Bjarne Kvinge 8285c08c17
[registrar] Improve support for pointers to value types in exported signatures. (#17608)
This will be required when we make blocks use blittable callbacks, since we'll
have to use pointers in a few cases (because ref/out arguments aren't
blittable).
2023-02-28 11:48:27 +01:00
Rolf Bjarne Kvinge aaa79e85ed
[tests] Improve diagnostic output in FSEventStreamTest. (#17614)
Ref: https://github.com/xamarin/maccore/issues/2630
2023-02-27 14:14:05 +01:00
Steve Hawley 1ca9a8fbdf
[dotnet] CGImageMetadata (#17530)
Fixed pinvoke used for CGIMetadata.EnumerateTags
2023-02-23 10:50:58 -05:00
Rolf Bjarne Kvinge c8ca8f401f
[monotouch-test] Fix AUParameterNodeTest to not crash the process in case of asserts on background threads. (#17593) 2023-02-23 14:34:50 +01:00
Rolf Bjarne Kvinge f8f5124a88
[generator] Fix fetching nullability for block properties by checking the property for nullability info. (#17594) 2023-02-23 14:34:20 +01:00
Manuel de la Pena 498ced1811
[Generator] Remove method that is already present in the reflection API. (#17524)
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2023-02-13 19:17:38 -05:00
dustin-wojciechowski 3eeb7691dc
Add ventura to mac tests configurations (#17349)
Added Ventura machines to macTestConfigurations within both the
build-ci-pipeline and the build-pr-pipelines.

---------

Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2023-02-13 11:08:18 -05:00
Rolf Bjarne Kvinge fd44670214
[ObjCRuntime] Make sure to call 'Release' in all code paths in Runtime.GetINativeObject<T> when owns=true. Fixes #12732. (#17118)
Fixes https://github.com/xamarin/xamarin-macios/issues/12732.
2023-02-07 07:22:35 +01:00
Rolf Bjarne Kvinge 13f51fb583
[tests] Add another failure scenario to random network test failures in CI. (#17439) 2023-02-07 07:22:09 +01:00
dustin-wojciechowski 51bee958f0
Added GPSLatitudeRef and GPSLongitudeRef to CGImagePropertiesGPS. (#17166)
Fixes #17162

Added GPSLatitudeRef and GPSLongitudeRef to CGImagePropertiesGPS. 
Added new photo to all resources folders that has GPS data. 
Created new test that reads GPS information off a photo and verifies that it is correct.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2023-01-28 09:31:25 -08:00
dustin-wojciechowski 9c0bfd4e42 [src] Added manual binding to prevent issue of AVAudioPlayer FromData() and FromUrl() throwing exceptions. (#17073)
Provided manual binding of AVAudioPlayer::initWithContentsOfURL:error: and AVAudioPlayer::initWithData:error: to prevent an issue where AVAudioPlayer::FromData() and FromUrl() do not throw exceptions when returning null.

Fixes #16229

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2023-01-24 14:22:34 +01:00
Rolf Bjarne Kvinge 4453d773ce
[tests] Unify code related to how to load test assemblies. (#17111)
Unify a lot of code related to how to load test assemblies.

This resulted in adding a couple of test assemblies to monotouch-test when executed on macOS (this was a bug), and this also required adapting some of those tests to work correctly on macOS.
2023-01-13 22:20:47 +01:00
Rolf Bjarne Kvinge 480a6ed844
[src/runtime] Fix lookup of RID-specific satellite resources. Fixes #16847. (#17117)
If we're creating a universal app, and here are satellite assemblies that are not
identical across all RuntimeIdentifiers, those assemblies will be stored in a RuntimeIdentifier-specific
subdirectory during the build.

Unfortunately we didn't know how to find those assemblies at runtime, causing localizations
in universal apps to not work.

This change will:

* Add support for looking in the directory where RID-specific satellite assemblies
  are stored.
* Add an assembly resolution event handler to our CoreCLR bridge so that we can
  execute our custom lookup code.
* Add an assembly resource lookup test to monotouch-test.
* Add a macOS + Mac Catalyst variation of monotouch-test to xharness that triggers
  the bug (a universal test app).

Fixes https://github.com/xamarin/xamarin-macios/issues/16847.
2023-01-13 21:58:34 +01:00
Rolf Bjarne Kvinge a02410530a
[tests] NWPathMonitors must be cancelled. (#17178)
Otherwise the process may crash later on:

    apitest.KernelNotificationTest

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

    =================================================================
    	Native stacktrace:
    =================================================================
    	0x1050093d6 - /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/xammac_tests/bin/x86/Debug/xammac_tests.app/Contents/MacOS/xammac_tests : mono_dump_native_crash_info
    	0x104ffcf3e - /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/xammac_tests/bin/x86/Debug/xammac_tests.app/Contents/MacOS/xammac_tests : mono_handle_native_crash
    	0x1050106c6 - /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/xammac_tests/bin/x86/Debug/xammac_tests.app/Contents/MacOS/xammac_tests : mono_crashing_signal_handler
    	0x7ff818795dfd - /usr/lib/system/libsystem_platform.dylib : _sigtramp
    	0x0 - Unknown
    	0x7ff81c88c9f8 - /usr/lib/libnetwork.dylib : nw_path_shared_necp_fd
    	0x7ff81c99e796 - /usr/lib/libnetwork.dylib : -[NWConcrete_nw_path_evaluator dealloc]
    	0x7ff81c9bb93e - /usr/lib/libnetwork.dylib : __nw_dictionary_dispose_block_invoke
    	0x7ff8184bc5a3 - /usr/lib/system/libxpc.dylib : _xpc_dictionary_apply_apply
    	0x7ff8184b97e9 - /usr/lib/system/libxpc.dylib : _xpc_dictionary_apply_node_f
    	0x7ff8184bc4cd - /usr/lib/system/libxpc.dylib : xpc_dictionary_apply
    	0x7ff81c98c7eb - /usr/lib/libnetwork.dylib : -[OS_nw_dictionary dealloc]
    	0x7ff81cfa5ab5 - /usr/lib/libnetwork.dylib : nw_path_release_globals
    	0x7ff81c9edba6 - /usr/lib/libnetwork.dylib : nw_settings_child_has_forked
    	0x7ff818783103 - /usr/lib/system/libsystem_pthread.dylib : _pthread_atfork_child_handlers
    	0x7ff81867482d - /usr/lib/system/libsystem_c.dylib : fork
    	0x1051b37a3 - /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/xammac_tests/bin/x86/Debug/xammac_tests.app/Contents/MacOS/xammac_tests : process_create
    	0x1051b224a - /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/xammac_tests/bin/x86/Debug/xammac_tests.app/Contents/MacOS/xammac_tests : ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal
    	0x1050e4111 - /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/xammac_tests/bin/x86/Debug/xammac_tests.app/Contents/MacOS/xammac_tests : ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal_raw
    	0x10d4f2437 - Unknown
    	0x10d4f1e4b - Unknown
    	0x10d4f188b - Unknown
    	0x10d4f17b3 - Unknown
    	0x10d4f1363 - Unknown
    	0x10d4f11bb - Unknown
    	0x10d4efc53 - Unknown
    	0x10d4ee121 - Unknown
    	0x105013d23 - /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/xammac_tests/bin/x86/Debug/xammac_tests.app/Contents/MacOS/xammac_tests : mono_jit_runtime_invoke
    	0x1051483f8 - /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/xammac_tests/bin/x86/Debug/xammac_tests.app/Contents/MacOS/xammac_tests : mono_runtime_invoke_checked
    	0x1051510cf - /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/xammac_tests/bin/x86/Debug/xammac_tests.app/Contents/MacOS/xammac_tests : mono_runtime_try_invoke_array
    	0x1050d7127 - /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/xammac_tests/bin/x86/Debug/xammac_tests.app/Contents/MacOS/xammac_tests : ves_icall_InternalInvoke
    	0x1050e9b57 - /Users/rolf/work/maccore/msbuild/xamarin-macios/tests/xammac_tests/bin/x86/Debug/xammac_tests.app/Contents/MacOS/xammac_tests : ves_icall_InternalInvoke_raw

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2023-01-12 14:30:23 +01:00
Rolf Bjarne Kvinge 8e98350e0a
[XKit] Fix creating NSTextLists with custom formats in .NET. Fixes #15766. (#17123)
In .NET, we changed the API for creating a NSTextList with a specified
NSTextListMarkerFormats, making NSTextListMarkerFormats a strongly typed enum,
and not allowing any other value except those in NSTextListMarkerFormats.

This was a mistake, because NSTextList can be created with other format values
than those available in NSTextListMarkerFormats.

So fix this by:

* Adding another NSTextListMarkerFormats enum value that specifies that the
  actual format is a custom one (NSTextListMarkerFormats.CustomString).
* Resurface an 'NSTextListMarkerFormats(string)' constructor that can be used
  to create an NSTextListMarkerFormats with a custom string.
* Add a NSTextListMarkerFormats.CustomMarkerFormat property that always
  retrieves the underlying string value for the format.
* Add a NSTextListOptions.None enum value, which means no options (since
  NSTextListOptions is a set of flags, it should be possible to specify no
  flags).
* Add two convenience constructors that don't take a NSTextListOptions value,
  defaulting to NSTextListOptions.None.
* Add tests!

Fixes https://github.com/xamarin/xamarin-macios/issues/15766.
2023-01-10 08:28:47 +01:00
Rolf Bjarne Kvinge dc37be300e
Remove bitcode-related code, since bitcode is dead. (#16986) 2022-12-12 15:25:37 +01:00
Rolf Bjarne Kvinge b3cb85c0ad
[tests] Allow for timeouts in CI in a few tests. (#16945)
Also add some exception handling.

Hopefully fixes more issues with broken network in CI.
2022-12-05 08:53:33 +01:00
Haritha Mohan 1dc6cacafb
[UIKit] Add GetWeight method for UIFontWeight (#16922)
Made UIFontWeightConstants visible and added an extensions method to
access font weights easily.
Also added test to ensure GetWeight works as expected. 
Fixes #10753

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-12-01 11:02:24 -08:00
Rolf Bjarne Kvinge 786346cf0c
[autoformat] Update some new code. (#16921)
This is code from PRs that were started before we started autoformatting the
files in question, and then merged afterwards.
2022-12-01 08:31:34 +01:00
Rolf Bjarne Kvinge d627b203eb
[tests] Create a shared AppDelegate class and use it everywhere. (#16877)
Create a shared AppDelegate class, which contains all the identical
AppDelegate code for all test projects. This reduces a lot of code duplication.
2022-11-28 18:17:49 +01:00
Rolf Bjarne Kvinge e4c940cdb8
[Foundation] Fix NSDate's explicit conversion operators with DateTime. (#16872)
We recently tried to fix NSDate's conversion operators with DateTime
(3c65ab1756), but unfortunately a corner case
was missed.

The new approach in the above-mentioned commit would get the individual
date/time components for a given date and use the appropriate constructor for
the other type to re-construct the date/time in question.

However, one case was missed: when converting from NSDate to DateTime, we'd
get a fractional number of milliseconds. This fractional number could be
something like 999.99 milliseconds, and when converting that to the int the
DateTime constructor expected for the number of milliseconds, then DateTime
would throw an exception, because the number of milliseconds could only be
between 0 and 999.

I've solved this by not using floating-point math in the computations. We're
now getting the number of nanoseconds from the NSDate (which is a natural
number, and represents the total number of nanoseconds less than a whole
second), and then converting that to the number of milliseconds, microseconds
and ticks that can be used with DateTime using integral math. Unfortunately
DateTime doesn't have a constructor that takes the remaining number of ticks
after all the other fields have been provided, but that can be added
afterwards.

I've also made a few other improvements:

* Improve the validation for the NSDate -> DateTime conversion to detect BC
  dates by using the NSDate's Era component (to throw because DateTime only
  supports AC dates). Also don't allow a tick later than year 10.000 (DateTime
  only supports up to a tick before year 10.000) - but explicitly support
  exactly year 10.000, and convert it to DateTime.MaxValue (this is because
  due to precision errors NSDate can't actually express 'a tick before year
  10.000', it ends up being rounded up to year 10.000 exactly). This means
  there are no more magical values in the range validation checks.
* Increase precision in the DateTime -> NSDate conversion by starting with the
  sub-second amount of ticks from the DateTime instance (instead of the number
  of milliseconds). This allows us to compute the nanoseconds NSDate expects
  with much higher precision.
* More tests!

Fixes this test:

    MonoTouchFixtures.Foundation.DateTest.DateTimeToNSDate : 2 ms
        [FAIL] Precision32022 : System.ArgumentOutOfRangeException : Valid values are between 0 and 999, inclusive.
            Parameter name: millisecond
            at System.DateTime..ctor (System.Int32 year, System.Int32 month, System.Int32 day, System.Int32 hour, System.Int32 minute, System.Int32 second, System.Int32 millisecond, System.DateTimeKind kind) [0x0002d] in <4d40c65adfc14d7fb19bad9310f3eb2a>:0
            at Foundation.NSDate.op_Explicit (Foundation.NSDate d) [0x000b8] in <9cb1e1018c034b75ba5f4ed7b83ba2f2>:0
            at MonoTouchFixtures.Foundation.DateTest.Precision32022 () [0x0000c] in <c44b5df5f7b84b69b737e9fd61bddaed>:0
            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 <4d40c65adfc14d7fb19bad9310f3eb2a>:0

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

Date and time is difficult.

Ref: https://gist.github.com/timvisee/fcda9bbdff88d45cc9061606b4b923ca
Ref: the rest of internet...
2022-11-23 07:55:22 +01:00
Rolf Bjarne Kvinge 0e778737c7
[tests] Adjust TestNSurlSessionHandlerCookieContainer* tests to not fail in CI in case of network problems. Fixes #2197. (#16817)
Fixes:

    [FAIL] TestNSurlSessionHandlerCookieContainerSetCookie :   Cookies received from server.
        Expected: 1
        But was:  0
            at MonoTests.System.Net.Http.MessageHandlerTest.TestNSurlSessionHandlerCookieContainerSetCookie() in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/monotouch-test/System.Net.Http/MessageHandlers.cs:line 233

    [FAIL] TestNSUrlSessionHandlerCookies :   Failed to get managed cookies
        Expected: True
        But was:  False
            at MonoTests.System.Net.Http.MessageHandlerTest.TestNSUrlSessionHandlerCookies () [0x000aa] in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/monotouch-test/System.Net.Http/MessageHandlers.cs:144

Fixes https://github.com/xamarin/maccore/issues/2197.
2022-11-23 07:54:04 +01:00
Rolf Bjarne Kvinge d7f5544c18
[tests] Adjust ImageCaptioningTest to skip network-related failures in CI. (#16814)
Fixes:

    MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest
    	[FAIL] GetCaption : Ignore this failure when network is down
    		   at MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest.GetCaption() in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/monotouch-test/MediaAccessibility/ImageCaptioningTest.cs:line 36

Ref: https://github.com/xamarin/maccore/issues/2088.
2022-11-21 20:55:49 +01:00
Rolf Bjarne Kvinge 0076cd9920
[autoformat] Add .NET tests. (#16811) 2022-11-21 09:45:49 +01:00
Rolf Bjarne Kvinge b3870ccb6d
[tests] Adjust MonoTouchFixtures.VideoToolbox.VTCompressionSessionTests.TestCallback to ignore timeouts in CI. (#16816)
Fixes:

    MonoTouchFixtures.VideoToolbox.VTCompressionSessionTests.TestCallback
    	[FAIL] TestCallback(True) :   timed out
      Expected: True
      But was:  False
    		   at MonoTouchFixtures.VideoToolbox.VTCompressionSessionTests.TestCallback(Boolean stronglyTyped) in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/monotouch-test/VideoToolbox/VTCompressionSessionTests.cs:line 171
    	[FAIL] TestCallback(False) :   timed out
      Expected: True
      But was:  False
    		   at MonoTouchFixtures.VideoToolbox.VTCompressionSessionTests.TestCallback(Boolean stronglyTyped) in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/monotouch-test/VideoToolbox/VTCompressionSessionTests.cs:line 171
    		   at InvokeStub_VTCompressionSessionTests.TestCallback(Object, Object, IntPtr*)
2022-11-21 09:37:08 +01:00
Rolf Bjarne Kvinge 1c29665f72
[tests] Ignore SWCollaborationView in DelegateAndSourceTest. (#16777)
[SWCollaborationView setDelegate:] crashes when passed null.

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2022-11-18 08:02:42 +01:00
Rolf Bjarne Kvinge 97eee84442
[tests] Ignore PassLibraryTest.PassLibraryTest on bots if PKPassLibrary.GetPasses returns null. Fixes #xamarin/maccore@2598. (#16738)
PKPassLibrary.GetPasses randomly returns null for no apparent rhyme or reason
on our bots, so just ignore the test in that case.

Maybe if someone can reproduce locally one day we'll be able to investigate
and figure out what's happening.

Fixes https://github.com/xamarin/maccore/issues/2598.
2022-11-16 07:54:57 +01:00
Rolf Bjarne Kvinge 0140122668
[autoformat] Add the Security, SensorKit, Social, SpriteKit, StoreKit, SystemConfiguration, TVServices, VideoToolbox, Vision and WKWebKit frameworks. (#16763) 2022-11-16 07:38:18 +01:00
Manuel de la Pena 58a14e9231
[DevOps] Do not use ta vm for the pkgs upload due to its hdd size. (#16765)
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2022-11-15 18:15:36 -05:00
Rolf Bjarne Kvinge 9af83cd712
[monotouch-test] Ignore certificate chain errors on bots. Fixes #xamarin/maccore@2626. (#16743)
Ignore certificate chain errors on bots in MessageHandlerTest.RejectSslCertificatesWithCustomValidationCallbackNSUrlSessionHandler.

Fixes https://github.com/xamarin/maccore/issues/2626.
2022-11-15 17:43:11 +01:00
Marius Ungureanu 4025f4e881
Fix ownership of CFSocketCreateRunLoopSource (#6089)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-11-15 15:55:21 +01:00
Rolf Bjarne Kvinge 09f84f988c
[autoformat] Autoformat after a PR race. (#16720)
There was a PR race:

1. I created a PR to autoformat monotouch-test code.
2. Another PR added incorrectly formatted code to monotouch-test.
3. The first PR was merged, everything was fine.
4. The second PR was merged (it was green) - but its code hadn't been
   autoformatted.
5. Now there's incorrectly formatted code in the repo, which will show up in
   every new PR.

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2022-11-14 08:43:39 +01:00
Marius Ungureanu 2bd6433fda
[perf] Add unmanaged constraint to some APIs to allow pinning, and not manual GCHandle code (#7561)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2022-11-11 08:58:46 +01:00
Rolf Bjarne Kvinge 6f45caa84d
[autoformat] Add monotouch-test (#16701) 2022-11-10 17:59:26 +01:00
Rolf Bjarne Kvinge ceaa0171da
Merge net7.0-xcode14.1 into main. (#16555)
This merges .NET 7 + Xcode 14.1 support into main.
2022-11-04 08:36:25 +01:00
Whitney Schmidt 3c65ab1756
Fix DateTime -> NSDate conversion (#7404)
Update conversions from `NSDate` to `DateTime` and `DateTime` to `NSDate` to use date components instead of `SecondsSinceReferenceDate`.

The number of seconds since reference date is inconsistent between `NSDate` and `DateTime`. See the associated bug - converting `DateTime` 1/1/1 to `NSDate` ends up giving you an `NSDate` a couple days off :(

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

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-11-03 21:11:00 +01:00
Rolf Bjarne Kvinge cdc62aeae9 Merge remote-tracking branch 'origin/net7.0-xcode14.1' into main-net7.0-xcode14.1 2022-11-03 08:21:55 +01:00
Rolf Bjarne Kvinge 940e1d09e9 Merge xcode14.1 into net7.0-xcode14.1. 2022-11-02 19:03:30 +01:00
VS MobileTools Engineering Service 2 988bf9b4ba
[net7.0-xcode14.1] [tests] Handle managed exceptions in a networking callback. (#16535)
Fixes a problem where any exception would crash the process, because the
callback was executed on a background thread, and there was no other managed
frame catching the managed exception:

    MonoTests.System.Net.Http.MessageHandlerTest.RejectSslCertificatesWithCustomValidationCallbackNSUrlSessionHandler
    2022-10-21 07:02:23.557 monotouchtest[91107:28076542] *** Terminating app due to uncaught exception 'NUnit.Framework.AssertionException', reason: '  Expected: None
      But was:  RemoteCertificateChainErrors
     (NUnit.Framework.AssertionException)
       at NUnit.Framework.Assert.ReportFailure(String message)
       at NUnit.Framework.Assert.ReportFailure(ConstraintResult result, String message, Object[] args)
       at NUnit.Framework.Assert.AreEqual(Object expected, Object actual)
       at MonoTests.System.Net.Http.MessageHandlerTest.<>c__DisplayClass14_0.<RejectSslCertificatesWithCustomValidationCallbackNSUrlSessionHandler>b__2(HttpRequestMessage sender, X509Certificate2 certificate, X509Chain chain, SslPolicyErrors errors) in /Users/builder/azdo/_work/2/s/xamarin-macios/tests/monotouch-test/System.Net.Http/MessageHandlers.cs:line 613
       at Foundation.NSUrlSessionHandler.ServerCertificateCustomValidationCallbackHelper.Invoke(HttpRequestMessage request, SecTrust secTrust)
       at Foundation.NSUrlSessionHandler.TryInvokeServerCertificateCustomValidationCallback(HttpRequestMessage request, SecTrust secTrust, Boolean& trusted)
       at Foundation.NSUrlSessionHandler.NSUrlSessionHandlerDelegate.DidReceiveChallenge(NSUrlSession session, NSUrlSessionTask task, NSUrlAuthenticationChallenge challenge, Action`2 completionHandler)
    --- End of stack trace from previous location ---
       at ObjCRuntime.Runtime.InvokeMethod(MethodBase method, Object instance, IntPtr native_parameters)
       at ObjCRuntime.Runtime.InvokeMethod(MonoObject* methodobj, MonoObject* instanceobj, IntPtr native_parameters)
       at ObjCRuntime.Runtime.bridge_runtime_invoke_method(MonoObject* method, MonoObject* instance, IntPtr parameters, IntPtr& exception_gchandle)
    '
    *** First throw call stack:
    (
    	0   CoreFoundation                      0x00007ff81dba97c3 __exceptionPreprocess + 242
    	1   libobjc.A.dylib                     0x00007ff81d909bc3 objc_exception_throw + 48
    	2   monotouchtest                       0x000000010426e524 xamarin_process_managed_exception + 820
    	3   monotouchtest                       0x00000001042fec76 _ZL32native_to_managed_trampoline_183P11objc_objectP13objc_selectorPP11_MonoObjectS0_S0_S0_S0_j + 1302
    	4   monotouchtest                       0x00000001042fe750 -[Foundation_NSUrlSessionHandler_NSUrlSessionHandlerDelegate URLSession:task:didReceiveChallenge:completionHandler:] + 80
    	5   CFNetwork                           0x00007ff8225d3635 _CFHostIsDomainTopLevelForCertificatePolicy + 13206
    	6   libdispatch.dylib                   0x00007ff81d8af0cc _dispatch_call_block_and_release + 12
    	7   libdispatch.dylib                   0x00007ff81d8b0317 _dispatch_client_callout + 8
    	8   libdispatch.dylib                   0x00007ff81d8b6317 _dispatch_lane_serial_drain + 672
    	9   libdispatch.dylib                   0x00007ff81d8b6e30 _dispatch_lane_invoke + 417
    	10  libdispatch.dylib                   0x00007ff81d8c0eee _dispatch_workloop_worker_thread + 753
    	11  libsystem_pthread.dylib             0x00007ff81da63fd0 _pthread_wqthread + 326
    	12  libsystem_pthread.dylib             0x00007ff81da62f57 start_wqthread + 15


Backport of #16414

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-11-02 18:05:06 +01:00