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

8 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge c4ddd4da1e
[monotouch-test] Adjust a few tests to cope with optimizations. (#3720)
This fixes the following test failures when building for debug with all optimizations enabled:

    DispatchTests
    	[FAIL] DispatchTests.EverAfter :   thread check hit
      Expected: same as <UIKit.UIKitThreadAccessException>
      But was:  <System.ArgumentNullException>

    		  at MonoTouchFixtures.CoreFoundation.DispatchTests.EverAfter () [0x000e1] in /Users/xamarinqa/vsts/_work/52/s/tests/monotouch-test/CoreFoundation/DispatchTests.cs:259
    		  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
    	[FAIL] DispatchTests.MainQueueDispatch :   thread check hit
      Expected: same as <UIKit.UIKitThreadAccessException>
      But was:  <System.ArgumentNullException>

    		  at MonoTouchFixtures.CoreFoundation.DispatchTests.MainQueueDispatch () [0x000d1] in /Users/xamarinqa/vsts/_work/52/s/tests/monotouch-test/CoreFoundation/DispatchTests.cs:111
    		  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
2018-03-13 10:41:38 +01:00
Sebastien Pouliot f5df902049
[foundation] Add NSBundle.GetLocalizedString returning an NSString. Fixes #41292 (#3266)
The original, now obsoleted, `LocalizedString` API returned a .net
`string` which does not work in most cases.

Different versions of iOS seems to return different (public or internal)
subclasses of `NSString` that are understood by other API (like NSString
`localizedStringWithFormat:`) for further customization.

Our logic to convert NSString to string is correct but it cannot
recreate the custom, required subclass to continue the localization.

So the new API return an `NSString` publicly (which is actually a
subclass) that can do the required job.

Adding a test in monotouch-test is presently blocked by #3265 [2]

[1] https://bugzilla.xamarin.com/show_bug.cgi?id=41292
[2] https://github.com/xamarin/xamarin-macios/issues/3265

* Add tests for new (and old) NSBundle API and adjust old ones since adding a Base.lproj directories changes things

* Add localization to xammac_tests since it shares the same, updated tests
2018-01-20 14:00:01 -05:00
Manuel de la Pena 6135a6c4d8
[MSBuild] Do not set CFBundleDevelopmentRegion if not present. (#2779)
* [MSBuild] Do not set CFBundleDevelopmentRegion if not present.

This is a complicated fix. This is a regression introduced by Apple.
CFLocaleCopyCurrent(), used in the iOS code, will return the value of
the application's CFBundleDevelopmentRegion Info.plist key if all of the
following conditions are true:

* CFBundleDevelopmentRegion is present in the Info.plist
* The CFBundleDevelopmentRegion language is in the list of preferred
languages on the iOS device, but isn't the first one
* There are no localized resources (i.e. no .lproj directory) in the app
for the first preferred locale

This differs from iOS 10 where the presence of the
CFBundleDevelopmentRegion key had no effect.

Note that if the CFBundleDevelopmentRegion key is not present at all,
CFLocaleCopyCurrent() always returns the first preferred locale as it
did in iOS 10.

We are adding the key by default in the plist of the applications which confuses users since they do not see the key in the .plist added by the template. This commit removes it to be more explicit and help users understand the behaviour.
2017-12-01 16:52:25 +01:00
Rolf Bjarne Kvinge 6fe1c9feab [tests] Use a different bundle id for different apps that can be installed on the same device. (#1509)
* [tests] Use a different bundle id for different apps that can be installed on the same device.

* [xharness] Add workaround for radar #29847128.
2017-01-16 18:34:57 +01:00
Timothy Risi 687aa6f25f Port monotouch-test suite to Xamarin.Mac (#1445)
* Port the Monotouch-test suite to run on Xamarin.Mac

Adds over 1300 new API tests for XM
2017-01-12 09:13:56 -09:00
Rolf Bjarne Kvinge b4bb30c13c [monotouch-test] Adjust tests according to watchOS behavior. 2016-06-27 13:07:37 +02:00
Rolf Bjarne Kvinge 0a8c6e3342 [tests] Check versions using Xcode version instead of platform version.
This is required to match API to the required platform version,
since our platforms have different version numbers.
2016-06-27 13:07:37 +02:00
Rolf Bjarne Kvinge ecfdea9508 [tests] Import 2016-05-26 15:06:52 +02:00