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

Method HaveMapEditsOrNotesToUploadTest

libs/editor/editor_tests/osm_editor_test.cpp:654–685  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

652}
653
654void EditorTest::HaveMapEditsOrNotesToUploadTest()
655{
656 auto & editor = osm::Editor::Instance();
657
658 auto const mwmId = ConstructTestMwm([](TestMwmBuilder & builder)
659 {
660 TestCafe cafe(m2::PointD(1.0, 1.0), "London Cafe", "en");
661 builder.Add(cafe);
662 });
663
664 TEST(!editor.HaveMapEditsOrNotesToUpload(), ());
665
666 ForEachCafeAtPoint(m_dataSource, m2::PointD(1.0, 1.0), [](FeatureType & ft) { SetBuildingLevelsToOne(ft); });
667
668 TEST(editor.HaveMapEditsOrNotesToUpload(), ());
669 editor.ClearAllLocalEdits();
670 TEST(!editor.HaveMapEditsOrNotesToUpload(), ());
671
672 ScopedFile sf("test_notes.xml", ScopedFile::Mode::DoNotCreate);
673
674 editor.m_notes = Notes::MakeNotes(sf.GetFullPath(), true);
675
676 ForEachCafeAtPoint(m_dataSource, m2::PointD(1.0, 1.0), [&editor](FeatureType & ft)
677 {
678 using NoteType = osm::Editor::NoteProblemType;
679 feature::TypesHolder typesHolder;
680 std::string defaultName;
681 editor.CreateNote({1.0, 1.0}, ft.GetID(), typesHolder, defaultName, NoteType::PlaceDoesNotExist, "exploded");
682 });
683
684 TEST(editor.HaveMapEditsOrNotesToUpload(), ());
685}
686
687void EditorTest::HaveMapEditsToUploadTest()
688{

Callers

nothing calls this directly

Calls 8

TESTFunction · 0.85
ForEachCafeAtPointFunction · 0.85
SetBuildingLevelsToOneFunction · 0.85
ClearAllLocalEditsMethod · 0.80
AddMethod · 0.45
CreateNoteMethod · 0.45
GetIDMethod · 0.45

Tested by

no test coverage detected