Changeset 18183 in josm for trunk/test/unit


Ignore:
Timestamp:
2021-08-30T18:44:20+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #21254 - fix shoe lace formula implementation (patch by taylor.smock)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/GeometryTest.java

    r17867 r18183  
    66import static org.junit.jupiter.api.Assertions.assertThrows;
    77import static org.junit.jupiter.api.Assertions.assertTrue;
    8 
    98
    109import java.awt.geom.Area;
     
    139138    }
    140139
     140    /**
     141     * This checks that the area is properly calculated
     142     */
     143    @Test
     144    void testNonRegression20971And21254() {
     145        assertEquals(15.0, Geometry.calculateSurveyorsArea(new int[]{1507, 1509, 1509}, new int[]{3029, 3018, 3033}));
     146        assertEquals(0.0, Geometry.calculateSurveyorsArea(new int[]{0, 0, 0}, new int[]{0, 0, 0}));
     147        assertEquals(0.0, Geometry.calculateSurveyorsArea(new int[2], new int[2]));
     148        assertThrows(IllegalArgumentException.class, () -> Geometry.calculateSurveyorsArea(new int[3], new int[4]));
     149    }
     150
    141151    @Test
    142152    void testMultiPolygon() {
Note: See TracChangeset for help on using the changeset viewer.