Improve HPSF test failure message

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1183626 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2011-10-15 11:57:54 +00:00
parent 6c6fb5aad7
commit be50ad102f

View File

@ -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 + ".");