From 9f8f67106d9e56d483751cc4e356c043bd6fc6ba Mon Sep 17 00:00:00 2001 From: Leaf Shi <132890443+LeafShi1@users.noreply.github.com> Date: Sat, 11 May 2024 03:13:44 +0000 Subject: [PATCH] Skip unstable test DataGridView_OnColumnHeadersHeightChanged_InvokeWithHandle_CallsColumnHeadersHeightChanged (#11323) * Skip unstable test DataGridView_OnColumnHeadersHeightChanged_InvokeWithHandle_CallsColumnHeadersHeightChanged * Add judgement RuntimeInformation.ProcessArchitecture == Architecture.X86 * Update DataGridViewTests.cs to add a space --- .../UnitTests/System/Windows/Forms/DataGridViewTests.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/DataGridViewTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/DataGridViewTests.cs index 63caf56153c..c89f670a001 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/DataGridViewTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/DataGridViewTests.cs @@ -4,6 +4,7 @@ using System.ComponentModel; using System.Data; using System.Drawing; +using System.Runtime.InteropServices; namespace System.Windows.Forms.Tests; @@ -1900,12 +1901,20 @@ public static IEnumerable OnColumnHeadersHeightChanged_TestData() { foreach (bool columnHeadersVisible in new bool[] { true, false }) { + // Skip verification of DataGridViewColumnHeadersHeightSizeMode = DisableResizing and columnHeadersVisible = true + // in X86 due to the active issue "https://github.com/dotnet/winforms/issues/11322" + if (columnHeadersWidthSizeMode == DataGridViewColumnHeadersHeightSizeMode.DisableResizing + && columnHeadersVisible is true + && RuntimeInformation.ProcessArchitecture == Architecture.X86) + continue; + yield return new object[] { columnHeadersWidthSizeMode, columnHeadersVisible, null }; yield return new object[] { columnHeadersWidthSizeMode, columnHeadersVisible, new EventArgs() }; } } } + [ActiveIssue("https://github.com/dotnet/winforms/issues/11322")] [WinFormsTheory] [MemberData(nameof(OnColumnHeadersHeightChanged_TestData))] public void DataGridView_OnColumnHeadersHeightChanged_Invoke_CallsColumnHeadersHeightChanged(DataGridViewColumnHeadersHeightSizeMode columnHeadersWidthSizeMode, bool columnHeadersVisible, EventArgs eventArgs)