From 5e65919e91691a83ea236931957c782124e23ab7 Mon Sep 17 00:00:00 2001 From: Santiago Fernandez Madero Date: Mon, 14 Feb 2022 10:34:18 -0800 Subject: [PATCH] [release/6.0] Port ICU tests fix for server core x86 (#65038) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * [release/6.0] Port ICU tests fix for server core x86 * Update src/libraries/System.Globalization/tests/IcuTests.cs Co-authored-by: Alexander Köplinger * Add PlatformDetection.IsX86Process Co-authored-by: Tarek Mahmoud Sayed Co-authored-by: Alexander Köplinger --- src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs | 1 + src/libraries/System.Globalization/tests/IcuTests.cs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index df3c3b4..6b77b65 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -48,6 +48,7 @@ namespace System 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; diff --git a/src/libraries/System.Globalization/tests/IcuTests.cs b/src/libraries/System.Globalization/tests/IcuTests.cs index 190da7f..e288727 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() -- 2.7.4