Changeset 19220 in josm for trunk/test/functional


Ignore:
Timestamp:
2024-09-11T21:33:23+02:00 (5 months ago)
Author:
taylor.smock
Message:

See #11487: Have josm render data to tiles

Start adding basic rendering tests for tiled rendering.
Right now, the test only looks at a point in the center of the tile; there seems
to be some positioning/stretching issues at the edges that I need to debug and
fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java

    r19056 r19220  
    222222        }
    223223        final BufferedImage reference = ImageIO.read(referenceImageFile);
     224        assertImageEquals(testIdentifier, reference, image, thresholdPixels, thresholdTotalColorDiff, diffImageConsumer);
     225    }
     226
     227    /**
     228     * Compares the reference image file with the actual images given as {@link BufferedImage}.
     229     * @param testIdentifier a test identifier for error messages
     230     * @param reference the reference image
     231     * @param image the actual image
     232     * @param thresholdPixels maximum number of differing pixels
     233     * @param thresholdTotalColorDiff maximum sum of color value differences
     234     * @param diffImageConsumer a consumer for a rendered image highlighting the differing pixels, may be null
     235     */
     236    public static void assertImageEquals(String testIdentifier, BufferedImage reference, BufferedImage image,
     237                                         int thresholdPixels, int thresholdTotalColorDiff, Consumer<BufferedImage> diffImageConsumer) {
    224238        assertEquals(reference.getWidth(), image.getWidth());
    225239        assertEquals(reference.getHeight(), image.getHeight());
Note: See TracChangeset for help on using the changeset viewer.