Skip to content

Commit 21a1545

Browse files
Changed the order of creation of clonedRelation. The way it was, it was not doing/testing anything.
1 parent ec35dd4 commit 21a1545

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2560,22 +2560,23 @@ public void testPtLine(List<Val> expectedValues, int relationId) {
25602560
Relation busRouteRelation = getRelationForId(relationId, allRelations);
25612561

25622562
assertNotNull(busRouteRelation);
2563-
RouteSegmentToExtract segment = new RouteSegmentToExtract(busRouteRelation);
2563+
2564+
Relation clonedRelation = new Relation(busRouteRelation);
2565+
2566+
RouteSegmentToExtract segment = new RouteSegmentToExtract(clonedRelation);
25642567
segment.setActiveDataSet(ds);
25652568

2566-
assertEquals(busRouteRelation.get("ref"), segment.getLineIdentifiersSignature());
2567-
assertEquals(busRouteRelation.get("colour"), segment.getColoursSignature());
2569+
assertEquals(clonedRelation.get("ref"), segment.getLineIdentifiersSignature());
2570+
assertEquals(clonedRelation.get("colour"), segment.getColoursSignature());
25682571

25692572
assertNull(segment.extractToRelation(Collections.emptyList(), false));
25702573

25712574
assertEquals("", segment.getWayIdsSignature());
25722575
assertEquals(Collections.emptyList(), segment.getWayMembers());
2573-
System.out.printf("***** %s *****\n\n ", busRouteRelation.get("name"));
2576+
System.out.printf("***** %s *****\n\n ", clonedRelation.get("name"));
25742577

25752578
RouteSegmentToExtract previousSegment = segment;
25762579

2577-
Relation clonedRelation = new Relation(busRouteRelation);
2578-
25792580
for (Val v: expectedValues) {
25802581
segment = previousSegment.addPTWayMember(v.index);
25812582
if (segment != null) {

0 commit comments

Comments
 (0)