Permalink
Browse files

Adjust test to write the failing PNG in case expected and actual do n…

…ot match

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1568740 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 5dcd70d commit 2414998aac03c04da7829b287a7f789e44a43014 @poi-benchmark poi-benchmark committed Feb 16, 2014
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestFontRendering.java
@@ -109,6 +109,11 @@ public void bug55902mixedFontWithChineseCharacters() throws Exception {
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));
}

0 comments on commit 2414998

Please sign in to comment.