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

Function WithRoad

tools/openlr/openlr_tests/decoded_path_test.cpp:118–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116
117template <typename Func>
118void 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
149UNIT_TEST(MakePath_Test)
150{

Callers 1

UNIT_TESTFunction · 0.85

Calls 11

JoinPathFunction · 0.85
TestRoadClass · 0.85
TESTFunction · 0.85
ParseGeometryMethod · 0.80
LoadFunction · 0.50
CountryFileClass · 0.50
AddMethod · 0.45
RegisterMapMethod · 0.45
GetMwmHandleByIdMethod · 0.45
IsAliveMethod · 0.45
GetFeatureByIndexMethod · 0.45

Tested by

no test coverage detected