Fix tests

This commit is contained in:
Victor Shcherb 2016-08-13 18:35:03 +02:00
parent 8b4c9754e3
commit 5103a5a4c1
2 changed files with 5 additions and 5 deletions

View file

@ -219,7 +219,7 @@ public class BinaryRoutePlanner {
segment = loadSameSegment(ctx, segment, 1);
// } else if (segment.getSegmentStart() == segment.getRoad().getPointsLength() - 1 && positiveDirection && segment.getSegmentStart() > 0) {
// assymetric cause we calculate initial point differently (segmentStart means that point is between ]segmentStart-1, segmentStart]
} else if (segment.getSegmentStart() > 0 && positiveDirection && segment.getSegmentStart() > 0) {
} else if (segment.getSegmentStart() > 0 && positiveDirection) {
segment = loadSameSegment(ctx, segment, segment.getSegmentStart() - 1);
}
if (segment == null) {
@ -727,12 +727,13 @@ public class BinaryRoutePlanner {
.getPoint31YTile(segmentPoint), targetEndX, targetEndY);
// Calculate possible ways to put into priority queue
RouteSegment next = inputNext;
boolean hasNext = nextIterator == null || nextIterator.hasNext();
boolean hasNext = nextIterator != null ? nextIterator.hasNext() : next != null;
while (hasNext) {
if (nextIterator != null) {
next = nextIterator.next();
}
if (next.getSegmentStart() == segmentPoint && next.getRoad().getId() == segment.getRoad().id) {
if (next.getSegmentStart() == segmentPoint &&
next.getRoad().getId() == segment.getRoad().id) {
// find segment itself
// (and process it as other with small exception that we don't add to graph segments and process immediately)
itself = next.initRouteSegment(segment.isPositive());

View file

@ -86,7 +86,6 @@ public class RouteResultPreparationTest {
@Test
public void testLanes() throws Exception {
List<RouteSegmentResult> routeSegments = fe.searchRoute(ctx, startPoint, endPoint, null);
Set<Long> reachedSegments = new TreeSet<Long>();
Assert.assertNotNull(routeSegments);