The test on combinatorial explosion of number of fake edges at FeaturesRoadGraph. It might happen when a lot of roads intersect at one point. For example, https://www.openstreetmap.org/#map=19/50.73197/-1.21295
| 29 | // It might happen when a lot of roads intersect at one point. For example, |
| 30 | // https://www.openstreetmap.org/#map=19/50.73197/-1.21295 |
| 31 | UNIT_TEST(FakeEdgesCombinatorialExplosion) |
| 32 | { |
| 33 | classificator::Load(); |
| 34 | |
| 35 | std::vector<LocalCountryFile> localFiles; |
| 36 | GetAllLocalFiles(localFiles); |
| 37 | TEST(!localFiles.empty(), ()); |
| 38 | |
| 39 | FrozenDataSource dataSource; |
| 40 | for (auto const & file : localFiles) |
| 41 | dataSource.Register(file); |
| 42 | |
| 43 | MwmDataSource routingSource(dataSource, nullptr /* numMwmIDs */); |
| 44 | FeaturesRoadGraph graph(routingSource, IRoadGraph::Mode::ObeyOnewayTag, |
| 45 | std::make_shared<CarModelFactory>(CountryParentNameGetterFn())); |
| 46 | geometry::PointWithAltitude const j(m2::PointD(mercator::FromLatLon(50.73208, -1.21279)), |
| 47 | geometry::kDefaultAltitudeMeters); |
| 48 | std::vector<std::pair<routing::Edge, geometry::PointWithAltitude>> sourceVicinity; |
| 49 | graph.FindClosestEdges(mercator::RectByCenterXYAndSizeInMeters(j.GetPoint(), FeaturesRoadGraph::kClosestEdgesRadiusM), |
| 50 | 20 /* count */, sourceVicinity); |
| 51 | // In case of the combinatorial explosion mentioned above all the memory was consumed for |
| 52 | // FeaturesRoadGraph::m_fakeIngoingEdges and FeaturesRoadGraph::m_fakeOutgoingEdges fields. |
| 53 | graph.AddFakeEdges(j, sourceVicinity); |
| 54 | } |
nothing calls this directly
no test coverage detected