From 4d6bfdc486694a3e654379e74729fc40784ce1aa Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Wed, 29 Jun 2022 20:25:31 +0200 Subject: [PATCH] Disable failing graphics tests on windows 7 (dotnet/runtime#71151) * Disable failing graphics tests on windows 7 Related: https://github.com/dotnet/runtime/issues/51097. Disables the failing tests on Windows 7 as well. Commit migrated from https://github.com/dotnet/runtime/commit/879f201ceff095ff59a1f6d2373cee871d7aa102 --- src/System.Drawing.Common/tests/GraphicsTests.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/System.Drawing.Common/tests/GraphicsTests.cs b/src/System.Drawing.Common/tests/GraphicsTests.cs index c9b7bb62d53..0a977b7d292 100644 --- a/src/System.Drawing.Common/tests/GraphicsTests.cs +++ b/src/System.Drawing.Common/tests/GraphicsTests.cs @@ -12,6 +12,8 @@ namespace System.Drawing.Tests { public partial class GraphicsTests { + public static bool IsWindows7OrWindowsArm64 => PlatformDetection.IsWindows7 || (PlatformDetection.IsWindows && PlatformDetection.IsArm64Process); + [ConditionalFact(Helpers.IsDrawingSupported)] public void GetHdc_FromHdc_Roundtrips() { @@ -93,7 +95,7 @@ public static IEnumerable FromHdc_TestData() yield return new object[] { Helpers.GetDC(foregroundWindow) }; } - [ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(PlatformDetection), nameof(PlatformDetection.IsArm64Process), nameof(PlatformDetection.IsWindows10OrLater))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(GraphicsTests), nameof(IsWindows7OrWindowsArm64))] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(FromHdc_TestData))] public void FromHdc_ValidHdc_ReturnsExpected(IntPtr hdc) @@ -105,7 +107,7 @@ public void FromHdc_ValidHdc_ReturnsExpected(IntPtr hdc) } } - [ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(PlatformDetection), nameof(PlatformDetection.IsArm64Process), nameof(PlatformDetection.IsWindows10OrLater))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(GraphicsTests), nameof(IsWindows7OrWindowsArm64))] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(FromHdc_TestData))] public void FromHdc_ValidHdcWithContext_ReturnsExpected(IntPtr hdc) @@ -117,7 +119,7 @@ public void FromHdc_ValidHdcWithContext_ReturnsExpected(IntPtr hdc) } } - [ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(PlatformDetection), nameof(PlatformDetection.IsArm64Process), nameof(PlatformDetection.IsWindows10OrLater))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(GraphicsTests), nameof(IsWindows7OrWindowsArm64))] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(FromHdc_TestData))] public void FromHdcInternal_GetDC_ReturnsExpected(IntPtr hdc) @@ -245,7 +247,7 @@ public static IEnumerable Hwnd_TestData() yield return new object[] { Helpers.GetForegroundWindow() }; } - [ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(PlatformDetection), nameof(PlatformDetection.IsArm64Process), nameof(PlatformDetection.IsWindows10OrLater))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(GraphicsTests), nameof(IsWindows7OrWindowsArm64))] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Hwnd_TestData))] public void FromHwnd_ValidHwnd_ReturnsExpected(IntPtr hWnd) @@ -257,7 +259,7 @@ public void FromHwnd_ValidHwnd_ReturnsExpected(IntPtr hWnd) } } - [ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(PlatformDetection), nameof(PlatformDetection.IsArm64Process), nameof(PlatformDetection.IsWindows10OrLater))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(GraphicsTests), nameof(IsWindows7OrWindowsArm64))] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Hwnd_TestData))] public void FromHwndInternal_ValidHwnd_ReturnsExpected(IntPtr hWnd)