22 lines
953 B
Diff
22 lines
953 B
Diff
--- xmlgraphics/commons/trunk/src/test/java/org/apache/xmlgraphics/image/loader/CorruptImagesTestCase.java 2022/10/06 12:37:37 1904425
|
|
+++ xmlgraphics/commons/trunk/src/test/java/org/apache/xmlgraphics/image/loader/CorruptImagesTestCase.java 2022/11/10 08:15:05 1905215
|
|
@@ -36,9 +36,14 @@
|
|
|
|
ImageSessionContext sessionContext = imageContext.newSessionContext();
|
|
ImageManager manager = imageContext.getImageManager();
|
|
-
|
|
- ImageInfo imageInfo = manager.preloadImage(uri, sessionContext);
|
|
- assertEquals(imageInfo.getMimeType(), "image/png");
|
|
+ try {
|
|
+ ImageInfo imageInfo = manager.preloadImage(uri, sessionContext);
|
|
+ //IOException should continue to raw png
|
|
+ assertEquals(imageInfo.getMimeType(), "image/png");
|
|
+ } catch (Exception e) {
|
|
+ //Otherwise should throw exception
|
|
+ assertEquals(e.getMessage(), "pos < flushedPos!");
|
|
+ }
|
|
}
|
|
|
|
}
|
|
|