Hardened test for unsupported types.

This commit is contained in:
Harald Kuhr 2009-10-06 23:05:10 +02:00
parent 608df15066
commit edb1c481d9

View File

@ -1194,11 +1194,14 @@ public abstract class ImageReaderAbstractTestCase<T extends ImageReader> extends
param.setDestination(destination); param.setDestination(destination);
try { 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. // 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. // 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); 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) { catch (IIOException expected) {
// TODO: This is thrown by ImageReader.getDestination. But are we happy with that? // TODO: This is thrown by ImageReader.getDestination. But are we happy with that?