Skip to content

Commit

Permalink
Test for negative offset passed to ArrayWithOffset
Browse files Browse the repository at this point in the history
Fixes dotnet/corefx#34699


Commit migrated from dotnet/corefx@6168758
  • Loading branch information
jkotas authored and danmoseley committed Jan 24, 2019
1 parent e0e5eb6 commit 70bf6ac
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class ArrayWithOffsetTests
public static IEnumerable<object[]> Ctor_Array_Offset_TestData()
{
yield return new object[] { null, 0, 0 };
yield return new object[] { new int[2], -1, 8 };
yield return new object[] { new int[2], 2, 8 };
yield return new object[] { new int[2], 3, 8 };
yield return new object[] { new byte[4], 1, 4 };
Expand Down Expand Up @@ -44,6 +43,8 @@ public void Ctor_MultidimensionalArray_ThrowsArgumentException()
[InlineData(null, -1)]
[InlineData(null, 1)]
[InlineData(new int[] { 1 }, 5)]
[InlineData(new int[] { 2 }, -1)]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "The fix was made in coreclr that is not in netfx. See https://github.com/dotnet/corefx/issues/34699")]
public void Ctor_InvalidOffset_ThrowsIndexOutOfRangeException(object array, int offset)
{
Assert.Throws<IndexOutOfRangeException>(() => new ArrayWithOffset(array, offset));
Expand Down

0 comments on commit 70bf6ac

Please sign in to comment.