From c81f3108f690cd3f9519cb3d30d21f7854939ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Nuno=20Mota?= Date: Wed, 7 Jun 2023 13:43:16 +0100 Subject: [PATCH] Add back fixed xunit decimal, IntPtr and UIntPtr commented test cases (#87084) --- .../tests/ParallelEnumerableTests.cs | 3 +- .../QueryOperators/DefaultIfEmptyTests.cs | 2 - .../System.Runtime/tests/System/ArrayTests.cs | 109 +++++++++--------- .../System/Reflection/InvokeRefReturn.cs | 7 +- .../System.Runtime/tests/default.rd.xml | 10 ++ 5 files changed, 66 insertions(+), 65 deletions(-) diff --git a/src/libraries/System.Linq.Parallel/tests/ParallelEnumerableTests.cs b/src/libraries/System.Linq.Parallel/tests/ParallelEnumerableTests.cs index a168f8db51970..a45e26bf352a6 100644 --- a/src/libraries/System.Linq.Parallel/tests/ParallelEnumerableTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/ParallelEnumerableTests.cs @@ -181,8 +181,7 @@ public static IEnumerable RepeatData() yield return new object[] { element, count }; yield return new object[] { (long)element, count }; yield return new object[] { (double)element, count }; - // [ActiveIssue("https://github.com/xunit/xunit/issues/1771")] - //yield return new object[] { (decimal)element, count }; + yield return new object[] { (decimal)element, count }; yield return new object[] { "" + element, count }; } yield return new object[] { null, count }; diff --git a/src/libraries/System.Linq.Parallel/tests/QueryOperators/DefaultIfEmptyTests.cs b/src/libraries/System.Linq.Parallel/tests/QueryOperators/DefaultIfEmptyTests.cs index 30358c411633a..4d628bda77c96 100644 --- a/src/libraries/System.Linq.Parallel/tests/QueryOperators/DefaultIfEmptyTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/QueryOperators/DefaultIfEmptyTests.cs @@ -109,7 +109,6 @@ public static void DefaultIfEmpty_NotEmpty_NotPipelined_Longrunning(Labeled(Labeled> labeled, T def) { ParallelQuery notEmpty = labeled.Item.DefaultIfEmpty(); @@ -125,7 +124,6 @@ public static void DefaultIfEmpty_Empty(Labeled> labeled, T [Theory] [MemberData(nameof(EmptyData))] - [ActiveIssue("https://github.com/xunit/xunit/issues/1771")] public static void DefaultIfEmpty_Empty_NotPipelined(Labeled> labeled, T def) { IList notEmpty = labeled.Item.DefaultIfEmpty().ToList(); diff --git a/src/libraries/System.Runtime/tests/System/ArrayTests.cs b/src/libraries/System.Runtime/tests/System/ArrayTests.cs index db382d37030f0..7ef45b6401ad0 100644 --- a/src/libraries/System.Runtime/tests/System/ArrayTests.cs +++ b/src/libraries/System.Runtime/tests/System/ArrayTests.cs @@ -263,38 +263,37 @@ public static IEnumerable BinarySearch_SZArray_TestData() yield return new object[] { new ulong[0], 0, 0, (ulong)0, null, -1 }; - // // [ActiveIssue("https://github.com/xunit/xunit/issues/1771")] - // // IntPtr + // IntPtr - // IntPtr[] intPtrArray = new IntPtr[] { IntPtr.MinValue, (IntPtr)0, (IntPtr)0, IntPtr.MaxValue }; + IntPtr[] intPtrArray = new IntPtr[] { IntPtr.MinValue, (IntPtr)0, (IntPtr)0, IntPtr.MaxValue }; - // yield return new object[] { intPtrArray, 0, 4, IntPtr.MinValue, null, 0 }; - // yield return new object[] { intPtrArray, 0, 4, (IntPtr)0, null, 1 }; - // yield return new object[] { intPtrArray, 0, 4, IntPtr.MaxValue, null, 3 }; - // yield return new object[] { intPtrArray, 0, 4, (IntPtr)1, null, -4 }; + yield return new object[] { intPtrArray, 0, 4, IntPtr.MinValue, null, 0 }; + yield return new object[] { intPtrArray, 0, 4, (IntPtr)0, null, 1 }; + yield return new object[] { intPtrArray, 0, 4, IntPtr.MaxValue, null, 3 }; + yield return new object[] { intPtrArray, 0, 4, (IntPtr)1, null, -4 }; - // yield return new object[] { intPtrArray, 0, 1, IntPtr.MinValue, null, 0 }; - // yield return new object[] { intPtrArray, 1, 3, IntPtr.MaxValue, null, 3 }; - // yield return new object[] { intPtrArray, 1, 3, IntPtr.MinValue, null, -2 }; - // yield return new object[] { intPtrArray, 1, 0, (IntPtr)0, null, -2 }; + yield return new object[] { intPtrArray, 0, 1, IntPtr.MinValue, null, 0 }; + yield return new object[] { intPtrArray, 1, 3, IntPtr.MaxValue, null, 3 }; + yield return new object[] { intPtrArray, 1, 3, IntPtr.MinValue, null, -2 }; + yield return new object[] { intPtrArray, 1, 0, (IntPtr)0, null, -2 }; - // yield return new object[] { new IntPtr[0], 0, 0, (IntPtr)0, null, -1 }; + yield return new object[] { new IntPtr[0], 0, 0, (IntPtr)0, null, -1 }; - // // UIntPtr + // UIntPtr - // UIntPtr[] uintPtrArray = new UIntPtr[] { UIntPtr.MinValue, (UIntPtr)5, (UIntPtr)5, UIntPtr.MaxValue }; + UIntPtr[] uintPtrArray = new UIntPtr[] { UIntPtr.MinValue, (UIntPtr)5, (UIntPtr)5, UIntPtr.MaxValue }; - // yield return new object[] { uintPtrArray, 0, 4, UIntPtr.MinValue, null, 0 }; - // yield return new object[] { uintPtrArray, 0, 4, (UIntPtr)5, null, 1 }; - // yield return new object[] { uintPtrArray, 0, 4, UIntPtr.MaxValue, null, 3 }; - // yield return new object[] { uintPtrArray, 0, 4, (UIntPtr)1, null, -2 }; + yield return new object[] { uintPtrArray, 0, 4, UIntPtr.MinValue, null, 0 }; + yield return new object[] { uintPtrArray, 0, 4, (UIntPtr)5, null, 1 }; + yield return new object[] { uintPtrArray, 0, 4, UIntPtr.MaxValue, null, 3 }; + yield return new object[] { uintPtrArray, 0, 4, (UIntPtr)1, null, -2 }; - // yield return new object[] { uintPtrArray, 0, 1, UIntPtr.MinValue, null, 0 }; - // yield return new object[] { uintPtrArray, 1, 3, UIntPtr.MaxValue, null, 3 }; - // yield return new object[] { uintPtrArray, 1, 3, UIntPtr.MinValue, null, -2 }; - // yield return new object[] { uintPtrArray, 1, 0, (UIntPtr)5, null, -2 }; + yield return new object[] { uintPtrArray, 0, 1, UIntPtr.MinValue, null, 0 }; + yield return new object[] { uintPtrArray, 1, 3, UIntPtr.MaxValue, null, 3 }; + yield return new object[] { uintPtrArray, 1, 3, UIntPtr.MinValue, null, -2 }; + yield return new object[] { uintPtrArray, 1, 0, (UIntPtr)5, null, -2 }; - // yield return new object[] { new UIntPtr[0], 0, 0, (UIntPtr)0, null, -1 }; + yield return new object[] { new UIntPtr[0], 0, 0, (UIntPtr)0, null, -1 }; // Char char[] charArray = new char[] { char.MinValue, (char)5, (char)5, char.MaxValue }; @@ -2361,25 +2360,23 @@ public static IEnumerable IndexOf_SZArray_TestData() yield return new object[] { new double[] { 1, 2, 3, 3 }, (double)1, 0, 0, -1 }; yield return new object[] { new double[0], (double)1, 0, 0, -1 }; - // [ActiveIssue("https://github.com/xunit/xunit/issues/1771")] // IntPtr - //yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3 }, (IntPtr)1, 0, 4, 0 }; - //yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3 }, (IntPtr)3, 0, 4, 2 }; - //yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3 }, (IntPtr)2, 1, 2, 1 }; - //yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3 }, (IntPtr)1, 1, 2, -1 }; - //yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3 }, (IntPtr)1, 4, 0, -1 }; - //yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3 }, (IntPtr)1, 0, 0, -1 }; - //yield return new object[] { new IntPtr[0], (IntPtr)1, 0, 0, -1 }; - - // [ActiveIssue("https://github.com/xunit/xunit/issues/1771")] + yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3 }, (IntPtr)1, 0, 4, 0 }; + yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3 }, (IntPtr)3, 0, 4, 2 }; + yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3 }, (IntPtr)2, 1, 2, 1 }; + yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3 }, (IntPtr)1, 1, 2, -1 }; + yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3 }, (IntPtr)1, 4, 0, -1 }; + yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3 }, (IntPtr)1, 0, 0, -1 }; + yield return new object[] { new IntPtr[0], (IntPtr)1, 0, 0, -1 }; + // UIntPtr - //yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3 }, (UIntPtr)1, 0, 4, 0 }; - //yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3 }, (UIntPtr)3, 0, 4, 2 }; - //yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3 }, (UIntPtr)2, 1, 2, 1 }; - //yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3 }, (UIntPtr)1, 1, 2, -1 }; - //yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3 }, (UIntPtr)1, 4, 0, -1 }; - //yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3 }, (UIntPtr)1, 0, 0, -1 }; - //yield return new object[] { new UIntPtr[0], (UIntPtr)1, 0, 0, -1 }; + yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3 }, (UIntPtr)1, 0, 4, 0 }; + yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3 }, (UIntPtr)3, 0, 4, 2 }; + yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3 }, (UIntPtr)2, 1, 2, 1 }; + yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3 }, (UIntPtr)1, 1, 2, -1 }; + yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3 }, (UIntPtr)1, 4, 0, -1 }; + yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3 }, (UIntPtr)1, 0, 0, -1 }; + yield return new object[] { new UIntPtr[0], (UIntPtr)1, 0, 0, -1 }; // String var stringArray = new string[] { null, null, "Hello", "Hello", "Goodbye", "Goodbye", null, null }; @@ -2739,25 +2736,23 @@ public static IEnumerable LastIndexOf_SZArray_TestData() yield return new object[] { new double[] { 1, 2, 3, 3, 4 }, (double)3, 0, 0, -1 }; yield return new object[] { new double[] { 1, 2, 3, 3, 4 }, (double)3, 3, 0, -1 }; - // [ActiveIssue("https://github.com/xunit/xunit/issues/1771")] // IntPtr - //yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3, (IntPtr)4 }, (IntPtr)1, 4, 5, 0 }; - //yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3, (IntPtr)4 }, (IntPtr)3, 4, 5, 3 }; - //yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3, (IntPtr)4 }, (IntPtr)2, 2, 3, 1 }; - //yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3, (IntPtr)4 }, (IntPtr)4, 2, 3, -1 }; - //yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3, (IntPtr)4 }, (IntPtr)5, 4, 5, -1 }; - //yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3, (IntPtr)4 }, (IntPtr)3, 0, 0, -1 }; - //yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3, (IntPtr)4 }, (IntPtr)3, 3, 0, -1 }; - - // [ActiveIssue("https://github.com/xunit/xunit/issues/1771")] + yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3, (IntPtr)4 }, (IntPtr)1, 4, 5, 0 }; + yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3, (IntPtr)4 }, (IntPtr)3, 4, 5, 3 }; + yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3, (IntPtr)4 }, (IntPtr)2, 2, 3, 1 }; + yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3, (IntPtr)4 }, (IntPtr)4, 2, 3, -1 }; + yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3, (IntPtr)4 }, (IntPtr)5, 4, 5, -1 }; + yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3, (IntPtr)4 }, (IntPtr)3, 0, 0, -1 }; + yield return new object[] { new IntPtr[] { (IntPtr)1, (IntPtr)2, (IntPtr)3, (IntPtr)3, (IntPtr)4 }, (IntPtr)3, 3, 0, -1 }; + // UIntPtr - //yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3, (UIntPtr)4 }, (UIntPtr)1, 4, 5, 0 }; - //yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3, (UIntPtr)4 }, (UIntPtr)3, 4, 5, 3 }; - //yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3, (UIntPtr)4 }, (UIntPtr)2, 2, 3, 1 }; - //yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3, (UIntPtr)4 }, (UIntPtr)4, 2, 3, -1 }; - //yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3, (UIntPtr)4 }, (UIntPtr)5, 4, 5, -1 }; - //yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3, (UIntPtr)4 }, (UIntPtr)3, 0, 0, -1 }; - //yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3, (UIntPtr)4 }, (UIntPtr)3, 3, 0, -1 }; + yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3, (UIntPtr)4 }, (UIntPtr)1, 4, 5, 0 }; + yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3, (UIntPtr)4 }, (UIntPtr)3, 4, 5, 3 }; + yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3, (UIntPtr)4 }, (UIntPtr)2, 2, 3, 1 }; + yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3, (UIntPtr)4 }, (UIntPtr)4, 2, 3, -1 }; + yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3, (UIntPtr)4 }, (UIntPtr)5, 4, 5, -1 }; + yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3, (UIntPtr)4 }, (UIntPtr)3, 0, 0, -1 }; + yield return new object[] { new UIntPtr[] { (UIntPtr)1, (UIntPtr)2, (UIntPtr)3, (UIntPtr)3, (UIntPtr)4 }, (UIntPtr)3, 3, 0, -1 }; // String var stringArray = new string[] { null, null, "Hello", "Hello", "Goodbye", "Goodbye", null, null }; diff --git a/src/libraries/System.Runtime/tests/System/Reflection/InvokeRefReturn.cs b/src/libraries/System.Runtime/tests/System/Reflection/InvokeRefReturn.cs index 48ea6f4bdfdf8..bc30e86e050dc 100644 --- a/src/libraries/System.Runtime/tests/System/Reflection/InvokeRefReturn.cs +++ b/src/libraries/System.Runtime/tests/System/Reflection/InvokeRefReturn.cs @@ -107,10 +107,9 @@ public static IEnumerable RefReturnInvokeTestData yield return new object[] { 42L }; yield return new object[] { 43.67f }; yield return new object[] { 43.67 }; - // [ActiveIssue("https://github.com/xunit/xunit/issues/1771")] - //yield return new object[] { new IntPtr(42) }; - //yield return new object[] { new UIntPtr(42) }; - //yield return new object[] { 232953453454m }; + yield return new object[] { new IntPtr(42) }; + yield return new object[] { new UIntPtr(42) }; + yield return new object[] { 232953453454m }; yield return new object[] { BindingFlags.IgnoreCase }; yield return new object[] { "Hello" }; yield return new object[] { new object() }; diff --git a/src/libraries/System.Runtime/tests/default.rd.xml b/src/libraries/System.Runtime/tests/default.rd.xml index c594df1579d56..cbfa5d3b58bd6 100644 --- a/src/libraries/System.Runtime/tests/default.rd.xml +++ b/src/libraries/System.Runtime/tests/default.rd.xml @@ -130,6 +130,9 @@ + + + @@ -176,6 +179,9 @@ + + + @@ -222,6 +228,9 @@ + + + @@ -243,6 +252,7 @@ +