mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-04 20:15:28 -04:00
Made test case more robust when running headless on Windows.
This commit is contained in:
parent
b68848f58f
commit
719b6e7883
@ -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));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user