diff --git a/src/libraries/System.Runtime/tests/System/ArrayTests.cs b/src/libraries/System.Runtime/tests/System/ArrayTests.cs index 54bf303d2e2664..7f97f95f4507c7 100644 --- a/src/libraries/System.Runtime/tests/System/ArrayTests.cs +++ b/src/libraries/System.Runtime/tests/System/ArrayTests.cs @@ -3241,7 +3241,7 @@ public static void Reverse_MultidimensionalArray_ThrowsRankException() Assert.Throws(() => Array.Reverse((Array)new int[10, 10], 0, 0)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNonZeroLowerBoundArraySupported))] [InlineData(0)] [InlineData(-1)] public static void Reverse_IndexLessThanLowerBound_ThrowsArgumentOutOfRangeException(int lowerBound) @@ -3249,7 +3249,7 @@ public static void Reverse_IndexLessThanLowerBound_ThrowsArgumentOutOfRangeExcep AssertExtensions.Throws("index", () => Array.Reverse(NonZeroLowerBoundArray(new int[0], lowerBound), lowerBound - 1, 0)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNonZeroLowerBoundArraySupported))] public static void Reverse_IndexLessThanPositiveLowerBound_ThrowsArgumentOutOfRangeException() { AssertExtensions.Throws("index", "length", () => Array.Reverse(NonZeroLowerBoundArray(new int[0], 1), 0, 0)); @@ -4312,7 +4312,7 @@ public static void Reverse_Generic_InvalidOffsetPlusLength_ThrowsArgumentExcepti AssertExtensions.Throws(null, () => Array.Reverse(new string[arrayLength], index, length)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNonZeroLowerBoundArraySupported))] public static void Reverse_NonSZArrayWithMinValueLowerBound() { Array array = NonZeroLowerBoundArray(new int[] { 1, 2, 3 }, int.MinValue); diff --git a/src/libraries/System.Runtime/tests/System/Runtime/CompilerServices/RuntimeHelpersTests.cs b/src/libraries/System.Runtime/tests/System/Runtime/CompilerServices/RuntimeHelpersTests.cs index 33327d00fed473..d9b579c56476ad 100644 --- a/src/libraries/System.Runtime/tests/System/Runtime/CompilerServices/RuntimeHelpersTests.cs +++ b/src/libraries/System.Runtime/tests/System/Runtime/CompilerServices/RuntimeHelpersTests.cs @@ -198,7 +198,12 @@ public static IEnumerable GetUninitializedObject_NegativeTestCases() yield return new[] { typeof(string), typeof(ArgumentException) }; // variable-length type yield return new[] { typeof(int[]), typeof(ArgumentException) }; // variable-length type yield return new[] { typeof(int[,]), typeof(ArgumentException) }; // variable-length type - yield return new[] { Array.CreateInstance(typeof(int), new[] { 1 }, new[] { 1 }).GetType(), typeof(ArgumentException) }; // variable-length type (non-szarray) + + if (PlatformDetection.IsNonZeroLowerBoundArraySupported) + { + yield return new[] { Array.CreateInstance(typeof(int), new[] { 1 }, new[] { 1 }).GetType(), typeof(ArgumentException) }; // variable-length type (non-szarray) + } + yield return new[] { typeof(Array), typeof(MemberAccessException) }; // abstract type yield return new[] { typeof(Enum), typeof(MemberAccessException) }; // abstract type