MCPcopy Create free account
hub / github.com/comaps/comaps / UNIT_TEST

Function UNIT_TEST

tools/openlr/openlr_tests/decoded_path_test.cpp:149–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149UNIT_TEST(MakePath_Test)
150{
151 std::vector<m2::PointD> const points{{0, 0}, {0, 1}, {1, 0}, {1, 1}};
152 WithRoad(points, [&points](DataSource const & dataSource, FeatureType & road)
153 {
154 auto const & id = road.GetID();
155 {
156 openlr::Path const expected{routing::Edge::MakeReal(id, true /* forward */, 0 /* segId*/, points[0], points[1]),
157 routing::Edge::MakeReal(id, true /* forward */, 1 /* segId*/, points[1], points[2]),
158 routing::Edge::MakeReal(id, true /* forward */, 2 /* segId*/, points[2], points[3])};
159 auto const path = MakePath(road, true /* forward */);
160 TEST_EQUAL(path, expected, ());
161 }
162 {
163 openlr::Path const expected{routing::Edge::MakeReal(id, false /* forward */, 2 /* segId*/, points[3], points[2]),
164 routing::Edge::MakeReal(id, false /* forward */, 1 /* segId*/, points[2], points[1]),
165 routing::Edge::MakeReal(id, false /* forward */, 0 /* segId*/, points[1], points[0])};
166 {
167 auto const path = MakePath(road, false /* forward */);
168 TEST_EQUAL(path, expected, ());
169 }
170 }
171 });
172}
173
174UNIT_TEST(PathSerializeDeserialize_Test)
175{

Callers

nothing calls this directly

Calls 7

WithRoadFunction · 0.85
MakePathFunction · 0.85
TestSerializeDeserializeFunction · 0.85
GetPointsFunction · 0.85
beginFunction · 0.50
endFunction · 0.50
GetIDMethod · 0.45

Tested by

no test coverage detected