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:
authorVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2015-01-16 18:00:47 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:36:29 +0300
commitdf256d265d532446b83e2297f49bb6abb35a1ef5 (patch)
treed56a22a1a8e31677f984ff8c6f273b42ae2a2771 /map/map_tests
parent45ddd3714cd6d108444f27579532ee677e49dfa2 (diff)
Drawing turn-arrows under the navigation route was implemented.
Diffstat (limited to 'map/map_tests')
-rw-r--r--map/map_tests/tracks_tests.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/map/map_tests/tracks_tests.cpp b/map/map_tests/tracks_tests.cpp
index e69de29bb2..6364321d31 100644
--- a/map/map_tests/tracks_tests.cpp
+++ b/map/map_tests/tracks_tests.cpp
@@ -0,0 +1,34 @@
+#include "../../testing/testing.hpp"
+
+#include "../track.hpp"
+
+UNIT_TEST(clipArrowBodyAndGetArrowDirection)
+{
+ vector<m2::PointD> ptsTurn = {m2::PointD(4452766.0004956936, -8008660.158053305),
+ m2::PointD(4452767.909028396, -8008670.0188056063),
+ m2::PointD(4452768.5452059628, -8008681.4700018261),
+ m2::PointD(4452765.6824069088, -8008693.8754644003),
+ m2::PointD(4452759.3206312312, -8008705.6447494039),
+ m2::PointD(4452746.2789910901, -8008720.9130110294),
+ m2::PointD(4452746.2789910901, -8008720.9130110294),
+ m2::PointD(4452670.8919493081, -8008780.7137024049),
+ m2::PointD(4452631.7670288859, -8008811.5683144433),
+ m2::PointD(4452567.5130945379, -8008863.0986974351)};
+ pair<m2::PointD, m2::PointD> arrowDirection;
+ bool result = clipArrowBodyAndGetArrowDirection(ptsTurn, arrowDirection, 5, 13., 13., 19.);
+
+ TEST(result, ());
+
+ TEST(m2::AlmostEqual(arrowDirection.first, m2::PointD(4452740.7948958352, -8008725.2632638067)), ());
+ TEST(m2::AlmostEqual(arrowDirection.second, m2::PointD(4452736.0942427581, -8008728.9920519013)), ());
+
+ TEST_EQUAL(ptsTurn.size(), 4, ());
+ if (ptsTurn.size() == 4)
+ {
+ TEST(m2::AlmostEqual(ptsTurn[0], m2::PointD(4452754.7223071428, -8008711.0281532137)), ());
+ TEST(m2::AlmostEqual(ptsTurn[1], m2::PointD(4452746.2789910901, -8008720.9130110294)), ());
+ TEST(m2::AlmostEqual(ptsTurn[2], m2::PointD(4452746.2789910901, -8008720.9130110294)), ());
+ TEST(m2::AlmostEqual(ptsTurn[3], m2::PointD(4452736.0942427581, -8008728.9920519013)), ());
+ }
+
+}