Adjust test to write the failing PNG in case expected and actual do not match

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1568740 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2014-02-16 08:39:17 +00:00
parent 5dcd70db76
commit 2414998aac

View File

@ -109,6 +109,11 @@ public class TestFontRendering {
DataBufferByte actualDB = (DataBufferByte)imgActual.getRaster().getDataBuffer();
byte[] expectedData = expectedDB.getData(0);
byte[] actualData = actualDB.getData(0);
// allow to find out what the actual difference is in CI where this fails currently
if(!Arrays.equals(expectedData, actualData)) {
ImageIO.write(imgActual, "PNG", File.createTempFile("TestFontRendering", ".png"));
}
assertTrue("Expected to have matching raster-arrays, but found differences, size " + expectedData.length + " and " + actualData.length,
Arrays.equals(expectedData, actualData));
}