commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1296542 - in /commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear: ArrayFieldVectorTest.java ArrayRealVectorTest.java
Date Sat, 03 Mar 2012 00:55:17 GMT
Author: sebb
Date: Sat Mar  3 00:55:17 2012
New Revision: 1296542

URL: http://svn.apache.org/viewvc?rev=1296542&view=rev
Log:
Use getter instead of direct array reference

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

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/ArrayFieldVectorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/ArrayFieldVectorTest.java?rev=1296542&r1=1296541&r2=1296542&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/ArrayFieldVectorTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/ArrayFieldVectorTest.java
Sat Mar  3 00:55:17 2012
@@ -313,12 +313,12 @@ public class ArrayFieldVectorTest {
         ArrayFieldVector<Fraction> v8 = new ArrayFieldVector<Fraction>(v1, true);
         Assert.assertEquals(7, v8.getDimension());
         Assert.assertEquals(new Fraction(0), v8.getEntry(6));
-        Assert.assertNotSame("testData not same object ", v1.data, v8.data);
+        Assert.assertNotSame("testData not same object ", v1.getDataRef(), v8.getDataRef());
 
         ArrayFieldVector<Fraction> v8_2 = new ArrayFieldVector<Fraction>(v1,
false);
         Assert.assertEquals(7, v8_2.getDimension());
         Assert.assertEquals(new Fraction(0), v8_2.getEntry(6));
-        Assert.assertArrayEquals(v1.data, v8_2.data);
+        Assert.assertArrayEquals(v1.getDataRef(), v8_2.getDataRef());
 
         ArrayFieldVector<Fraction> v9 = new ArrayFieldVector<Fraction>(v1, v3);
         Assert.assertEquals(10, v9.getDimension());
@@ -348,16 +348,16 @@ public class ArrayFieldVectorTest {
 
         FieldVector<Fraction> v_copy = v1.copy();
         Assert.assertEquals(3, v_copy.getDimension());
-        Assert.assertNotSame("testData not same object ", v1.data, v_copy.getData());
+        Assert.assertNotSame("testData not same object ", v1.getDataRef(), v_copy.getData());
 
         Fraction[] a_frac = v1.toArray();
         Assert.assertEquals(3, a_frac.length);
-        Assert.assertNotSame("testData not same object ", v1.data, a_frac);
+        Assert.assertNotSame("testData not same object ", v1.getDataRef(), a_frac);
 
 
 //      ArrayFieldVector<Fraction> vout4 = (ArrayFieldVector<Fraction>) v1.clone();
 //      Assert.assertEquals(3, vout4.getDimension());
-//      Assert.assertEquals(v1.data, vout4.data);
+//      Assert.assertEquals(v1.getDataRef(), vout4.getDataRef());
 
 
         FieldVector<Fraction> vout5 = v4.getSubVector(3, 3);
@@ -563,7 +563,7 @@ public class ArrayFieldVectorTest {
         /*
          Fraction[] dout1 = v1.copyOut();
         Assert.assertEquals(3, dout1.length);
-        assertNotSame("testData not same object ", v1.data, dout1);
+        assertNotSame("testData not same object ", v1.getDataRef(), dout1);
          */
         try {
             v1.checkVectorDimensions(2);

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=1296542&r1=1296541&r2=1296542&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
Sat Mar  3 00:55:17 2012
@@ -470,12 +470,12 @@ public class ArrayRealVectorTest {
         ArrayRealVector v8 = new ArrayRealVector(v1, true);
         Assert.assertEquals("testData len", 7, v8.getDimension());
         Assert.assertEquals("testData is 0.0 ", 0.0, v8.getEntry(6), 0);
-        Assert.assertNotSame("testData not same object ", v1.data, v8.data);
+        Assert.assertNotSame("testData not same object ", v1.getDataRef(), v8.getDataRef());
 
         ArrayRealVector v8_2 = new ArrayRealVector(v1, false);
         Assert.assertEquals("testData len", 7, v8_2.getDimension());
         Assert.assertEquals("testData is 0.0 ", 0.0, v8_2.getEntry(6), 0);
-        Assert.assertEquals("testData same object ", v1.data, v8_2.data);
+        Assert.assertEquals("testData same object ", v1.getDataRef(), v8_2.getDataRef());
 
         ArrayRealVector v9 = new ArrayRealVector(v1, v3);
         Assert.assertEquals("testData len", 10, v9.getDimension());
@@ -534,16 +534,16 @@ public class ArrayRealVectorTest {
 
         RealVector v_copy = v1.copy();
         Assert.assertEquals("testData len", 3, v_copy.getDimension());
-        Assert.assertNotSame("testData not same object ", v1.data, v_copy.toArray());
+        Assert.assertNotSame("testData not same object ", v1.getDataRef(), v_copy.toArray());
 
         double[] a_double = v1.toArray();
         Assert.assertEquals("testData len", 3, a_double.length);
-        Assert.assertNotSame("testData not same object ", v1.data, a_double);
+        Assert.assertNotSame("testData not same object ", v1.getDataRef(), a_double);
 
 
 //      ArrayRealVector vout4 = (ArrayRealVector) v1.clone();
 //      Assert.assertEquals("testData len", 3, vout4.getDimension());
-//      Assert.assertEquals("testData not same object ", v1.data, vout4.data);
+//      Assert.assertEquals("testData not same object ", v1.getDataRef(), vout4.getDataRef());
 
 
         RealVector vout5 = v4.getSubVector(3, 3);
@@ -1082,7 +1082,7 @@ public class ArrayRealVectorTest {
         /*
          double[] dout1 = v1.copyOut();
         Assert.assertEquals("testData len", 3, dout1.length);
-        Assert.assertNotSame("testData not same object ", v1.data, dout1);
+        Assert.assertNotSame("testData not same object ", v1.getDataRef(), dout1);
          */
         try {
             v1.checkVectorDimensions(2);



Mime
View raw message