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

23 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 6fabe0b18a
[monotouch-test] Sprinkle UnconditionalSuppressMessage wherever needed to fix trimmer warnings. (#20429) 2024-04-16 17:03:36 +02:00
Rolf Bjarne Kvinge 5f442fbc88
[AppKit] Create a better binding for [NSEvent eventWithGCEvent:]. (#20362)
Create a better binding for `[NSEvent eventWithGCEvent:]` by binding it as
`NSEvent.Create(CGEvent)` instead of `NSEvent.EventWithGCEvent(IntPtr)`.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/12650.
2024-03-25 08:30:27 +01:00
Rolf Bjarne Kvinge 5d4bff54b0
[AppKit] Make NSGraphics.NSBestDepth P/Invoke blittable. (#19614)
Also introduce a few other improvements:

* Add an varation that takes an 'out bool' instead of a 'ref bool'. According
  to the documentation the value is out-only.
* Name this variation according to our guidelines (with a verb).
* Deprecate the old version.

Contributes towards https://github.com/xamarin/xamarin-macios/issues/15684.
2023-12-13 12:55:25 +01:00
Rolf Bjarne Kvinge 36af029204
Change all null checking expressions to use 'is' and 'is not'. (#18176)
Change all null checking expressions to use 'is null' and 'is not null'
instead of '== null' and '!= null'.

This was mostly done with sed, so code can probably be improved in many
other ways with manual inspection, but that will come over time.

Also add code to the autoformat script to automatically fix these issues in the future.
2023-05-05 17:52:19 +02:00
Rolf Bjarne Kvinge 185a9a8c9a
[xharness] Add a release + all optimization test variation of monotouch-test for desktop. (#18140)
Add a 'release + all optimization' test variation of monotouch-test for
macOS and Mac Catalyst.
2023-05-05 11:24:26 +02: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 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
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 6f45caa84d
[autoformat] Add monotouch-test (#16701) 2022-11-10 17:59:26 +01:00
Rolf Bjarne Kvinge d251b69ae7
[generator] Don't use culture-aware API. (#15392)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-07-11 19:59:36 +02:00
Rolf Bjarne Kvinge 2e62431fb1
[nfloat] Obsolete nfloat.CopyArray in legacy Xamarin and stop using it. (#14164)
There's no corresponding System.Runtime.InteropServices.NFloat.CopyArray method in .NET.

It turned out that the API where we used CopyArray don't need to use CopyArray at all, the same can be accomplished faster and simpler by using unsafe code.
2022-02-16 20:10:13 +01:00
Rolf Bjarne Kvinge d766fe8c8b
[AppKit] Remove a few obsolete members in .NET (#14043) 2022-02-04 08:14:10 +01:00
Rolf Bjarne Kvinge 2d48710858
[AppKit] Adopt XAMCORE_4_0 changes in .NET. (#13987)
* A lot of obsolete/deprecated removal.
* Remove the NSDraggingInfo model, which required numerous other changes.
* Remove the NSPasteboardReading/NSPasteboardWriting models, which required more
  numerous changes.
* Update the tests accordingly.
2022-02-01 20:56:32 +01:00
Rolf Bjarne Kvinge 82a3b71c60
[Foundation] Adopt a better name/signature for numerous Foundation API in .NET. (#13776) 2022-01-20 10:32:55 +01:00
Rolf Bjarne Kvinge 697e5b330e
[src] Fix optional/required protocol members in .NET. (#13764)
Make required protocol members [Abstract] and optional protocol members not in
.NET. This way we're matching Apple's API (for now at least).
2022-01-19 09:03:35 +01:00
Rolf Bjarne Kvinge d49903ccca
[AppKit] Fix atrocious API naming in NSTextFinderClient in .NET. (#13769) 2022-01-18 20:23:09 +01:00
Rolf Bjarne Kvinge 19c2765156 [tests][monotouch-test] Adjust code to cope with NativeHandle. 2021-11-26 14:25:21 +01:00
Rolf Bjarne Kvinge 66e596e9d9
[tests] Change TestRuntime.CheckSystemVersion to take a ApplePlatform value instead of a PlatformName enum. (#13350)
The PlatformName enum will be removed from .NET soon.
2021-11-15 08:06:36 +01:00
Rolf Bjarne Kvinge 02f10a6583
[AppKit] Remove NSMenuView from .NET (it's a 32-bit only type). (#13291) 2021-11-08 16:15:41 +01:00
Rolf Bjarne Kvinge 696e7a5679
[ObjCRuntime] Add a non-deprecated internal system-version checking API and use it everywhere. (#13231)
* [ObjCRuntime] Add a non-deprecated internal system-version checking API and use it everywhere.

The PlatformHelper class is deprecated, so implement a new version that isn't
deprecated, and which shares a similar API between all platforms - the Check*
methods includes the name of the platform, because that makes it clearer which
version we're talking about from the call site. There's a quirk though:
there's no separate ChecktvOS or CheckMacCatalyst, because the system version
is the same as for iOS, so we can just use 'iOS'.

For macOS we can now use NSProcessInfo.ProcessInfo.OperatingSystemVersion to
determine the OS version, because it's supported in all versions of macOS we
support for .NET.

Fixes issues such as this when building with XAMCORE_4_0:

> CoreMedia/CMSync.cs(590,11): error CS0103: The name 'PlatformHelper' does not exist in the current context

* Bring back PlatformHelper.CheckSystemVersion, but only for !NET.

* [tests] Remove 32-bit macOS logic, it's long dead.

* [introspection] Implement OS version check using 'NSProcessInfo.ProcessInfo.IsOperatingSystemAtLeastVersion' for macOS.

* [monotouch-test] Use TestRuntime.[Check|Assert]XcodeVersion instead of PlatformHelper.CheckSystemVersion.
2021-11-04 11:13:23 +01:00
Rolf Bjarne Kvinge 02431b9fc8
[.NET] Move the nfloat type to the ObjCRuntime namespace for .NET. (#13092)
Also move the NMath type from the System namespace to the ObjCRuntime namespace.

Ref: https://github.com/xamarin/xamarin-macios/issues/13087
2021-10-28 11:06:31 +02:00
Rolf Bjarne Kvinge 7ac3c658e0
[tests] Preserve all test fixtures. (#10870)
* [tests] Preserve all test fixtures.

This fixes the wildly diffetent number of tests when running xammac tests with and without linking.

Without linking:

> Tests run: 2446 Passed: 2321 Inconclusive: 9 Failed: 0 Ignored: 125

vs with linking:

> Tests run: 1885 Passed: 1802 Inconclusive: 4 Failed: 0 Ignored: 83

Now we run the same tests either with or without linking.

One test was updated to not fail when linking is enabled.

Also add a test to ensure all future test fixtures are preserved.

* Remove whitespace noise.
2021-03-16 15:15:30 +01:00
Rolf Bjarne Kvinge 93bbfe7a86
[tests] Merge apitest into xammac_tests. (#10276)
* [apitest] Sanitize files by adding missing eols.

* [apitest] Add #if __MACOS__ to all test files.

In preparation for the move into monotouchtest.

* [apitest] Move test files into monotouchtest.

* [tests] Remove the apitest project.

* [monotouch-test] Remove MessagingMac.cs, it's not needed.

* [xammac-tests] Add file PlatformInfo.cs to the build.

* [xammac-tests] Move files into monotouch-test.

* [monotouch-test] Rename test class to not clash with another test class of the same (Objective-C) name.

* [tests] How did this ever work?

Answer: it never did.

* [monotouch-test] Remove duplicated test code.

* [xammac-tests] Define DYNAMIC_REGISTRAR when we're using the dynamic registrar.

* [monotouch-test] Adjust the BundleTest.TestGetBundleId test to cope with having multiple apps for the same bundle id.

* [monotouch-test] Ignore a test that doesn't work with the static registrar (due to a bug in the static registrar).
2020-12-18 11:45:06 +01:00