Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Reactivate Microsoft.VisualBasic ILC tests that are no longer failing. (
Browse files Browse the repository at this point in the history
#21939)

Most of https://github.com/dotnet/corefx/issues/21682

Isolated the one remaining failure - will keep using issue
to track.
  • Loading branch information
atsushikan authored and stephentoub committed Jul 6, 2017
1 parent e1c2b4d commit 7dff34f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
<Link>Common\System\Runtime\Serialization\Formatters\BinaryFormatterHelpers.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\$(AssemblyName).rd.xml" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
</Project>
12 changes: 8 additions & 4 deletions src/Microsoft.VisualBasic/tests/OperatorsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ public static IEnumerable<object[]> AddObject_Idempotent_TestData()
yield return new object[] { (ulong)12, "2", (double)14 };
yield return new object[] { (ulong)13, true, (decimal)12 };
yield return new object[] { (ulong)14, null, (ulong)14 };
yield return new object[] { (ulong)15, ulong.MaxValue, decimal.Parse("18446744073709551630") };

// long + primitives.
yield return new object[] { (long)8, (long)2, (long)10 };
Expand All @@ -122,7 +121,6 @@ public static IEnumerable<object[]> AddObject_Idempotent_TestData()
yield return new object[] { (long)12, "2", (double)14 };
yield return new object[] { (long)13, true, (long)12 };
yield return new object[] { (long)14, null, (long)14 };
yield return new object[] { (long)15, long.MaxValue, decimal.Parse("9223372036854775822") };

// float + primitives
yield return new object[] { (float)9, (float)2, (float)11 };
Expand Down Expand Up @@ -168,7 +166,6 @@ public static IEnumerable<object[]> AddObject_Idempotent_TestData()

[Theory]
[MemberData(nameof(AddObject_Idempotent_TestData))]
[ActiveIssue(21682, TargetFrameworkMonikers.UapAot)]
public void AddObject_Convertible_ReturnsExpected(object left, object right, object expected)
{
Assert.Equal(expected, Operators.AddObject(left, right));
Expand All @@ -184,6 +181,14 @@ public void AddObject_Convertible_ReturnsExpected(object left, object right, obj
}
}

[Fact]
[ActiveIssue("https://github.com/dotnet/corefx/issues/21682 -- fails when /buildtype:ret passed to ILC", TargetFrameworkMonikers.UapAot)]
public void AddObject_Convertible_ReturnsExpected_64BitOverflow()
{
AddObject_Convertible_ReturnsExpected((ulong)15, ulong.MaxValue, decimal.Parse("18446744073709551630"));
AddObject_Convertible_ReturnsExpected((long)15, long.MaxValue, decimal.Parse("9223372036854775822"));
}

[Fact]
public void AddObject_DateString_ReturnsExpected()
{
Expand Down Expand Up @@ -239,7 +244,6 @@ public static IEnumerable<object[]> IncompatibleAddObject_TestData()

[Theory]
[MemberData(nameof(IncompatibleAddObject_TestData))]
[ActiveIssue(21682, TargetFrameworkMonikers.UapAot)]
public void AddObject_Incompatible_ThrowsInvalidCastException(object left, object right)
{
Assert.Throws<InvalidCastException>(() => Operators.AddObject(left, right));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Library>
<!-- Needed because of objects in [Theory] data which causes xunit to reflect on its ToString() -->
<Type Name="System.DBNull" Dynamic="Required Public" />
</Library>
</Directives>

6 changes: 2 additions & 4 deletions src/Microsoft.VisualBasic/tests/UtilsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ public void CopyArray_NonMatchingRanks_ThrowsInvalidCastException()
Assert.Throws<InvalidCastException>(() => Utils.CopyArray(new int[1], new int[1, 1]));
}

[Fact]
[ActiveIssue(21682, TargetFrameworkMonikers.UapAot)]
[ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNonZeroLowerBoundArraySupported))]
public void CopyArray_RankGreaterThanTwoAndNonMatchingBounds_ThrowsArrayTypeMismatchException()
{
Array array1 = Array.CreateInstance(typeof(int), new int[] { 1, 2, 3 }, new int[] { 2, 3, 4 });
Expand All @@ -81,8 +80,7 @@ public void CopyArray_RankGreaterThanTwoAndNonMatchingBounds_ThrowsArrayTypeMism
Assert.Throws<ArrayTypeMismatchException>(() => Utils.CopyArray(array2, array1));
}

[Fact]
[ActiveIssue(21682, TargetFrameworkMonikers.UapAot)]
[ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNonZeroLowerBoundArraySupported))]
public void CopyArray_NonMatchingBounds_ThrowsArgumentOutOfRangeException()
{
Array array1 = Array.CreateInstance(typeof(int), new int[] { 1, 2 }, new int[] { 2, 3 });
Expand Down

0 comments on commit 7dff34f

Please sign in to comment.