mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-05 12:35:29 -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("Expected image was null", expected);
|
||||||
assertNotNull("Actual image was null!", actual);
|
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);
|
assertNotSame("Multiple reads return same (mutable) image", one, two);
|
||||||
|
|
||||||
Graphics2D g = one.createGraphics();
|
one.setRGB(0, 0, Color.BLUE.getRGB());
|
||||||
try {
|
two.setRGB(0, 0, Color.RED.getRGB());
|
||||||
g.setColor(Color.WHITE);
|
|
||||||
g.setXORMode(Color.BLACK);
|
|
||||||
g.fillRect(0, 0, one.getWidth(), one.getHeight());
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
g.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
assertTrue(one.getRGB(0, 0) != two.getRGB(0, 0));
|
assertTrue(one.getRGB(0, 0) != two.getRGB(0, 0));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user