commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From celes...@apache.org
Subject svn commit: r1346245 - in /commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear: ArrayRealVectorTest.java RealVectorAbstractTest.java
Date Tue, 05 Jun 2012 05:45:41 GMT
Author: celestin
Date: Tue Jun  5 05:45:41 2012
New Revision: 1346245

URL: http://svn.apache.org/viewvc?rev=1346245&view=rev
Log:
MATH-795: factored out testAddToEntry().

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

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/ArrayRealVectorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/ArrayRealVectorTest.java?rev=1346245&r1=1346244&r2=1346245&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/ArrayRealVectorTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/ArrayRealVectorTest.java
Tue Jun  5 05:45:41 2012
@@ -740,19 +740,6 @@ public class ArrayRealVectorTest extends
         }
     }
 
-    @Test
-    public void testAddToEntry() {
-        final double[] v = new double[] { 1, 2, 3 };
-        final ArrayRealVector x = new ArrayRealVector(v);
-        final double inc = 7;
-        for (int i = 0; i < x.getDimension(); i++) {
-            x.addToEntry(i, inc);
-        }
-        for (int i = 0; i < x.getDimension(); i++) {
-            Assert.assertEquals(v[i] + inc, x.getEntry(i), 0);
-        }
-    }
-
     @Override
     public RealVector create(final double[] data) {
         return new ArrayRealVector(data, true);

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=1346245&r1=1346244&r2=1346245&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
Tue Jun  5 05:45:41 2012
@@ -752,6 +752,20 @@ public abstract class RealVectorAbstract
         Assert.assertEquals(v,TestUtils.serializeAndRecover(v));
     }
 
+
+    @Test
+    public void testAddToEntry() {
+        final double[] v = new double[] { 1, 2, 3 };
+        final RealVector x = create(v);
+        final double inc = 7;
+        for (int i = 0; i < x.getDimension(); i++) {
+            x.addToEntry(i, inc);
+        }
+        for (int i = 0; i < x.getDimension(); i++) {
+            Assert.assertEquals(v[i] + inc, x.getEntry(i), 0);
+        }
+    }
+
     /*
      * TESTS OF THE VISITOR PATTERN
      */



Mime
View raw message