mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 13:10:05 +00:00
QMapLibre test refactoring
This commit is contained in:
parent
e23c6c2624
commit
16c2fae408
1 changed files with 8 additions and 8 deletions
|
|
@ -3,10 +3,10 @@
|
||||||
#include <scwx/util/logger.hpp>
|
#include <scwx/util/logger.hpp>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QMapLibreGL/QMapLibreGL>
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
#include <qmaplibre.hpp>
|
||||||
#include <re2/re2.h>
|
#include <re2/re2.h>
|
||||||
|
|
||||||
namespace scwx
|
namespace scwx
|
||||||
|
|
@ -45,22 +45,22 @@ TEST_P(ByMapProviderTest, MapProviderLayers)
|
||||||
// Configure map provider
|
// Configure map provider
|
||||||
const MapProviderInfo& mapProviderInfo = GetMapProviderInfo(mapProvider);
|
const MapProviderInfo& mapProviderInfo = GetMapProviderInfo(mapProvider);
|
||||||
|
|
||||||
// Configure QMapLibreGL
|
// Configure QMapLibre
|
||||||
QMapLibreGL::Settings mapSettings {};
|
QMapLibre::Settings mapSettings {};
|
||||||
mapSettings.resetToTemplate(mapProviderInfo.settingsTemplate_);
|
mapSettings.setProviderTemplate(mapProviderInfo.providerTemplate_);
|
||||||
mapSettings.setApiKey(QString::fromStdString(apiKey));
|
mapSettings.setApiKey(QString::fromStdString(apiKey));
|
||||||
|
|
||||||
QMapLibreGL::Map map(nullptr, mapSettings, QSize(1, 1));
|
QMapLibre::Map map(nullptr, mapSettings, QSize(1, 1));
|
||||||
application.processEvents();
|
application.processEvents();
|
||||||
|
|
||||||
// Connect style load completion signal
|
// Connect style load completion signal
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
&map,
|
&map,
|
||||||
&QMapLibreGL::Map::mapChanged,
|
&QMapLibre::Map::mapChanged,
|
||||||
[&](QMapLibreGL::Map::MapChange mapChange)
|
[&](QMapLibre::Map::MapChange mapChange)
|
||||||
{
|
{
|
||||||
if (mapChange ==
|
if (mapChange ==
|
||||||
QMapLibreGL::Map::MapChange::MapChangeDidFinishLoadingStyle)
|
QMapLibre::Map::MapChange::MapChangeDidFinishLoadingStyle)
|
||||||
{
|
{
|
||||||
application.exit();
|
application.exit();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue