| 147 | } |
| 148 | |
| 149 | UNIT_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 | |
| 174 | UNIT_TEST(PathSerializeDeserialize_Test) |
| 175 | { |