commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From celes...@apache.org
Subject svn commit: r1348228 - in /commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear: RealVectorAbstractTest.java RealVectorTest.java
Date Fri, 08 Jun 2012 20:18:11 GMT
Author: celestin
Date: Fri Jun  8 20:18:10 2012
New Revision: 1348228

URL: http://svn.apache.org/viewvc?rev=1348228&view=rev
Log:
MATH-795: in RealVectorAbstractTest, extracted testIsInfinite() from
testPredicates().

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorAbstractTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorAbstractTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorAbstractTest.java?rev=1348228&r1=1348227&r2=1348228&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorAbstractTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorAbstractTest.java
Fri Jun  8 20:18:10 2012
@@ -391,6 +391,17 @@ public abstract class RealVectorAbstract
     }
 
     @Test
+    public void testIsInfinite() {
+        final RealVector v = create(new double[] { 0, 1, 2 });
+
+        Assert.assertFalse(v.isInfinite());
+        v.setEntry(0, Double.POSITIVE_INFINITY);
+        Assert.assertTrue(v.isInfinite());
+        v.setEntry(1, Double.NaN);
+        Assert.assertFalse(v.isInfinite());
+    }
+
+    @Test
     public void testDataInOut() {
         final RealVector v1 = create(vec1);
         final RealVector v2 = create(vec2);
@@ -985,16 +996,6 @@ public abstract class RealVectorAbstract
     public void testPredicates() {
         final RealVector v = create(new double[] { 0, 1, 2 });
 
-        Assert.assertFalse(v.isNaN());
-        v.setEntry(1, Double.NaN);
-        Assert.assertTrue(v.isNaN());
-
-        Assert.assertFalse(v.isInfinite());
-        v.setEntry(0, Double.POSITIVE_INFINITY);
-        Assert.assertFalse(v.isInfinite());
-        v.setEntry(1, 1);
-        Assert.assertTrue(v.isInfinite());
-
         v.setEntry(0, 0);
         Assert.assertEquals(v, create(new double[] { 0, 1, 2 }));
         Assert.assertNotSame(v, create(new double[] { 0, 1, 2 + FastMath.ulp(2)}));

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorTest.java?rev=1348228&r1=1348227&r2=1348228&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorTest.java
Fri Jun  8 20:18:10 2012
@@ -290,6 +290,13 @@ public class RealVectorTest extends Real
     }
 
     @Test
+    @Ignore("Abstract class RealVector does not implement isNaN()")
+    @Override
+    public void testIsInfinite() {
+        // Do nothing
+    }
+
+    @Test
     @Ignore
     @Override
     public void testBasicFunctions() {



Mime
View raw message