From edb1c481d955d7bdaa75ead0ec68ef70b45736e5 Mon Sep 17 00:00:00 2001 From: Harald Kuhr Date: Tue, 6 Oct 2009 23:05:10 +0200 Subject: [PATCH] Hardened test for unsupported types. --- .../imageio/util/ImageReaderAbstractTestCase.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/twelvemonkeys-imageio/core/src/test/java/com/twelvemonkeys/imageio/util/ImageReaderAbstractTestCase.java b/twelvemonkeys-imageio/core/src/test/java/com/twelvemonkeys/imageio/util/ImageReaderAbstractTestCase.java index 776c768d..fd6dd848 100644 --- a/twelvemonkeys-imageio/core/src/test/java/com/twelvemonkeys/imageio/util/ImageReaderAbstractTestCase.java +++ b/twelvemonkeys-imageio/core/src/test/java/com/twelvemonkeys/imageio/util/ImageReaderAbstractTestCase.java @@ -1194,11 +1194,14 @@ public abstract class ImageReaderAbstractTestCase extends param.setDestination(destination); try { - reader.read(0, param); + BufferedImage result = reader.read(0, param); // NOTE: We allow the reader to read, as it's inconvenient to test all possible cases. // However, it may NOT fail with any other exception in that case. System.err.println("WARNING: Reader does not throw exception with non-declared destination: " + destination); + + // Test that the destination is really taken into account + assertSame(destination, result); } catch (IIOException expected) { // TODO: This is thrown by ImageReader.getDestination. But are we happy with that?