Made test case more robust when running headless on Windows.
@@ -540,7 +540,7 @@ public abstract class ImageReaderAbstractTest<T extends ImageReader> {
}
}
- protected final void assertImageDataEquals(String message, BufferedImage expected, BufferedImage actual) {
+ public static void assertImageDataEquals(String message, BufferedImage expected, BufferedImage actual) {
assertNotNull("Expected image was null", expected);
assertNotNull("Actual image was null!", actual);
@@ -1550,15 +1550,8 @@ public abstract class ImageReaderAbstractTest<T extends ImageReader> {
assertNotSame("Multiple reads return same (mutable) image", one, two);
- Graphics2D g = one.createGraphics();
- try {
- g.setColor(Color.WHITE);
- g.setXORMode(Color.BLACK);
- g.fillRect(0, 0, one.getWidth(), one.getHeight());
- }
- finally {
- g.dispose();
- }
+ one.setRGB(0, 0, Color.BLUE.getRGB());
+ two.setRGB(0, 0, Color.RED.getRGB());
assertTrue(one.getRGB(0, 0) != two.getRGB(0, 0));
}
