Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/libraries/System.Runtime/tests/System/ArrayTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3241,15 +3241,15 @@ public static void Reverse_MultidimensionalArray_ThrowsRankException()
Assert.Throws<RankException>(() => 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)
{
AssertExtensions.Throws<ArgumentOutOfRangeException>("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<ArgumentOutOfRangeException>("index", "length", () => Array.Reverse(NonZeroLowerBoundArray(new int[0], 1), 0, 0));
Expand Down Expand Up @@ -4312,7 +4312,7 @@ public static void Reverse_Generic_InvalidOffsetPlusLength_ThrowsArgumentExcepti
AssertExtensions.Throws<ArgumentException>(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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,12 @@ public static IEnumerable<object[]> 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

Expand Down