Index: trunk/test/unit/org/openstreetmap/josm/io/GpxReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/GpxReaderTest.java	(revision 18816)
+++ trunk/test/unit/org/openstreetmap/josm/io/GpxReaderTest.java	(revision 18817)
@@ -5,4 +5,5 @@
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import java.io.ByteArrayInputStream;
@@ -14,4 +15,6 @@
 import java.util.Map;
 
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.Bounds;
@@ -82,8 +85,7 @@
     /**
      * Tests invalid data.
-     * @throws Exception always SAXException
      */
     @Test
-    void testException() throws Exception {
+    void testException() {
         assertThrows(SAXException.class,
                 () -> new GpxReader(new ByteArrayInputStream("--foo--bar--".getBytes(StandardCharsets.UTF_8))).parse(true));
@@ -100,3 +102,20 @@
                 GpxReaderTest.parseGpxData(TestUtils.getRegressionDataFile(15634, "drumlish.gpx")).getMetaBounds());
     }
+
+    @ParameterizedTest
+    @ValueSource(strings = {
+            "<gpx><wpt></wpt></gpx>",
+    })
+    void testIncompleteLocations(String gpx) {
+        SAXException saxException = assertThrows(SAXException.class,
+                () -> new GpxReader(new ByteArrayInputStream(gpx.getBytes(StandardCharsets.UTF_8))).parse(true));
+        final String type;
+        if ("<wpt>".regionMatches(0, gpx, 5, 4)) {
+            type = "wpt";
+        } else {
+            fail("You need to add code to tell us what the exception for \"" + gpx + "\" should be");
+            type = null;
+        }
+        assertEquals(type + " element does not have valid latitude and/or longitude.", saxException.getMessage());
+    }
 }
