JAL-1767 include d and e vectors in Matrix.copy()
[jalview.git] / test / jalview / math / MatrixTest.java
index 97ded5a..6e9c0f1 100644 (file)
@@ -188,9 +188,23 @@ public class MatrixTest
       }
     }
     Matrix m1 = new Matrix(in);
+
     Matrix m2 = (Matrix) m1.copy();
     assertNotSame(m1, m2);
     assertTrue(matrixEquals(m1, m2));
+    assertNull(m2.d);
+    assertNull(m2.e);
+
+    /*
+     * now add d and e vectors and recopy
+     */
+    m1.d = Arrays.copyOf(in[2], in[2].length);
+    m1.e = Arrays.copyOf(in[4], in[4].length);
+    m2 = (Matrix) m1.copy();
+    assertNotSame(m2.d, m1.d);
+    assertNotSame(m2.e, m1.e);
+    assertEquals(m2.d, m1.d);
+    assertEquals(m2.e, m1.e);
   }
 
   /**