Changeset 13194 in josm for trunk/test/unit/org


Ignore:
Timestamp:
2017-12-05T00:58:56+01:00 (7 years ago)
Author:
Don-vip
Message:

fix #15634 - add robustness against invalid GPX files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/io/GpxReaderTest.java

    r12184 r13194  
    1313
    1414import org.junit.Test;
     15import org.openstreetmap.josm.TestUtils;
     16import org.openstreetmap.josm.data.Bounds;
    1517import org.openstreetmap.josm.data.coor.LatLon;
    1618import org.openstreetmap.josm.data.gpx.GpxData;
     
    6466        new GpxReader(new ByteArrayInputStream("--foo--bar--".getBytes(StandardCharsets.UTF_8))).parse(true);
    6567    }
     68
     69    /**
     70     * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/15634">#15634</a>
     71     * @throws IOException if an error occurs during reading
     72     * @throws SAXException if any XML error occurs
     73     */
     74    @Test
     75    public void testTicket15634() throws IOException, SAXException {
     76        assertEquals(new Bounds(53.7229357, -7.9135019, 53.9301103, -7.59656),
     77                GpxReaderTest.parseGpxData(TestUtils.getRegressionDataFile(15634, "drumlish.gpx")).getMetaBounds());
     78    }
    6679}
Note: See TracChangeset for help on using the changeset viewer.