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>2016-06-28 13:52:59 +0300
committerVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2016-07-23 10:25:10 +0300
commit7de86381e97a0606dd7db6dcba600178d9095202 (patch)
tree02ee1e5fedd2a3ae4a8e773b7b43db575c717ac7 /routing/routing_tests/road_graph_nearest_edges_test.cpp
parentbd69eb97cb4e577f95e10e4a594b2ab4266772a5 (diff)
Adding point altitude to Junction. Using Junction instead of m2::PointD in RoadInfo.
Diffstat (limited to 'routing/routing_tests/road_graph_nearest_edges_test.cpp')
-rw-r--r--routing/routing_tests/road_graph_nearest_edges_test.cpp46
1 files changed, 27 insertions, 19 deletions
diff --git a/routing/routing_tests/road_graph_nearest_edges_test.cpp b/routing/routing_tests/road_graph_nearest_edges_test.cpp
index e1f3424acf..757c7623ea 100644
--- a/routing/routing_tests/road_graph_nearest_edges_test.cpp
+++ b/routing/routing_tests/road_graph_nearest_edges_test.cpp
@@ -30,20 +30,20 @@ UNIT_TEST(RoadGraph_NearestEdges)
RoadGraphMockSource graph;
{
IRoadGraph::RoadInfo ri0;
- ri0.m_points.emplace_back(-2, 0);
- ri0.m_points.emplace_back(-1, 0);
- ri0.m_points.emplace_back(0, 0);
- ri0.m_points.emplace_back(1, 0);
- ri0.m_points.emplace_back(2, 0);
+ ri0.m_junctions.push_back(MakeJunctionForTesting(m2::PointD(-2, 0)));
+ ri0.m_junctions.push_back(MakeJunctionForTesting(m2::PointD(-1, 0)));
+ ri0.m_junctions.push_back(MakeJunctionForTesting(m2::PointD(0, 0)));
+ ri0.m_junctions.push_back(MakeJunctionForTesting(m2::PointD(1, 0)));
+ ri0.m_junctions.push_back(MakeJunctionForTesting(m2::PointD(2, 0)));
ri0.m_speedKMPH = 5;
ri0.m_bidirectional = true;
IRoadGraph::RoadInfo ri1;
- ri1.m_points.emplace_back(0, -2);
- ri1.m_points.emplace_back(0, -1);
- ri1.m_points.emplace_back(0, 0);
- ri1.m_points.emplace_back(0, 1);
- ri1.m_points.emplace_back(0, 2);
+ ri1.m_junctions.push_back(MakeJunctionForTesting(m2::PointD(0, -2)));
+ ri1.m_junctions.push_back(MakeJunctionForTesting(m2::PointD(0, -1)));
+ ri1.m_junctions.push_back(MakeJunctionForTesting(m2::PointD(0, 0)));
+ ri1.m_junctions.push_back(MakeJunctionForTesting(m2::PointD(0, 1)));
+ ri1.m_junctions.push_back(MakeJunctionForTesting(m2::PointD(0, 2)));
ri1.m_speedKMPH = 5;
ri1.m_bidirectional = true;
@@ -52,25 +52,33 @@ UNIT_TEST(RoadGraph_NearestEdges)
}
// We are standing at x junction.
- Junction const crossPos(m2::PointD(0, 0));
+ Junction const crossPos = MakeJunctionForTesting(m2::PointD(0, 0));
// Expected outgoing edges.
IRoadGraph::TEdgeVector expectedOutgoing =
{
- Edge(MakeTestFeatureID(0) /* first road */, false /* forward */, 1 /* segId */, m2::PointD(0, 0), m2::PointD(-1, 0)),
- Edge(MakeTestFeatureID(0) /* first road */, true /* forward */, 2 /* segId */, m2::PointD(0, 0), m2::PointD(1, 0)),
- Edge(MakeTestFeatureID(1) /* second road */, false /* forward */, 1 /* segId */, m2::PointD(0, 0), m2::PointD(0, -1)),
- Edge(MakeTestFeatureID(1) /* second road */, true /* forward */, 2 /* segId */, m2::PointD(0, 0), m2::PointD(0, 1)),
+ Edge(MakeTestFeatureID(0) /* first road */, false /* forward */, 1 /* segId */,
+ MakeJunctionForTesting(m2::PointD(0, 0)), MakeJunctionForTesting(m2::PointD(-1, 0))),
+ Edge(MakeTestFeatureID(0) /* first road */, true /* forward */, 2 /* segId */,
+ MakeJunctionForTesting(m2::PointD(0, 0)), MakeJunctionForTesting(m2::PointD(1, 0))),
+ Edge(MakeTestFeatureID(1) /* second road */, false /* forward */, 1 /* segId */,
+ MakeJunctionForTesting(m2::PointD(0, 0)), MakeJunctionForTesting(m2::PointD(0, -1))),
+ Edge(MakeTestFeatureID(1) /* second road */, true /* forward */, 2 /* segId */,
+ MakeJunctionForTesting(m2::PointD(0, 0)), MakeJunctionForTesting(m2::PointD(0, 1))),
};
sort(expectedOutgoing.begin(), expectedOutgoing.end());
// Expected ingoing edges.
IRoadGraph::TEdgeVector expectedIngoing =
{
- Edge(MakeTestFeatureID(0) /* first road */, true /* forward */, 1 /* segId */, m2::PointD(-1, 0), m2::PointD(0, 0)),
- Edge(MakeTestFeatureID(0) /* first road */, false /* forward */, 2 /* segId */, m2::PointD(1, 0), m2::PointD(0, 0)),
- Edge(MakeTestFeatureID(1) /* second road */, true /* forward */, 1 /* segId */, m2::PointD(0, -1), m2::PointD(0, 0)),
- Edge(MakeTestFeatureID(1) /* second road */, false /* forward */, 2 /* segId */, m2::PointD(0, 1), m2::PointD(0, 0)),
+ Edge(MakeTestFeatureID(0) /* first road */, true /* forward */, 1 /* segId */,
+ MakeJunctionForTesting(m2::PointD(-1, 0)), MakeJunctionForTesting(m2::PointD(0, 0))),
+ Edge(MakeTestFeatureID(0) /* first road */, false /* forward */, 2 /* segId */,
+ MakeJunctionForTesting(m2::PointD(1, 0)), MakeJunctionForTesting(m2::PointD(0, 0))),
+ Edge(MakeTestFeatureID(1) /* second road */, true /* forward */, 1 /* segId */,
+ MakeJunctionForTesting(m2::PointD(0, -1)), MakeJunctionForTesting(m2::PointD(0, 0))),
+ Edge(MakeTestFeatureID(1) /* second road */, false /* forward */, 2 /* segId */,
+ MakeJunctionForTesting(m2::PointD(0, 1)), MakeJunctionForTesting(m2::PointD(0, 0))),
};
sort(expectedIngoing.begin(), expectedIngoing.end());