From 51a706a2226ff56b7eb6ecbbf55b28440d2f7bf6 Mon Sep 17 00:00:00 2001 From: Santiago Fernandez Madero Date: Tue, 8 Feb 2022 16:27:12 -0800 Subject: [PATCH 1/3] [release/6.0] Port ICU tests fix for server core x86 --- src/libraries/System.Globalization/tests/IcuTests.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Globalization/tests/IcuTests.cs b/src/libraries/System.Globalization/tests/IcuTests.cs index 190da7f676c807..9c396535e267ef 100644 --- a/src/libraries/System.Globalization/tests/IcuTests.cs +++ b/src/libraries/System.Globalization/tests/IcuTests.cs @@ -10,7 +10,9 @@ namespace System.Globalization.Tests public class IcuTests { private static bool IsIcuCompatiblePlatform => PlatformDetection.IsNotWindows || - PlatformDetection.IsWindows10Version1903OrGreater; + PlatformDetection.IsWindows10Version1903OrGreater && + // Server core doesn't have icu.dll on SysWOW64 + !(PlatformDetection.IsWindowsServerCore && PlatformDetection.IsX86Process)); [ConditionalFact(nameof(IsIcuCompatiblePlatform))] public static void IcuShouldBeUsedByDefault() From d4e6c73d8f6c894c4dc10a51398c547325ec7d8a Mon Sep 17 00:00:00 2001 From: Tarek Mahmoud Sayed Date: Thu, 10 Feb 2022 09:00:02 -0800 Subject: [PATCH 2/3] Update src/libraries/System.Globalization/tests/IcuTests.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexander Köplinger --- src/libraries/System.Globalization/tests/IcuTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Globalization/tests/IcuTests.cs b/src/libraries/System.Globalization/tests/IcuTests.cs index 9c396535e267ef..e28872759bea7f 100644 --- a/src/libraries/System.Globalization/tests/IcuTests.cs +++ b/src/libraries/System.Globalization/tests/IcuTests.cs @@ -12,7 +12,7 @@ public class IcuTests private static bool IsIcuCompatiblePlatform => PlatformDetection.IsNotWindows || PlatformDetection.IsWindows10Version1903OrGreater && // Server core doesn't have icu.dll on SysWOW64 - !(PlatformDetection.IsWindowsServerCore && PlatformDetection.IsX86Process)); + !(PlatformDetection.IsWindowsServerCore && PlatformDetection.IsX86Process); [ConditionalFact(nameof(IsIcuCompatiblePlatform))] public static void IcuShouldBeUsedByDefault() From 57536bee6d22065778c086a6bc5d16fb11548ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Mon, 14 Feb 2022 16:21:14 +0100 Subject: [PATCH 3/3] Add PlatformDetection.IsX86Process --- .../Common/tests/TestUtilities/System/PlatformDetection.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index df3c3b44ecb691..6b77b65fefd101 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -48,6 +48,7 @@ public static partial class PlatformDetection public static bool IsNotArm64Process => !IsArm64Process; public static bool IsArmOrArm64Process => IsArmProcess || IsArm64Process; public static bool IsNotArmNorArm64Process => !IsArmOrArm64Process; + public static bool IsX86Process => RuntimeInformation.ProcessArchitecture == Architecture.X86; public static bool IsArgIteratorSupported => IsMonoRuntime || (IsWindows && IsNotArmProcess); public static bool IsArgIteratorNotSupported => !IsArgIteratorSupported; public static bool Is32BitProcess => IntPtr.Size == 4;