commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1165287 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math/complex/ComplexTest.java
Date Mon, 05 Sep 2011 14:04:16 GMT
Author: erans
Date: Mon Sep  5 14:04:16 2011
New Revision: 1165287

URL: http://svn.apache.org/viewvc?rev=1165287&view=rev
Log:
Separating test cases.

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/complex/ComplexTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/complex/ComplexTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/complex/ComplexTest.java?rev=1165287&r1=1165286&r2=1165287&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/complex/ComplexTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/complex/ComplexTest.java
Mon Sep  5 14:04:16 2011
@@ -229,6 +229,14 @@ public class ComplexTest {
     public void testDivideZero() {
         Complex x = new Complex(3.0, 4.0);
         Complex z = x.divide(Complex.ZERO);
+        // Assert.assertEquals(z, Complex.INF); // See MATH-657
+        Assert.assertEquals(z, Complex.NaN);
+    }
+
+    @Test
+    public void testDivideZeroZero() {
+        Complex x = new Complex(0.0, 0.0);
+        Complex z = x.divide(Complex.ZERO);
         Assert.assertEquals(z, Complex.NaN);
     }
 
@@ -349,13 +357,13 @@ public class ComplexTest {
 
     @Test
     public void testScalarMultiplyInf() {
-        Complex x = new Complex(1,1);
+        Complex x = new Complex(1, 1);
         double yDouble = Double.POSITIVE_INFINITY;
         Complex yComplex = new Complex(yDouble);
         Assert.assertEquals(x.multiply(yComplex), x.multiply(yDouble));
         
         yDouble = Double.NEGATIVE_INFINITY;
-         yComplex = new Complex(yDouble);
+        yComplex = new Complex(yDouble);
         Assert.assertEquals(x.multiply(yComplex), x.multiply(yDouble));
     }
 
@@ -565,9 +573,13 @@ public class ComplexTest {
     }
 
     @Test
+    public void testAtanI() {
+        Assert.assertTrue(Complex.I.atan().isNaN());
+    }
+
+    @Test
     public void testAtanNaN() {
         Assert.assertTrue(Complex.NaN.atan().isNaN());
-        Assert.assertTrue(Complex.I.atan().isNaN());
     }
 
     @Test



Mime
View raw message