kpouer commented on code in PR #271:
URL: https://github.com/apache/commons-imaging/pull/271#discussion_r1114971509


##########
src/test/java/org/apache/commons/imaging/roundtrip/ImageAsserts.java:
##########
@@ -99,4 +99,18 @@ static void assertEquals(final File a, final File b) throws 
IOException {
             Assertions.assertEquals(aByte, bByte);
         }
     }
+
+    static void assertEquals(byte[] aData, byte[] bData) {
+        for (int i = 0; i < aData.length; i++) {
+            final int aByte = 0xff & aData[i];
+            final int bByte = 0xff & bData[i];
+
+            if (aByte != bByte) {
+                Debug.debug("i: " + i);
+                Debug.debug("aByte: " + aByte + " (0x" + 
Integer.toHexString(aByte) + ')');
+                Debug.debug("bByte: " + bByte + " (0x" + 
Integer.toHexString(bByte) + ')');
+            }
+            Assertions.assertEquals(aByte, bByte);
+        }
+    }

Review Comment:
   The only idea was to match the other similar methods of the class.
   Also I am not sure the comparison with assertArrayEquals would be strictly 
identical as there is a bitwise operation & 0xFF I suppose to make it positive 
value ? (however I have no idea if it would change something in the unit tests).



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to