Ticket #23255: 23255.patch

File 23255.patch, 3.9 KB (added by marcello@…, 2 years ago)

This patch corrects the mapcss for the tests to match the fonts used in the images.

  • test/data/renderer/eval/style.mapcss

    diff --git a/test/data/renderer/eval/style.mapcss b/test/data/renderer/eval/style.mapcss
    index 287830287..4abbc72a0 100644
    a b  
    11* {
     2        font-family: "DejaVu Sans";
    23    font-size: 20;
    34}
    45
    node[test=2] {  
    2223
    2324node[test=3] {
    2425    lst: 12, 3, 6;
    25     tmp: list(get(prop("lst"), 1), get(prop("lst"), 0), get(prop("lst"), 2), length(prop("lst")));
     26    tmp: list(get(prop("lst"), 1), get(prop("lst"), 0), get(prop("lst"), 2), count(prop("lst")));
    2627    value: concat("", prop("tmp"));
    2728    result: "[3.0, 12.0, 6.0, 3]";
    2829}
    node[test=4] {  
    3536node[test] {
    3637    text: concat("Test ", tag("test"), ": ", prop(result), " == ", prop(value));
    3738}
    38 
  • test/data/renderer/node-text2/style.mapcss

    diff --git a/test/data/renderer/node-text2/style.mapcss b/test/data/renderer/node-text2/style.mapcss
    index cb17205c8..d474955a7 100644
    a b  
    33 * Text placement test
    44 */
    55node[test=text-placement]::* {
     6        font-family: "DejaVu Sans";
    67    font-size: 10;
    78    text: auto;
    89    symbol-shape: square;
  • test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java

    diff --git a/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java b/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java
    index 58177f778..2952a98ab 100644
    a b public class MapCSSRendererTest {  
    101101                        .setThresholdPixels(0).setThresholdTotalColorDiff(0),
    102102
    103103                /** Tests area label drawing/placement */
    104                 new TestConfig("area-text", AREA_DEFAULT)
     104                new TestConfig("area-text", AREA_DEFAULT).usesFont("DejaVu Sans")
    105105                        .setThresholdPixels(0).setThresholdTotalColorDiff(0),
    106106
    107107                /** Tests area icon drawing/placement */
    public class MapCSSRendererTest {  
    120120                        .setThresholdPixels(0).setThresholdTotalColorDiff(0),
    121121
    122122                /** Tests text along a way */
    123                 new TestConfig("way-text", AREA_DEFAULT)
     123                new TestConfig("way-text", AREA_DEFAULT).usesFont("DejaVu Sans")
    124124                        .setThresholdPixels(3400).setThresholdTotalColorDiff(0),
    125125
    126126                /** Another test for node shapes */
    public class MapCSSRendererTest {  
    136136                new TestConfig("way-dashes2")
    137137                        .setThresholdPixels(0).setThresholdTotalColorDiff(0),
    138138                /** Tests node text placement */
    139                 new TestConfig("node-text2")
     139                new TestConfig("node-text2").usesFont("DejaVu Sans")
    140140                        .setThresholdPixels(1020).setThresholdTotalColorDiff(0),
    141141                /** Tests relation link selector */
    142142                new TestConfig("relation-linkselector")
    public class MapCSSRendererTest {  
    146146                        .setThresholdPixels(0).setThresholdTotalColorDiff(0),
    147147
    148148                /** Tests evaluation of expressions */
    149                 new TestConfig("eval").setImageWidth(600)
     149                new TestConfig("eval").setImageWidth(600).usesFont("DejaVu Sans")
    150150                        .setThresholdPixels(6610).setThresholdTotalColorDiff(0)
    151151
    152152                ).map(e -> new Object[] {e, e.testDirectory})
    public class MapCSSRendererTest {  
    227227            return;
    228228        }
    229229        final BufferedImage reference = ImageIO.read(referenceImageFile);
    230         assertEquals(image.getWidth(), reference.getWidth());
    231         assertEquals(image.getHeight(), reference.getHeight());
     230        assertEquals(reference.getWidth(), image.getWidth());
     231        assertEquals(reference.getHeight(), image.getHeight());
    232232
    233233        StringBuilder differences = new StringBuilder();
    234234        ArrayList<Point> differencePoints = new ArrayList<>();