Skip to content

Commit

Permalink
fix: adapt tests to reflect reduced split nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
hbruch committed Jul 25, 2024
1 parent cc03edb commit 911d9df
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ void linkFlexStop() {
SplitterVertex walkSplit = (SplitterVertex) linkToWalk.getToVertex();

assertTrue(walkSplit.isConnectedToWalkingEdge());
assertFalse(walkSplit.isConnectedToDriveableEdge());

var linkToCar = model.outgoingLinks().getLast();
SplitterVertex carSplit = (SplitterVertex) linkToCar.getToVertex();

assertFalse(carSplit.isConnectedToWalkingEdge());
assertTrue(carSplit.isConnectedToDriveableEdge());
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void unconnectedCarParkAndRide() {
int nParkAndRideEdge = gg.getEdgesOfType(VehicleParkingEdge.class).size();

assertEquals(12, nParkAndRide);
assertEquals(38, nParkAndRideLink);
assertEquals(30, nParkAndRideLink);
assertEquals(42, nParkAndRideEdge);
}

Expand All @@ -66,7 +66,7 @@ public void unconnectedBikeParkAndRide() {
int nParkAndRideEdge = gg.getEdgesOfType(VehicleParkingEdge.class).size();

assertEquals(13, nParkAndRideEntrances);
assertEquals(32, nParkAndRideLink);
assertEquals(26, nParkAndRideLink);
assertEquals(33, nParkAndRideEdge);
}

Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/opentripplanner/routing/TestHalfEdges.java
Original file line number Diff line number Diff line change
Expand Up @@ -675,16 +675,16 @@ public void testNetworkLinker() {
int numVerticesBefore = graph.getVertices().size();
TestStreetLinkerModule.link(graph, transitModel);
int numVerticesAfter = graph.getVertices().size();
assertEquals(4, numVerticesAfter - numVerticesBefore);
assertEquals(2, numVerticesAfter - numVerticesBefore);
Collection<Edge> outgoing = station1.getOutgoing();
assertEquals(2, outgoing.size());
assertEquals(1, outgoing.size());
Edge edge = outgoing.iterator().next();

Vertex midpoint = edge.getToVertex();
assertTrue(Math.abs(midpoint.getCoordinate().y - 40.01) < 0.00000001);

outgoing = station2.getOutgoing();
assertEquals(2, outgoing.size());
assertEquals(1, outgoing.size());
edge = outgoing.iterator().next();

Vertex station2point = edge.getToVertex();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ public void testLinkStopOutsideArea() {
LOG.debug("Edge {}", e);
}

// Two bottom edges gets split into half (+2 edges)
// both split points are linked to the stop bidirectonally (+4 edges).
// both split points also link to 2 visibility points at opposite side (+8 edges)
// 14 new edges in total
assertEquals(22, graph.getEdges().size());
// Two bottom edges gets split into half (+2 edges) by one (reused) split vertex
// the split point is linked to the stop bidirectonally (+2 edges).
// the split point also links to 2 visibility points at opposite side (+4 edges)
// 8 new edges in total
assertEquals(16, graph.getEdges().size());
}

/**
Expand Down

0 comments on commit 911d9df

Please sign in to comment.