This test checks that the route from Start to Finish doesn't make an extra loop in F0. If it was so the route time had been much more.
| 627 | // This test checks that the route from Start to Finish doesn't make an extra loop in F0. |
| 628 | // If it was so the route time had been much more. |
| 629 | UNIT_CLASS_TEST(RestrictionTest, LoopGraph) |
| 630 | { |
| 631 | Init(BuildLoopGraph()); |
| 632 | auto start = MakeFakeEnding(1 /* featureId */, 0 /* segmentIdx */, m2::PointD(0.0002, 0), *m_graph); |
| 633 | auto finish = MakeFakeEnding(2, 0, m2::PointD(0.00005, 0.0004), *m_graph); |
| 634 | |
| 635 | vector<Segment> const expectedRoute = {{kTestNumMwmId, 1, 0, true}, {kTestNumMwmId, 0, 0, true}, |
| 636 | {kTestNumMwmId, 0, 1, true}, {kTestNumMwmId, 0, 8, false}, |
| 637 | {kTestNumMwmId, 0, 7, false}, {kTestNumMwmId, 0, 6, false}, |
| 638 | {kTestNumMwmId, 2, 0, true}}; |
| 639 | |
| 640 | auto const expectedWeight = mercator::DistanceOnEarth({0.0002, 0.0}, {0.0002, 0.0001}) / KmphToMps(100.0) + |
| 641 | mercator::DistanceOnEarth({0.0002, 0.0001}, {0.00015, 0.0001}) / KmphToMps(100.0) + |
| 642 | mercator::DistanceOnEarth({0.00015, 0.0001}, {0.0001, 0.0001}) / KmphToMps(100.0) + |
| 643 | mercator::DistanceOnEarth({0.0001, 0.0001}, {0.00005, 0.00015}) / KmphToMps(100.0) + |
| 644 | mercator::DistanceOnEarth({0.00005, 0.00015}, {0.00005, 0.0002}) / KmphToMps(100.0) + |
| 645 | mercator::DistanceOnEarth({0.00005, 0.0002}, {0.00005, 0.0003}) / KmphToMps(100.0) + |
| 646 | mercator::DistanceOnEarth({0.00005, 0.0003}, {0.00005, 0.0004}) / KmphToMps(100.0); |
| 647 | TestRoute(start, finish, expectedRoute.size(), &expectedRoute, expectedWeight, *m_graph); |
| 648 | } |
| 649 | |
| 650 | UNIT_TEST(IndexGraph_OnlyTopology_1) |
| 651 | { |
nothing calls this directly
no test coverage detected