On 7/24/11 2:43 PM, er...@apache.org wrote: > Author: erans > Date: Sun Jul 24 21:43:08 2011 > New Revision: 1150496 > > URL: http://svn.apache.org/viewvc?rev=1150496&view=rev > Log: > MATH-632 > Added tests referred to in the corresponding JIRA ticket. > > Modified: > > commons/proper/math/trunk/src/test/java/org/apache/commons/math/complex/ComplexTest.java >
I understand how the examples below may be useful in discussion, but I don't think the stuff between ***** belongs in ComplexTest.java. Phil > 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=1150496&r1=1150495&r2=1150496&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 > Sun Jul 24 21:43:08 2011 > @@ -20,6 +20,7 @@ package org.apache.commons.math.complex; > import org.apache.commons.math.TestUtils; > import org.apache.commons.math.exception.NullArgumentException; > import org.apache.commons.math.util.FastMath; > +import org.apache.commons.math.util.MathUtils; > import org.junit.Assert; > import org.junit.Test; > > @@ -478,6 +479,20 @@ public class ComplexTest { > Assert.assertTrue(realNaN.equals(imaginaryNaN)); > Assert.assertTrue(imaginaryNaN.equals(complexNaN)); > Assert.assertTrue(realNaN.equals(complexNaN)); > + *********************************** > + final double a = Double.NaN; > + final double b = Double.NaN; > + Assert.assertFalse("a == b", a == b); > + Assert.assertEquals("a != b", a, b, Double.MIN_VALUE); > + Assert.assertFalse("a == b", MathUtils.equals(a, b)); > + Assert.assertFalse("a == b", MathUtils.equals(a, b, > Double.MIN_VALUE)); > + final Double dA = Double.valueOf(a); > + final Double dB = Double.valueOf(b); > + Assert.assertFalse("dA == dB", dA.doubleValue() == dB.doubleValue()); > + Assert.assertTrue("!dA.equals(dB)", dA.equals(dB)); ******************************************* > + final Complex cA = new Complex(a, 0); > + final Complex cB = new Complex(b, 0); > + Assert.assertTrue("!cA.equals(cB)", cA.equals(cB)); > } > > @Test > > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org