NUMBERS-45: Removed tests in old ComplexTest class calling Complex.isNaN() and Complex.isInf()
Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/45a7579e Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/45a7579e Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/45a7579e Branch: refs/heads/master Commit: 45a7579e92befffaf70e2ae24a4036458da071bc Parents: 28d6b98 Author: Eric Barnhill <ericbarnh...@apache.org> Authored: Thu Jun 22 14:49:03 2017 +0200 Committer: Eric Barnhill <ericbarnh...@apache.org> Committed: Thu Jun 22 14:49:03 2017 +0200 ---------------------------------------------------------------------- .../commons/numbers/complex/ComplexTest.java | 129 ------------------- 1 file changed, 129 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/45a7579e/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexTest.java ---------------------------------------------------------------------- diff --git a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexTest.java b/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexTest.java index 1641723..99a9624 100644 --- a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexTest.java +++ b/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexTest.java @@ -62,18 +62,6 @@ public class ComplexTest { } @Test - public void testConstructorNaN() { - Complex z = new Complex(3.0, Double.NaN); - Assert.assertTrue(z.isNaN()); - - z = new Complex(nan, 4.0); - Assert.assertTrue(z.isNaN()); - - z = new Complex(3.0, 4.0); - Assert.assertFalse(z.isNaN()); - } - - @Test public void testAbs() { Complex z = new Complex(3.0, 4.0); Assert.assertEquals(5.0, z.abs(), 0); @@ -165,12 +153,6 @@ public class ComplexTest { } @Test - public void testConjugateNaN() { - Complex z = Complex.NaN.conjugate(); - Assert.assertTrue(z.isNaN()); - } - - @Test public void testConjugateInfinite() { Complex z = new Complex(0, inf); Assert.assertEquals(neginf, z.conjugate().getImaginary(), 0); @@ -239,13 +221,6 @@ public class ComplexTest { } @Test - public void testDivideNaN() { - Complex x = new Complex(3.0, 4.0); - Complex z = x.divide(Complex.NaN); - Assert.assertTrue(z.isNaN()); - } - - @Test public void testDivideNaNInf() { Complex z = oneInf.divide(Complex.ONE); Assert.assertTrue(Double.isNaN(z.getReal())); @@ -328,11 +303,6 @@ public class ComplexTest { } @Test - public void testReciprocalNaN() { - Assert.assertTrue(Complex.NaN.reciprocal().isNaN()); - } - - @Test public void testMultiply() { Complex x = new Complex(3.0, 4.0); Complex y = new Complex(5.0, 6.0); @@ -351,12 +321,6 @@ public class ComplexTest { } @Test - public void testMultiplyInfInf() { - // Assert.assertTrue(infInf.multiply(infInf).isNaN()); // MATH-620 - Assert.assertTrue(infInf.multiply(infInf).isInfinite()); - } - - @Test public void testMultiplyNaNInf() { Complex z = new Complex(1,1); Complex w = z.multiply(infOne); @@ -420,12 +384,6 @@ public class ComplexTest { } @Test - public void testNegateNaN() { - Complex z = Complex.NaN.negate(); - Assert.assertTrue(z.isNaN()); - } - - @Test public void testSubtract() { Complex x = new Complex(3.0, 4.0); Complex y = new Complex(5.0, 6.0); @@ -669,11 +627,6 @@ public class ComplexTest { } @Test - public void testAcosNaN() { - Assert.assertTrue(Complex.NaN.acos().isNaN()); - } - - @Test public void testAsin() { Complex z = new Complex(3, 4); Complex expected = new Complex(0.633984, 2.30551); @@ -681,11 +634,6 @@ public class ComplexTest { } @Test - public void testAsinNaN() { - Assert.assertTrue(Complex.NaN.asin().isNaN()); - } - - @Test public void testAsinInf() { TestUtils.assertSame(Complex.NaN, oneInf.asin()); TestUtils.assertSame(Complex.NaN, oneNegInf.asin()); @@ -697,7 +645,6 @@ public class ComplexTest { TestUtils.assertSame(Complex.NaN, negInfNegInf.asin()); } - @Test public void testAtan() { Complex z = new Complex(3, 4); @@ -718,16 +665,6 @@ public class ComplexTest { } @Test - public void testAtanI() { - Assert.assertTrue(Complex.I.atan().isNaN()); - } - - @Test - public void testAtanNaN() { - Assert.assertTrue(Complex.NaN.atan().isNaN()); - } - - @Test public void testCos() { Complex z = new Complex(3, 4); Complex expected = new Complex(-27.03495, -3.851153); @@ -735,11 +672,6 @@ public class ComplexTest { } @Test - public void testCosNaN() { - Assert.assertTrue(Complex.NaN.cos().isNaN()); - } - - @Test public void testCosInf() { TestUtils.assertSame(infNegInf, oneInf.cos()); TestUtils.assertSame(infInf, oneNegInf.cos()); @@ -759,11 +691,6 @@ public class ComplexTest { } @Test - public void testCoshNaN() { - Assert.assertTrue(Complex.NaN.cosh().isNaN()); - } - - @Test public void testCoshInf() { TestUtils.assertSame(Complex.NaN, oneInf.cosh()); TestUtils.assertSame(Complex.NaN, oneNegInf.cosh()); @@ -789,11 +716,6 @@ public class ComplexTest { } @Test - public void testExpNaN() { - Assert.assertTrue(Complex.NaN.exp().isNaN()); - } - - @Test public void testExpInf1() { TestUtils.assertSame(Complex.NaN, oneInf.exp()); } @@ -870,11 +792,6 @@ public class ComplexTest { } @Test - public void testLogNaN() { - Assert.assertTrue(Complex.NaN.log().isNaN()); - } - - @Test public void testLogInf() { final double tol = Math.ulp(1d); TestUtils.assertEquals(new Complex(inf, pi / 2), @@ -907,18 +824,6 @@ public class ComplexTest { TestUtils.assertEquals(expected, x.pow(y), 1.0e-5); } - @Test - public void testPowNaNBase() { - Complex x = new Complex(3, 4); - Assert.assertTrue(Complex.NaN.pow(x).isNaN()); - } - - @Test - public void testPowNaNExponent() { - Complex x = new Complex(3, 4); - Assert.assertTrue(x.pow(Complex.NaN).isNaN()); - } - @Test public void testPowInf() { TestUtils.assertSame(Complex.NaN,Complex.ONE.pow(oneInf)); @@ -1042,11 +947,6 @@ public class ComplexTest { } @Test - public void testSinNaN() { - Assert.assertTrue(Complex.NaN.sin().isNaN()); - } - - @Test public void testSinh() { Complex z = new Complex(3, 4); Complex expected = new Complex(-6.54812, -7.61923); @@ -1054,11 +954,6 @@ public class ComplexTest { } @Test - public void testSinhNaN() { - Assert.assertTrue(Complex.NaN.sinh().isNaN()); - } - - @Test public void testSinhInf() { TestUtils.assertSame(Complex.NaN, oneInf.sinh()); TestUtils.assertSame(Complex.NaN, oneNegInf.sinh()); @@ -1122,11 +1017,6 @@ public class ComplexTest { } @Test - public void testSqrtNaN() { - Assert.assertTrue(Complex.NaN.sqrt().isNaN()); - } - - @Test public void testSqrtInf() { TestUtils.assertSame(infNaN, oneInf.sqrt()); TestUtils.assertSame(infNaN, oneNegInf.sqrt()); @@ -1146,11 +1036,6 @@ public class ComplexTest { } @Test - public void testSqrt1zNaN() { - Assert.assertTrue(Complex.NaN.sqrt1z().isNaN()); - } - - @Test public void testTan() { Complex z = new Complex(3, 4); Complex expected = new Complex(-0.000187346, 0.999356); @@ -1165,11 +1050,6 @@ public class ComplexTest { } @Test - public void testTanNaN() { - Assert.assertTrue(Complex.NaN.tan().isNaN()); - } - - @Test public void testTanInf() { TestUtils.assertSame(Complex.valueOf(0.0, 1.0), oneInf.tan()); TestUtils.assertSame(Complex.valueOf(0.0, -1.0), oneNegInf.tan()); @@ -1202,11 +1082,6 @@ public class ComplexTest { } @Test - public void testTanhNaN() { - Assert.assertTrue(Complex.NaN.tanh().isNaN()); - } - - @Test public void testTanhInf() { TestUtils.assertSame(Complex.NaN, oneInf.tanh()); TestUtils.assertSame(Complex.NaN, oneNegInf.tanh()); @@ -1449,18 +1324,14 @@ public class ComplexTest { Assert.assertEquals(z, TestUtils.serializeAndRecover(z)); Complex ncmplx = (Complex)TestUtils.serializeAndRecover(oneNaN); Assert.assertEquals(nanZero, ncmplx); - Assert.assertTrue(ncmplx.isNaN()); Complex infcmplx = (Complex)TestUtils.serializeAndRecover(infInf); Assert.assertEquals(infInf, infcmplx); - Assert.assertTrue(infcmplx.isInfinite()); TestComplex tz = new TestComplex(3.0, 4.0); Assert.assertEquals(tz, TestUtils.serializeAndRecover(tz)); TestComplex ntcmplx = (TestComplex)TestUtils.serializeAndRecover(new TestComplex(oneNaN)); Assert.assertEquals(nanZero, ntcmplx); - Assert.assertTrue(ntcmplx.isNaN()); TestComplex inftcmplx = (TestComplex)TestUtils.serializeAndRecover(new TestComplex(infInf)); Assert.assertEquals(infInf, inftcmplx); - Assert.assertTrue(inftcmplx.isInfinite()); } /**