Skip to content

Commit 5e65919

Browse files
saferntarekghakoeplinger
authored
[release/6.0] Port ICU tests fix for server core x86 (#65038)
* [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 <[email protected]> * Add PlatformDetection.IsX86Process Co-authored-by: Tarek Mahmoud Sayed <[email protected]> Co-authored-by: Alexander Köplinger <[email protected]>
1 parent 6c9b451 commit 5e65919

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public static partial class PlatformDetection
4848
public static bool IsNotArm64Process => !IsArm64Process;
4949
public static bool IsArmOrArm64Process => IsArmProcess || IsArm64Process;
5050
public static bool IsNotArmNorArm64Process => !IsArmOrArm64Process;
51+
public static bool IsX86Process => RuntimeInformation.ProcessArchitecture == Architecture.X86;
5152
public static bool IsArgIteratorSupported => IsMonoRuntime || (IsWindows && IsNotArmProcess);
5253
public static bool IsArgIteratorNotSupported => !IsArgIteratorSupported;
5354
public static bool Is32BitProcess => IntPtr.Size == 4;

src/libraries/System.Globalization/tests/IcuTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ namespace System.Globalization.Tests
1010
public class IcuTests
1111
{
1212
private static bool IsIcuCompatiblePlatform => PlatformDetection.IsNotWindows ||
13-
PlatformDetection.IsWindows10Version1903OrGreater;
13+
PlatformDetection.IsWindows10Version1903OrGreater &&
14+
// Server core doesn't have icu.dll on SysWOW64
15+
!(PlatformDetection.IsWindowsServerCore && PlatformDetection.IsX86Process);
1416

1517
[ConditionalFact(nameof(IsIcuCompatiblePlatform))]
1618
public static void IcuShouldBeUsedByDefault()

0 commit comments

Comments
 (0)