From 1a614fc19866c5c47a36b401e04bf2c42ce256a0 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Sat, 15 Oct 2011 11:57:54 +0000 Subject: [PATCH] Improve HPSF test failure message git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1183626 13f79535-47bb-0310-9956-ffa450edef68 --- src/testcases/org/apache/poi/hpsf/basic/TestWrite.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java b/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java index eabda72d5b..9fe4d202f4 100644 --- a/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java +++ b/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java @@ -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 + "."); -- 2.39.5