Enabling some skipped math and mathf tests
authorTanner Gooding <tagoo@outlook.com>
Sun, 26 Aug 2018 02:04:10 +0000 (19:04 -0700)
committerTanner Gooding <tagoo@outlook.com>
Wed, 5 Sep 2018 16:02:00 +0000 (09:02 -0700)
Commit migrated from https://github.com/dotnet/corefx/commit/5d7f2469f4ef37e6bc6846f85d9ea55570002c8f

src/libraries/System.Runtime.Extensions/tests/System/Math.cs
src/libraries/System.Runtime.Extensions/tests/System/MathF.netcoreapp.cs

index 70211b3..0ee3b2a 100644 (file)
@@ -722,12 +722,6 @@ namespace System.Tests
         [InlineData(-1.4142135623730950,     -1.0,                     0.0)]    // value: -(sqrt(2))
         [InlineData(-1.1283791670955126,     -1.0,                     0.0)]    // value: -(2 / sqrt(pi))
         [InlineData(-1.0,                    -1.0,                     0.0)]
-        [InlineData(-0.78539816339744831,    -0.0,                     0.0, Skip = "https://github.com/dotnet/coreclr/issues/10287")]    // value: -(pi / 4)
-        [InlineData(-0.70710678118654752,    -0.0,                     0.0, Skip = "https://github.com/dotnet/coreclr/issues/10287")]    // value: -(1 / sqrt(2))
-        [InlineData(-0.69314718055994531,    -0.0,                     0.0, Skip = "https://github.com/dotnet/coreclr/issues/10287")]    // value: -(ln(2))
-        [InlineData(-0.63661977236758134,    -0.0,                     0.0, Skip = "https://github.com/dotnet/coreclr/issues/10287")]    // value: -(2 / pi)
-        [InlineData(-0.43429448190325183,    -0.0,                     0.0, Skip = "https://github.com/dotnet/coreclr/issues/10287")]    // value: -(log10(e))
-        [InlineData(-0.31830988618379067,    -0.0,                     0.0, Skip = "https://github.com/dotnet/coreclr/issues/10287")]    // value: -(1 / pi)
         [InlineData(-0.0,                    -0.0,                     0.0)]
         [InlineData( double.NaN,              double.NaN,              0.0)]
         [InlineData( 0.0,                     0.0,                     0.0)]
@@ -752,6 +746,19 @@ namespace System.Tests
         }
 
         [Theory]
+        [InlineData(-0.78539816339744831,    -0.0,                     0.0)]    // value: -(pi / 4)
+        [InlineData(-0.70710678118654752,    -0.0,                     0.0)]    // value: -(1 / sqrt(2))
+        [InlineData(-0.69314718055994531,    -0.0,                     0.0)]    // value: -(ln(2))
+        [InlineData(-0.63661977236758134,    -0.0,                     0.0)]    // value: -(2 / pi)
+        [InlineData(-0.43429448190325183,    -0.0,                     0.0)]    // value: -(log10(e))
+        [InlineData(-0.31830988618379067,    -0.0,                     0.0)]    // value: -(1 / pi)
+        [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
+        public static void Ceiling_Double_IEEE(double value, double expectedResult, double allowedVariance)
+        {
+            AssertEqual(expectedResult, Math.Ceiling(value), allowedVariance);
+        }
+
+        [Theory]
         [InlineData( double.NegativeInfinity,  double.NaN,          0.0)]
         [InlineData(-3.1415926535897932,      -1.0,                 CrossPlatformMachineEpsilon * 10)]  // value: -(pi)
         [InlineData(-2.7182818284590452,      -0.91173391478696510, CrossPlatformMachineEpsilon)]       // value: -(e)
@@ -892,7 +899,6 @@ namespace System.Tests
         [InlineData(-0.63661977236758134,    -1.0,                     0.0)]    // value: -(2 / pi)
         [InlineData(-0.43429448190325183,    -1.0,                     0.0)]    // value: -(log10(e))
         [InlineData(-0.31830988618379067,    -1.0,                     0.0)]    // value: -(1 / pi)
-        [InlineData(-0.0,                    -0.0,                     0.0, Skip = "https://github.com/dotnet/coreclr/issues/10288")]
         [InlineData( double.NaN,              double.NaN,              0.0)]
         [InlineData( 0.0,                     0.0,                     0.0)]
         [InlineData( 0.31830988618379067,     0.0,                     0.0)]    // value:  (1 / pi)
@@ -915,6 +921,14 @@ namespace System.Tests
             AssertEqual(expectedResult, Math.Floor(value), allowedVariance);
         }
 
+        [Theory]
+        [InlineData(-0.0,                    -0.0,                     0.0)]
+        [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
+        public static void Floor_Double_IEEE(double value, double expectedResult, double allowedVariance)
+        {
+            AssertEqual(expectedResult, Math.Floor(value), allowedVariance);
+        }
+
         [Fact]
         public static void IEEERemainder()
         {
index 484aef1..82e97a1 100644 (file)
@@ -610,12 +610,12 @@ namespace System.Tests
         [InlineData(-1.41421356f,           -1.0f,                   0.0f)]     // value: -(sqrt(2))
         [InlineData(-1.12837917f,           -1.0f,                   0.0f)]     // value: -(2 / sqrt(pi))
         [InlineData(-1.0f,                  -1.0f,                   0.0f)]
-        [InlineData(-0.785398163f,          -0.0f,                   0.0f, Skip = "https://github.com/dotnet/coreclr/issues/10287")]  // value: -(pi / 4)
-        [InlineData(-0.707106781f,          -0.0f,                   0.0f, Skip = "https://github.com/dotnet/coreclr/issues/10287")]  // value: -(1 / sqrt(2))
-        [InlineData(-0.693147181f,          -0.0f,                   0.0f, Skip = "https://github.com/dotnet/coreclr/issues/10287")]  // value: -(ln(2))
-        [InlineData(-0.636619772f,          -0.0f,                   0.0f, Skip = "https://github.com/dotnet/coreclr/issues/10287")]  // value: -(2 / pi)
-        [InlineData(-0.434294482f,          -0.0f,                   0.0f, Skip = "https://github.com/dotnet/coreclr/issues/10287")]  // value: -(log10(e))
-        [InlineData(-0.318309886f,          -0.0f,                   0.0f, Skip = "https://github.com/dotnet/coreclr/issues/10287")]  // value: -(1 / pi)
+        [InlineData(-0.785398163f,          -0.0f,                   0.0f)]  // value: -(pi / 4)
+        [InlineData(-0.707106781f,          -0.0f,                   0.0f)]  // value: -(1 / sqrt(2))
+        [InlineData(-0.693147181f,          -0.0f,                   0.0f)]  // value: -(ln(2))
+        [InlineData(-0.636619772f,          -0.0f,                   0.0f)]  // value: -(2 / pi)
+        [InlineData(-0.434294482f,          -0.0f,                   0.0f)]  // value: -(log10(e))
+        [InlineData(-0.318309886f,          -0.0f,                   0.0f)]  // value: -(1 / pi)
         [InlineData(-0.0f,                  -0.0f,                   0.0f)]
         [InlineData( float.NaN,              float.NaN,              0.0f)]
         [InlineData( 0.0f,                   0.0f,                   0.0f)]