Skip to content

Commit 35a1208

Browse files
boldtrnkarussell
authored andcommitted
Reenable instructions tests (graphhopper#1002)
1 parent a62df36 commit 35a1208

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

core/src/test/java/com/graphhopper/routing/PathTest.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.graphhopper.routing.weighting.ShortestWeighting;
2525
import com.graphhopper.storage.*;
2626
import com.graphhopper.util.*;
27-
import org.junit.Ignore;
2827
import org.junit.Test;
2928

3029
import java.util.*;
@@ -55,8 +54,7 @@ public void testFound() {
5554
g.close();
5655
}
5756

58-
// TODO fix
59-
@Ignore
57+
@Test
6058
public void testWayList() {
6159
GraphHopperStorage g = new GraphBuilder(carManager).create();
6260
NodeAccess na = g.getNodeAccess();
@@ -95,6 +93,9 @@ public void testWayList() {
9593

9694
// force minor change for instructions
9795
edge2.setName("2");
96+
na.setNode(3, 1.0, 1.0);
97+
EdgeIteratorState edge3 = g.edge(1, 3).setDistance(1000).setFlags(encoder.setProperties(10, true, true));
98+
9899
path = new Path(g, new FastestWeighting(encoder));
99100
e1 = new SPTEntry(edge2.getEdge(), 2, 1);
100101
e1.parent = new SPTEntry(edge1.getEdge(), 1, 1);
@@ -145,8 +146,7 @@ public void testWayList() {
145146
assertEquals(path.calcPoints().size() - 1, lastIndex);
146147
}
147148

148-
// TODO
149-
@Ignore
149+
@Test
150150
public void testFindInstruction() {
151151
Graph g = new GraphBuilder(carManager).create();
152152
NodeAccess na = g.getNodeAccess();
@@ -155,6 +155,8 @@ public void testFindInstruction() {
155155
na.setNode(2, 5.0, 0.5);
156156
na.setNode(3, 10.0, 0.5);
157157
na.setNode(4, 7.5, 0.25);
158+
na.setNode(5, 5.0, 1.0);
159+
158160

159161
EdgeIteratorState edge1 = g.edge(0, 1).setDistance(1000).setFlags(encoder.setProperties(50, true, true));
160162
edge1.setWayGeometry(Helper.createPointList());
@@ -169,6 +171,10 @@ public void testFindInstruction() {
169171
edge4.setWayGeometry(Helper.createPointList());
170172
edge4.setName("Street 4");
171173

174+
g.edge(1, 5).setDistance(10000).setFlags(encoder.setProperties(50, true, true));
175+
g.edge(2, 5).setDistance(10000).setFlags(encoder.setProperties(50, true, true));
176+
g.edge(3, 5).setDistance(100000).setFlags(encoder.setProperties(50, true, true));
177+
172178
Path path = new Path(g, new FastestWeighting(encoder));
173179
SPTEntry e1 = new SPTEntry(edge4.getEdge(), 4, 1);
174180
e1.parent = new SPTEntry(edge3.getEdge(), 3, 1);

0 commit comments

Comments
 (0)