MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / asyncLoadingTest

Method asyncLoadingTest

test/template_t.cpp:686–714  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

684 }
685
686 void asyncLoadingTest()
687 {
688#ifdef MAPPER_USE_GDAL
689 GdalManager().setFormatEnabled(GdalManager::GPX, false);
690#endif
691
692 QFETCH(QString, map_file);
693 QFETCH(int, template_index);
694
695 Map map;
696 MapView view{ &map };
697 QVERIFY(map.loadFrom(map_file, &view));
698 QVERIFY(map.getNumTemplates() > template_index);
699
700 auto* temp = map.getTemplate(template_index);
701 QCOMPARE(temp->getTemplateState(), Template::Unloaded);
702 view.setTemplateVisibility(temp, TemplateVisibility{1, true});
703
704 QStringList messages;
705 messages.reserve(10);
706 map.loadTemplateFilesAsync(view, [&messages](const QString& msg){
707 messages.push_back(msg);
708 });
709 QSignalSpy(temp, &Template::templateStateChanged).wait();
710 QCOMPARE(temp->getTemplateState(), Template::Loaded);
711 QVERIFY(messages.size() >= 2);
712 QVERIFY(!messages.front().isEmpty());
713 QVERIFY(messages.back().isEmpty());
714 }
715
716 void templateTableModelTest()
717 {

Callers

nothing calls this directly

Calls 11

GdalManagerClass · 0.85
getNumTemplatesMethod · 0.80
getTemplateStateMethod · 0.80
setTemplateVisibilityMethod · 0.80
backMethod · 0.80
setFormatEnabledMethod · 0.45
loadFromMethod · 0.45
getTemplateMethod · 0.45
sizeMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected