poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1183626 - /poi/trunk/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java
Date Sat, 15 Oct 2011 11:57:54 GMT
Author: nick
Date: Sat Oct 15 11:57:54 2011
New Revision: 1183626

URL: http://svn.apache.org/viewvc?rev=1183626&view=rev
Log:
Improve HPSF test failure message

Modified:
    poi/trunk/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java

Modified: poi/trunk/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java?rev=1183626&r1=1183625&r2=1183626&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java Sat Oct 15 11:57:54 2011
@@ -607,7 +607,13 @@ public class TestWrite extends TestCase
                                 variantType, codepage);
         if (objRead instanceof byte[])
         {
-            final int diff = diff((byte[]) value, (byte[]) objRead);
+            byte[] valueB = (byte[])value;
+            byte[] readB = (byte[])objRead;
+            if (valueB.length != readB.length)
+               fail("Byte arrays are different length - expected " + valueB.length +
+                     " but found " + readB.length);
+
+            final int diff = diff(valueB, readB);
             if (diff >= 0)
                 fail("Byte arrays are different. First different byte is at " +
                      "index " + diff + ".");



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message