| 116 | |
| 117 | template <typename Func> |
| 118 | void WithRoad(vector<m2::PointD> const & points, Func && fn) |
| 119 | { |
| 120 | classificator::Load(); |
| 121 | auto & platform = GetPlatform(); |
| 122 | |
| 123 | auto const mwmPath = base::JoinPath(platform.WritableDir(), kTestDir); |
| 124 | |
| 125 | LocalCountryFile country(mwmPath, CountryFile(kTestMwm), 0 /* version */); |
| 126 | ScopedDir testScopedDir(kTestDir); |
| 127 | ScopedFile testScopedMwm(base::JoinPath(kTestDir, kTestMwm + DATA_FILE_EXTENSION), ScopedFile::Mode::Create); |
| 128 | |
| 129 | { |
| 130 | TestMwmBuilder builder(country, feature::DataHeader::MapType::Country); |
| 131 | builder.Add(TestRoad(points, "Interstate 60", "en")); |
| 132 | } |
| 133 | |
| 134 | FrozenDataSource dataSource; |
| 135 | auto const regResult = dataSource.RegisterMap(country); |
| 136 | TEST_EQUAL(regResult.second, MwmSet::RegResult::Success, ()); |
| 137 | |
| 138 | MwmSet::MwmHandle mwmHandle = dataSource.GetMwmHandleById(regResult.first); |
| 139 | TEST(mwmHandle.IsAlive(), ()); |
| 140 | |
| 141 | FeaturesLoaderGuard const guard(dataSource, regResult.first); |
| 142 | auto road = guard.GetFeatureByIndex(0); |
| 143 | TEST(road, ()); |
| 144 | |
| 145 | road->ParseGeometry(FeatureType::BEST_GEOMETRY); |
| 146 | fn(dataSource, *road); |
| 147 | } |
| 148 | |
| 149 | UNIT_TEST(MakePath_Test) |
| 150 | { |
no test coverage detected