From 7e37fe622e772d8fc98c461bef03a68cbd8189bd Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 20 Jul 2021 08:47:43 +0200 Subject: [PATCH] [monotouch-test] Adjust HttpClientHandler tests. Adjust HttpClientHandler tests to cope with https://github.com/dotnet/runtime/issues/50859 and https://github.com/xamarin/xamarin-macios/issues/11392. --- tests/linker/ios/dont link/CalendarTest.cs | 3 --- tests/linker/ios/link all/CalendarTest.cs | 12 ++++++++++-- tests/linker/ios/link sdk/CalendarTest.cs | 11 +++++++++++ tests/linker/ios/link sdk/LinkSdkRegressionTest.cs | 3 +++ tests/linker/ios/link sdk/LocaleTest.cs | 6 ++++++ 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/tests/linker/ios/dont link/CalendarTest.cs b/tests/linker/ios/dont link/CalendarTest.cs index f64f41b81de7..8afab9aa9c27 100644 --- a/tests/linker/ios/dont link/CalendarTest.cs +++ b/tests/linker/ios/dont link/CalendarTest.cs @@ -10,9 +10,6 @@ namespace DontLink.Calendars { [TestFixture] // we want the tests to be available because we use the linker [Preserve (AllMembers = true)] -#if NET - [Ignore ("No globalization data yet - https://github.com/xamarin/xamarin-macios/issues/8906")] -#endif public class CalendarTest { // application must *NOT* be build with I18N.MidEast and I18N.Other (Thai) diff --git a/tests/linker/ios/link all/CalendarTest.cs b/tests/linker/ios/link all/CalendarTest.cs index 6c640edae795..9a49494ff152 100644 --- a/tests/linker/ios/link all/CalendarTest.cs +++ b/tests/linker/ios/link all/CalendarTest.cs @@ -10,8 +10,8 @@ namespace LinkAll.Calendars { [TestFixture] // we want the tests to be available because we use the linker [Preserve (AllMembers = true)] -#if NET - [Ignore ("No globalization data yet - https://github.com/xamarin/xamarin-macios/issues/8906")] +#if NET && __MACCATALYST__ + [Ignore ("No globalization data yet for Mac Catalyst - https://github.com/xamarin/xamarin-macios/issues/11392")] #endif public class CalendarTest { @@ -21,14 +21,22 @@ public class CalendarTest { public void UmAlQura () { var ci = CultureInfo.GetCultureInfo ("ar"); +#if NET // https://github.com/dotnet/runtime/issues/50859 + Assert.That (ci.Calendar.ToString (), Is.EqualTo ("System.Globalization.GregorianCalendar"), "Calendar"); +#else Assert.That (ci.Calendar.ToString (), Is.EqualTo ("System.Globalization.UmAlQuraCalendar"), "Calendar"); +#endif } [Test] public void Hijri () { var ci = CultureInfo.GetCultureInfo ("ps"); +#if NET // https://github.com/dotnet/runtime/issues/50859 + Assert.That (ci.Calendar.ToString (), Is.EqualTo ("System.Globalization.PersianCalendar"), "Calendar"); +#else Assert.That (ci.Calendar.ToString (), Is.EqualTo ("System.Globalization.HijriCalendar"), "Calendar"); +#endif } [Test] diff --git a/tests/linker/ios/link sdk/CalendarTest.cs b/tests/linker/ios/link sdk/CalendarTest.cs index f5e1504ef3fb..c6bf0d17f4ee 100644 --- a/tests/linker/ios/link sdk/CalendarTest.cs +++ b/tests/linker/ios/link sdk/CalendarTest.cs @@ -10,6 +10,9 @@ namespace LinkSdk.Calendars { [TestFixture] // we want the tests to be available because we use the linker [Preserve (AllMembers = true)] +#if NET && __MACCATALYST__ + [Ignore ("No globalization data yet for Mac Catalyst - https://github.com/xamarin/xamarin-macios/issues/11392")] +#endif public class CalendarTest { // application must *NOT* be build with I18N.MidEast and I18N.Other (Thai) @@ -25,14 +28,22 @@ public void UmAlQura () public void Hijri () { var ci = CultureInfo.GetCultureInfo ("ps"); +#if NET // https://github.com/dotnet/runtime/issues/50859 + Assert.That (ci.Calendar.ToString (), Is.EqualTo ("System.Globalization.PersianCalendar"), "Calendar"); +#else Assert.That (ci.Calendar.ToString (), Is.EqualTo ("System.Globalization.GregorianCalendar"), "Calendar"); +#endif } [Test] public void ThaiBuddhist () { var ci = CultureInfo.GetCultureInfo ("th"); +#if NET // https://github.com/dotnet/runtime/issues/50859 + Assert.That (ci.Calendar.ToString (), Is.EqualTo ("System.Globalization.ThaiBuddhistCalendar"), "Calendar"); +#else Assert.That (ci.Calendar.ToString (), Is.EqualTo ("System.Globalization.GregorianCalendar"), "Calendar"); +#endif } } } \ No newline at end of file diff --git a/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs b/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs index 90ea07ed3651..5c585fe6d73d 100644 --- a/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs +++ b/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs @@ -463,6 +463,9 @@ public void OpenTk_Preserved () #endif // !__WATCHOS__ && !__MACCATALYST__ [Test] +#if NET && __MACCATALYST__ + [Ignore ("No globalization data yet for Mac Catalyst - https://github.com/xamarin/xamarin-macios/issues/11392")] +#endif public void XElement_3137 () { CultureInfo current = Thread.CurrentThread.CurrentCulture; diff --git a/tests/linker/ios/link sdk/LocaleTest.cs b/tests/linker/ios/link sdk/LocaleTest.cs index a1a6e9d0ecd9..b566c5a50904 100644 --- a/tests/linker/ios/link sdk/LocaleTest.cs +++ b/tests/linker/ios/link sdk/LocaleTest.cs @@ -14,6 +14,9 @@ public class LocaleTest { [Test] [SetCulture ("cs-CZ")] +#if NET && __MACCATALYST__ + [Ignore ("No globalization data yet for Mac Catalyst - https://github.com/xamarin/xamarin-macios/issues/11392")] +#endif public void CzechDictComparer () { DictComparer (); @@ -21,6 +24,9 @@ public void CzechDictComparer () [Test] [SetCulture ("en-US")] +#if NET && __MACCATALYST__ + [Ignore ("No globalization data yet for Mac Catalyst - https://github.com/xamarin/xamarin-macios/issues/11392")] +#endif public void EnglishDictComparer () { DictComparer ();