poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1568740 - /poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestFontRendering.java
Date Sun, 16 Feb 2014 08:39:17 GMT
Author: centic
Date: Sun Feb 16 08:39:17 2014
New Revision: 1568740

URL: http://svn.apache.org/r1568740
Log:
Adjust test to write the failing PNG in case expected and actual do not match

Modified:
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestFontRendering.java

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestFontRendering.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestFontRendering.java?rev=1568740&r1=1568739&r2=1568740&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestFontRendering.java
(original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestFontRendering.java
Sun Feb 16 08:39:17 2014
@@ -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));
     }



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


Mime
View raw message