From e3e8f3654fb7948b31a0c7de00d187a63836924f Mon Sep 17 00:00:00 2001 From: Mateo Torres Ruiz Date: Mon, 2 Aug 2021 08:47:25 -0700 Subject: [PATCH 1/2] Disable arm64-win10 tests preventing clean build --- .../tests/GraphicsTests.cs | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/libraries/System.Drawing.Common/tests/GraphicsTests.cs b/src/libraries/System.Drawing.Common/tests/GraphicsTests.cs index ba8246641c6e2..470de9f3315d0 100644 --- a/src/libraries/System.Drawing.Common/tests/GraphicsTests.cs +++ b/src/libraries/System.Drawing.Common/tests/GraphicsTests.cs @@ -6,6 +6,7 @@ using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Drawing.Text; +using Microsoft.DotNet.XUnitExtensions; using Xunit; namespace System.Drawing.Tests @@ -102,6 +103,12 @@ public static IEnumerable FromHdc_TestData() [MemberData(nameof(FromHdc_TestData))] public void FromHdc_ValidHdc_ReturnsExpected(IntPtr hdc) { + if (PlatformDetection.IsArm64Process && OperatingSystem.IsWindows()) + { + // ActiveIssue: 51097 + throw new SkipTestException("Visible clipping region is not empty."); + } + using (Graphics graphics = Graphics.FromHdc(hdc)) { Rectangle expected = Helpers.GetWindowDCRect(hdc); @@ -114,6 +121,12 @@ public void FromHdc_ValidHdc_ReturnsExpected(IntPtr hdc) [MemberData(nameof(FromHdc_TestData))] public void FromHdc_ValidHdcWithContext_ReturnsExpected(IntPtr hdc) { + if (PlatformDetection.IsArm64Process && OperatingSystem.IsWindows()) + { + // ActiveIssue: 51097 + throw new SkipTestException("Visible clipping region is not empty."); + } + using (Graphics graphics = Graphics.FromHdc(hdc, IntPtr.Zero)) { Rectangle expected = Helpers.GetWindowDCRect(hdc); @@ -126,6 +139,12 @@ public void FromHdc_ValidHdcWithContext_ReturnsExpected(IntPtr hdc) [MemberData(nameof(FromHdc_TestData))] public void FromHdcInternal_GetDC_ReturnsExpected(IntPtr hdc) { + if (PlatformDetection.IsArm64Process && OperatingSystem.IsWindows()) + { + // ActiveIssue: 51097 + throw new SkipTestException("Visible clipping region is not empty."); + } + using (Graphics graphics = Graphics.FromHdcInternal(hdc)) { Rectangle expected = Helpers.GetWindowDCRect(hdc); @@ -262,6 +281,12 @@ public static IEnumerable Hwnd_TestData() [MemberData(nameof(Hwnd_TestData))] public void FromHwnd_ValidHwnd_ReturnsExpected(IntPtr hWnd) { + if (PlatformDetection.IsArm64Process && OperatingSystem.IsWindows ()) + { + // ActiveIssue: 51097 + throw new SkipTestException("Visible clipping region is not empty."); + } + using (Graphics graphics = Graphics.FromHwnd(hWnd)) { Rectangle expected = Helpers.GetHWndRect(hWnd); @@ -274,6 +299,12 @@ public void FromHwnd_ValidHwnd_ReturnsExpected(IntPtr hWnd) [MemberData(nameof(Hwnd_TestData))] public void FromHwndInternal_ValidHwnd_ReturnsExpected(IntPtr hWnd) { + if (PlatformDetection.IsArm64Process && OperatingSystem.IsWindows()) + { + // ActiveIssue: 51097 + throw new SkipTestException("Visible clipping region is not empty."); + } + using (Graphics graphics = Graphics.FromHwnd(hWnd)) { Rectangle expected = Helpers.GetHWndRect(hWnd); From 1abc5819a9c7682058841949362390a5a7f432ec Mon Sep 17 00:00:00 2001 From: Mateo Torres Ruiz Date: Mon, 2 Aug 2021 11:23:01 -0700 Subject: [PATCH 2/2] Use ActiveIssue with conditional --- .../tests/GraphicsTests.cs | 36 +++---------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/src/libraries/System.Drawing.Common/tests/GraphicsTests.cs b/src/libraries/System.Drawing.Common/tests/GraphicsTests.cs index 470de9f3315d0..8c0f280b86361 100644 --- a/src/libraries/System.Drawing.Common/tests/GraphicsTests.cs +++ b/src/libraries/System.Drawing.Common/tests/GraphicsTests.cs @@ -6,7 +6,6 @@ using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Drawing.Text; -using Microsoft.DotNet.XUnitExtensions; using Xunit; namespace System.Drawing.Tests @@ -99,16 +98,11 @@ public static IEnumerable FromHdc_TestData() } [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(PlatformDetection), nameof(PlatformDetection.IsArm64Process), nameof(PlatformDetection.IsWindows10OrLater))] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(FromHdc_TestData))] public void FromHdc_ValidHdc_ReturnsExpected(IntPtr hdc) { - if (PlatformDetection.IsArm64Process && OperatingSystem.IsWindows()) - { - // ActiveIssue: 51097 - throw new SkipTestException("Visible clipping region is not empty."); - } - using (Graphics graphics = Graphics.FromHdc(hdc)) { Rectangle expected = Helpers.GetWindowDCRect(hdc); @@ -117,16 +111,11 @@ public void FromHdc_ValidHdc_ReturnsExpected(IntPtr hdc) } [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(PlatformDetection), nameof(PlatformDetection.IsArm64Process), nameof(PlatformDetection.IsWindows10OrLater))] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(FromHdc_TestData))] public void FromHdc_ValidHdcWithContext_ReturnsExpected(IntPtr hdc) { - if (PlatformDetection.IsArm64Process && OperatingSystem.IsWindows()) - { - // ActiveIssue: 51097 - throw new SkipTestException("Visible clipping region is not empty."); - } - using (Graphics graphics = Graphics.FromHdc(hdc, IntPtr.Zero)) { Rectangle expected = Helpers.GetWindowDCRect(hdc); @@ -135,16 +124,11 @@ public void FromHdc_ValidHdcWithContext_ReturnsExpected(IntPtr hdc) } [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(PlatformDetection), nameof(PlatformDetection.IsArm64Process), nameof(PlatformDetection.IsWindows10OrLater))] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(FromHdc_TestData))] public void FromHdcInternal_GetDC_ReturnsExpected(IntPtr hdc) { - if (PlatformDetection.IsArm64Process && OperatingSystem.IsWindows()) - { - // ActiveIssue: 51097 - throw new SkipTestException("Visible clipping region is not empty."); - } - using (Graphics graphics = Graphics.FromHdcInternal(hdc)) { Rectangle expected = Helpers.GetWindowDCRect(hdc); @@ -277,16 +261,11 @@ public static IEnumerable Hwnd_TestData() } [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(PlatformDetection), nameof(PlatformDetection.IsArm64Process), nameof(PlatformDetection.IsWindows10OrLater))] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Hwnd_TestData))] public void FromHwnd_ValidHwnd_ReturnsExpected(IntPtr hWnd) { - if (PlatformDetection.IsArm64Process && OperatingSystem.IsWindows ()) - { - // ActiveIssue: 51097 - throw new SkipTestException("Visible clipping region is not empty."); - } - using (Graphics graphics = Graphics.FromHwnd(hWnd)) { Rectangle expected = Helpers.GetHWndRect(hWnd); @@ -295,16 +274,11 @@ public void FromHwnd_ValidHwnd_ReturnsExpected(IntPtr hWnd) } [ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51097", typeof(PlatformDetection), nameof(PlatformDetection.IsArm64Process), nameof(PlatformDetection.IsWindows10OrLater))] [ConditionalTheory(Helpers.IsDrawingSupported)] [MemberData(nameof(Hwnd_TestData))] public void FromHwndInternal_ValidHwnd_ReturnsExpected(IntPtr hWnd) { - if (PlatformDetection.IsArm64Process && OperatingSystem.IsWindows()) - { - // ActiveIssue: 51097 - throw new SkipTestException("Visible clipping region is not empty."); - } - using (Graphics graphics = Graphics.FromHwnd(hWnd)) { Rectangle expected = Helpers.GetHWndRect(hWnd);