sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] branch geoapi-4.0 updated: Make conditional an assertion that may become invalid under JDK 16. https://bugs.openjdk.java.net/browse/JDK-8166038
Date Thu, 10 Sep 2020 21:51:48 GMT
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


The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
     new 0b29f05  Make conditional an assertion that may become invalid under JDK 16. https://bugs.openjdk.java.net/browse/JDK-8166038
0b29f05 is described below

commit 0b29f057242a883214697571d5d0fb9304cc087b
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Thu Sep 10 23:44:17 2020 +0200

    Make conditional an assertion that may become invalid under JDK 16.
    https://bugs.openjdk.java.net/browse/JDK-8166038
---
 .../sis/internal/storage/query/CoverageQueryTest.java    | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/query/CoverageQueryTest.java
b/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/query/CoverageQueryTest.java
index a02d6b4..16362b0 100644
--- a/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/query/CoverageQueryTest.java
+++ b/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/query/CoverageQueryTest.java
@@ -64,8 +64,8 @@ public final strictfp class CoverageQueryTest extends TestCase {
     public CoverageQueryTest() {
         crs = HardCodedCRS.WGS84;
         gridToCRS = new AffineTransform2D(2, 0, 0, 3, 0, 0);
-        final int width  = 50;
-        final int height = 53;
+        final int width  = 32;
+        final int height = 37;
         final GridGeometry grid = new GridGeometry(new GridExtent(width, height), PixelInCell.CELL_CENTER,
gridToCRS, crs);
         final BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_BINARY);
         resource = new MemoryGridResource(null, new GridCoverage2D(grid, null, image));
@@ -133,13 +133,17 @@ public final strictfp class CoverageQueryTest extends TestCase {
      * Verifies that the read operation adds the expected margins.
      * This is an anti-regression test; in current implementation,
      * {@link GridCoverage2D} returns a larger area then requested.
-     *
-     * @todo May need to be revisited after https://bugs.openjdk.java.net/browse/JDK-8166038
is fixed.
      */
     private void verifyRead(final GridCoverageResource subset) throws DataStoreException
{
         final GridGeometry request  = createSubGrid(-4);
         final GridCoverage coverage = subset.read(request);
-        final GridGeometry expected = resource.getGridGeometry();
-        assertEquals(expected, coverage.getGridGeometry());
+        /*
+         * PENDING_JDK_FIX: replace following lines by new tests
+         * after https://bugs.openjdk.java.net/browse/JDK-8166038 is fixed.
+         */
+        if (coverage.render(null) instanceof BufferedImage) {
+            final GridGeometry expected = resource.getGridGeometry();
+            assertEquals(expected, coverage.getGridGeometry());
+        }
     }
 }


Mime
View raw message