This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit a5257c71059ba9eb602da4c8b46f2daeedc1e04b
Author: Martin Desruisseaux <martin.desruisse...@geomatys.com>
AuthorDate: Mon Feb 21 12:02:57 2022 +0100

    Avoid a random test failure.
---
 .../src/test/java/org/apache/sis/test/storage/SubsampledImage.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/storage/sis-storage/src/test/java/org/apache/sis/test/storage/SubsampledImage.java
 
b/storage/sis-storage/src/test/java/org/apache/sis/test/storage/SubsampledImage.java
index fa4af0b..bf4a6f4 100644
--- 
a/storage/sis-storage/src/test/java/org/apache/sis/test/storage/SubsampledImage.java
+++ 
b/storage/sis-storage/src/test/java/org/apache/sis/test/storage/SubsampledImage.java
@@ -26,6 +26,7 @@ import java.awt.image.PixelInterleavedSampleModel;
 import java.awt.image.RenderedImage;
 import java.awt.image.SampleModel;
 import org.apache.sis.image.PlanarImage;
+import org.apache.sis.internal.util.Strings;
 
 import static java.lang.StrictMath.floorDiv;
 import static org.junit.Assert.*;
@@ -43,7 +44,7 @@ import static org.junit.Assert.*;
  * </ul>
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 1.1
+ * @version 1.2
  * @since   1.1
  * @module
  */
@@ -196,7 +197,9 @@ final class SubsampledImage extends PlanarImage {
             }
             final String warning = image.verify();
             if (warning != null && (source instanceof PlanarImage)) {
-                assertEquals(((PlanarImage) source).verify(), warning);
+                // Source warning may be "source.height", which we replace by 
"height".
+                final String s = Strings.orEmpty(((PlanarImage) 
source).verify());
+                assertEquals(s, s.substring(s.lastIndexOf('.') + 1), warning);
             }
             return image;
         }

Reply via email to