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

Method GetEditedFeatureTest

libs/editor/editor_tests/osm_editor_test.cpp:242–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242void EditorTest::GetEditedFeatureTest()
243{
244 auto & editor = osm::Editor::Instance();
245
246 {
247 FeatureID feature;
248 TEST(!editor.GetEditedFeature(feature), ());
249 }
250
251 auto const mwmId = ConstructTestMwm([](TestMwmBuilder & builder)
252 {
253 TestCafe cafe(m2::PointD(1.0, 1.0), "London Cafe", "en");
254 builder.Add(cafe);
255 });
256
257 ForEachCafeAtPoint(m_dataSource, m2::PointD(1.0, 1.0), [&editor](FeatureType & ft)
258 {
259 TEST(!editor.GetEditedFeature(ft.GetID()), ());
260
261 SetBuildingLevelsToOne(ft);
262
263 auto savedEmo = editor.GetEditedFeature(ft.GetID());
264 TEST(savedEmo, ());
265
266 TEST_EQUAL(savedEmo->GetMetadata(feature::Metadata::FMD_BUILDING_LEVELS), "1", ());
267
268 TEST_EQUAL(ft.GetID(), savedEmo->GetID(), ());
269 });
270}
271
272void EditorTest::SetIndexTest()
273{

Callers

nothing calls this directly

Calls 7

TESTFunction · 0.85
ForEachCafeAtPointFunction · 0.85
SetBuildingLevelsToOneFunction · 0.85
GetEditedFeatureMethod · 0.80
AddMethod · 0.45
GetIDMethod · 0.45
GetMetadataMethod · 0.45

Tested by

no test coverage detected