aherbert commented on a change in pull request #196:
URL: https://github.com/apache/commons-math/pull/196#discussion_r686369063



##########
File path: 
commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/Array2DRowRealMatrixTest.java
##########
@@ -895,9 +895,9 @@ public void testEqualsAndHashCode() {
         Assert.assertEquals(m.hashCode(), m1.hashCode());
         Assert.assertEquals(m, m);
         Assert.assertEquals(m, m1);
-        Assert.assertFalse(m.equals(null));
-        Assert.assertFalse(m.equals(mt));
-        Assert.assertFalse(m.equals(new Array2DRowRealMatrix(bigSingular)));
+        Assert.assertNotEquals(null, m);

Review comment:
       `m` should be the first argument

##########
File path: 
commons-math-legacy-core/src/test/java/org/apache/commons/math4/legacy/core/PairTest.java
##########
@@ -39,26 +39,26 @@ public void testAccessor2() {
 
         // Check that both APIs refer to the same data.
 
-        Assert.assertTrue(p.getFirst() == p.getKey());
-        Assert.assertTrue(p.getSecond() == p.getValue());
+        Assert.assertSame(p.getFirst(), p.getKey());
+        Assert.assertSame(p.getSecond(), p.getValue());
     }
 
     @Test
     public void testEquals() {
         Pair<Integer, Double> p1 = new Pair<>(null, null);
-        Assert.assertFalse(p1.equals(null));
+        Assert.assertNotEquals(null, p1);

Review comment:
       `p1` should be the first argument to allow the assert method to invoke 
`p1.equals(null)`

##########
File path: 
commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BlockFieldMatrixTest.java
##########
@@ -1150,9 +1150,9 @@ public void testEqualsAndHashCode() {
         Assert.assertEquals(m.hashCode(), m1.hashCode());
         Assert.assertEquals(m, m);
         Assert.assertEquals(m, m1);
-        Assert.assertFalse(m.equals(null));
-        Assert.assertFalse(m.equals(mt));
-        Assert.assertFalse(m.equals(new BlockFieldMatrix<>(bigSingular)));
+        Assert.assertNotEquals(null, m);

Review comment:
       `m` should be the first argument

##########
File path: 
commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/SparseFieldMatrixTest.java
##########
@@ -568,9 +568,9 @@ public void testEqualsAndHashCode() {
         Assert.assertEquals(m.hashCode(), m1.hashCode());
         Assert.assertEquals(m, m);
         Assert.assertEquals(m, m1);
-        Assert.assertFalse(m.equals(null));
-        Assert.assertFalse(m.equals(mt));
-        Assert.assertFalse(m.equals(createSparseMatrix(bigSingular)));
+        Assert.assertNotEquals(null, m);

Review comment:
       `m` should be the first argument

##########
File path: 
commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/rank/PSquarePercentileTest.java
##########
@@ -146,9 +146,9 @@ public void testMiscellaniousFunctionsInMarkers() {
                         Arrays.asList(new Double[] { 0.02, 1.18, 9.15, 21.91,
                                 38.62 }), p);
         // Markers equality
-        Assert.assertTrue(markers.equals(markers));
-        Assert.assertFalse(markers.equals(null));
-        Assert.assertFalse(markers.equals(""));
+        Assert.assertEquals(markers, markers);
+        Assert.assertNotEquals(null, markers);

Review comment:
       `markers` should be the first argument

##########
File path: 
commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/FieldMatrixImplTest.java
##########
@@ -867,9 +867,9 @@ public void testEqualsAndHashCode() {
         Assert.assertEquals(m.hashCode(), m1.hashCode());
         Assert.assertEquals(m, m);
         Assert.assertEquals(m, m1);
-        Assert.assertFalse(m.equals(null));
-        Assert.assertFalse(m.equals(mt));
-        Assert.assertFalse(m.equals(new Array2DRowFieldMatrix<>(bigSingular)));
+        Assert.assertNotEquals(null, m);

Review comment:
       `m` should be the first argument

##########
File path: 
commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/BlockRealMatrixTest.java
##########
@@ -1054,9 +1054,9 @@ public void testEqualsAndHashCode() {
         Assert.assertEquals(m.hashCode(), m1.hashCode());
         Assert.assertEquals(m, m);
         Assert.assertEquals(m, m1);
-        Assert.assertFalse(m.equals(null));
-        Assert.assertFalse(m.equals(mt));
-        Assert.assertFalse(m.equals(new BlockRealMatrix(bigSingular)));
+        Assert.assertNotEquals(null, m);

Review comment:
       `m` should be the first argument

##########
File path: 
commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/rank/PSquarePercentileTest.java
##########
@@ -321,8 +321,8 @@ public void testMarkerHeightWithHigherIndex() {
     public void testPSquaredEqualsAndMin() {
         PSquarePercentile ptile = new PSquarePercentile(0);
         Assert.assertEquals(ptile, ptile);
-        Assert.assertFalse(ptile.equals(null));
-        Assert.assertFalse(ptile.equals(""));
+        Assert.assertNotEquals(null, ptile);

Review comment:
       `ptile` should be the first argument

##########
File path: 
commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/PointValuePairTest.java
##########
@@ -36,19 +36,19 @@ public void testSerial() {
     public void testEquals() {
         final double[] p1 = new double[] { 1 };
         final PointValuePair pv1 = new PointValuePair(p1, 2);
-        Assert.assertFalse(pv1.equals(null));
+        Assert.assertNotEquals(null, pv1);

Review comment:
       `pv1` should be the first argument

##########
File path: 
commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/stat/descriptive/rank/PSquarePercentileTest.java
##########
@@ -321,8 +321,8 @@ public void testMarkerHeightWithHigherIndex() {
     public void testPSquaredEqualsAndMin() {
         PSquarePercentile ptile = new PSquarePercentile(0);
         Assert.assertEquals(ptile, ptile);
-        Assert.assertFalse(ptile.equals(null));
-        Assert.assertFalse(ptile.equals(""));
+        Assert.assertNotEquals(null, ptile);
+        Assert.assertNotEquals("", ptile);

Review comment:
       `ptile` should be the first argument

##########
File path: 
commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/RealVectorAbstractTest.java
##########
@@ -1337,11 +1337,11 @@ public void testCosineDimensionMismatch() {
     public void testEquals() {
         final RealVector v = create(new double[] { 0, 1, 2 });
 
-        Assert.assertTrue(v.equals(v));
-        Assert.assertTrue(v.equals(v.copy()));
-        Assert.assertFalse(v.equals(null));
-        Assert.assertFalse(v.equals(v.getSubVector(0, v.getDimension() - 1)));
-        Assert.assertTrue(v.equals(v.getSubVector(0, v.getDimension())));
+        Assert.assertEquals(v, v);
+        Assert.assertEquals(v, v.copy());
+        Assert.assertNotEquals(null, v);

Review comment:
       `v` should be the first argument

##########
File path: 
commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/linear/SparseRealMatrixTest.java
##########
@@ -565,9 +565,9 @@ public void testEqualsAndHashCode() {
         Assert.assertEquals(m.hashCode(), m1.hashCode());
         Assert.assertEquals(m, m);
         Assert.assertEquals(m, m1);
-        Assert.assertFalse(m.equals(null));
-        Assert.assertFalse(m.equals(mt));
-        Assert.assertFalse(m.equals(createSparseMatrix(bigSingular)));
+        Assert.assertNotEquals(null, m);

Review comment:
       `m` should be the first argument




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to