From 08b28f54e6965cc2a94dc3e33e5474bc96d6265b Mon Sep 17 00:00:00 2001 From: Santiago Fernandez Madero Date: Tue, 8 Feb 2022 16:33:46 -0800 Subject: [PATCH 1/3] [release/5.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 b662a3db64f389173809daec767462aa261aaccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Mon, 14 Feb 2022 16:24:51 +0100 Subject: [PATCH 2/3] Remove additional brace --- 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 37c08af9b21db5a6e02d96cb73c358ea976d1828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Mon, 14 Feb 2022 16:24:56 +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 85ed4fa8d7ef91..6618423dbcb1ee 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -40,6 +40,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;