Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLev Dragunov <l.dragunov@corp.mail.ru>2015-08-11 18:22:57 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 03:01:44 +0300
commit839a59484b4e5c8dc7a618c09157945c9e82c1c9 (patch)
tree0a5c22bf37c520e889b74aa08c4556472db93daa /integration_tests
parentb8bf432fbd1b45707e70fc8dcdf896d039a73f54 (diff)
Remove TurnsGeom structure.
Diffstat (limited to 'integration_tests')
-rw-r--r--integration_tests/routing_test_tools.cpp32
-rw-r--r--integration_tests/routing_test_tools.hpp7
2 files changed, 3 insertions, 36 deletions
diff --git a/integration_tests/routing_test_tools.cpp b/integration_tests/routing_test_tools.cpp
index fd162231dd..27f439af23 100644
--- a/integration_tests/routing_test_tools.cpp
+++ b/integration_tests/routing_test_tools.cpp
@@ -210,7 +210,7 @@ namespace integration
void TestTurnCount(routing::Route const & route, uint32_t expectedTurnCount)
{
- TEST_EQUAL(route.GetTurnsGeometry().size(), expectedTurnCount, ());
+ TEST_EQUAL(route.GetTurns().size(), expectedTurnCount, ());
}
void TestRouteLength(Route const & route, double expectedRouteMeters,
@@ -283,40 +283,12 @@ namespace integration
TestTurn GetNthTurn(routing::Route const & route, uint32_t turnNumber)
{
- turns::TTurnsGeom const & turnsGeom = route.GetTurnsGeometry();
- if (turnNumber >= turnsGeom.size())
- return TestTurn();
-
Route::TTurns const & turns = route.GetTurns();
if (turnNumber >= turns.size())
return TestTurn();
- turns::TurnGeom const & turnGeom = turnsGeom[turnNumber];
- ASSERT_LESS(turnGeom.m_turnIndex, turnGeom.m_points.size(), ());
TurnItem const & turn = turns[turnNumber];
- return TestTurn(turnGeom.m_points[turnGeom.m_turnIndex], turn.m_turn, turn.m_exitNum);
- }
-
- TestTurn GetTurnByPoint(routing::Route const & route, m2::PointD const & approximateTurnPoint,
- double inaccuracyMeters)
- {
- turns::TTurnsGeom const & turnsGeom = route.GetTurnsGeometry();
- Route::TTurns const & turns = route.GetTurns();
- ASSERT_EQUAL(turnsGeom.size() + 1, turns.size(), ());
-
- for (int i = 0; i != turnsGeom.size(); ++i)
- {
- turns::TurnGeom const & turnGeom = turnsGeom[i];
- ASSERT_LESS(turnGeom.m_turnIndex, turnGeom.m_points.size(), ());
- m2::PointD const turnPoint = turnGeom.m_points[turnGeom.m_turnIndex];
- if (ms::DistanceOnEarth(turnPoint.y, turnPoint.x, approximateTurnPoint.y, approximateTurnPoint.x) <=
- inaccuracyMeters)
- {
- TurnItem const & turn = turns[i];
- return TestTurn(turnPoint, turn.m_turn, turn.m_exitNum);
- }
- }
- return TestTurn();
+ return TestTurn(route.GetPoly().GetPoint(turn.m_index), turn.m_turn, turn.m_exitNum);
}
void TestOnlineFetcher(ms::LatLon const & startPoint, ms::LatLon const & finalPoint,
diff --git a/integration_tests/routing_test_tools.hpp b/integration_tests/routing_test_tools.hpp
index 1d06df12f6..3e12db4840 100644
--- a/integration_tests/routing_test_tools.hpp
+++ b/integration_tests/routing_test_tools.hpp
@@ -22,8 +22,7 @@
* 2. Loading maps and calculating routes is a time consumption process.
* Do this only if you really need it.
* 3. If you want to check that a turn is absent you have two options
- * - use GetTurnByPoint(...).TestNotValid();
- * - or use TestTurnCount.
+ * - use TestTurnCount.
* 4. The easiest way to gather all the information for writing an integration test is
* - to put a break point in OsrmRouter::CalculateRouteImpl;
* - to make a route with MapWithMe desktop application;
@@ -83,8 +82,6 @@ namespace integration
class TestTurn
{
friend TestTurn GetNthTurn(Route const & route, uint32_t turnNumber);
- friend TestTurn GetTurnByPoint(Route const & route, m2::PointD const & approximateTurnPoint,
- double inaccuracy);
m2::PointD const m_point;
TurnDirection const m_direction;
@@ -118,6 +115,4 @@ namespace integration
/// Extracting appropriate TestTurn if any. If not TestTurn::isValid() returns false.
/// inaccuracy is set in meters.
TestTurn GetNthTurn(Route const & route, uint32_t turnNumber);
- TestTurn GetTurnByPoint(Route const & route, m2::PointD const & approximateTurnPoint,
- double inaccuracyMeters = 3.);
}