Changeset 15852 in josm for trunk/test/unit


Ignore:
Timestamp:
2020-02-15T11:15:05+01:00 (5 years ago)
Author:
GerdP
Message:

fix #10511: Joining complex areas produces exception

  • detect case where a single closed way contains the same segment twice or more and fix the "inside" flag
  • enable and correct unit test (it "destroyed" preferences.xml)
  • init cmdsCount to prevent corrupted undo/redo stacks after a "Join areas internal error."
  • make sure that a single command is placed on the undo/redo stack in case of successfull execution. The old code sometimes created two, the latter one "Move tags from ways to relations". I found no good reason for that.
  • Try to clean up undo/redo stack if user cancelled operation in 2nd popup asking about relations. Still a dirty hack but a less dangerous one.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java

    r15034 r15852  
    1515import java.util.Set;
    1616
    17 import org.junit.Ignore;
    1817import org.junit.Rule;
    1918import org.junit.Test;
     
    5049    @Rule
    5150    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    52     public JOSMTestRules test = new JOSMTestRules().main().projection();
     51    public JOSMTestRules test = new JOSMTestRules().main().projection().preferences();
    5352
    5453    /**
     
    5857     */
    5958    @Test
    60     @Ignore("disable this test, needs further working") // XXX
    6159    public void testTicket10511() throws IOException, IllegalDataException {
    6260        try (InputStream is = TestUtils.getRegressionDataStream(10511, "10511_mini.osm")) {
     
    6664            try {
    6765                new JoinAreasAction(false).join(ds.getWays());
     66                Collection<IPrimitive> found = SearchAction.searchAndReturn("type:way", SearchMode.replace);
     67                assertEquals(1, found.size());
    6868            } finally {
    6969                // Ensure we clean the place before leaving, even if test fails.
Note: See TracChangeset for help on using the changeset viewer.