Tests: StatTest: Setup resources for DB migrations.

This commit is contained in:
Nodir Temirkhodjaev 2021-05-10 12:12:11 +03:00
parent 482d80941a
commit 92fc8f2d98
4 changed files with 17 additions and 11 deletions

View File

@ -5,6 +5,8 @@
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <fortmanager.h>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
@ -12,5 +14,7 @@ int main(int argc, char *argv[])
QCoreApplication app(argc, argv); QCoreApplication app(argc, argv);
FortManager::setupResources();
return RUN_ALL_TESTS(); return RUN_ALL_TESTS();
} }

View File

@ -785,3 +785,13 @@ void FortManager::activateModalWidget()
w->activateWindow(); w->activateWindow();
} }
} }
void FortManager::setupResources()
{
Q_INIT_RESOURCE(appinfo_migrations);
Q_INIT_RESOURCE(conf_migrations);
Q_INIT_RESOURCE(conf_zone);
Q_INIT_RESOURCE(stat_migrations);
Q_INIT_RESOURCE(fort_icons);
}

View File

@ -127,6 +127,8 @@ public slots:
bool showYesNoBox(const QString &text, const QString &yesText, const QString &noText, bool showYesNoBox(const QString &text, const QString &yesText, const QString &noText,
const QString &title = QString()); const QString &title = QString());
static void setupResources();
private: private:
void setupThreadPool(); void setupThreadPool();

View File

@ -28,16 +28,6 @@ static void uninstall()
DriverCommon::provUnregister(); // Unregister booted provider DriverCommon::provUnregister(); // Unregister booted provider
} }
static void setupResources()
{
Q_INIT_RESOURCE(appinfo_migrations);
Q_INIT_RESOURCE(conf_migrations);
Q_INIT_RESOURCE(conf_zone);
Q_INIT_RESOURCE(stat_migrations);
Q_INIT_RESOURCE(fort_icons);
}
static void setupAppStyle() static void setupAppStyle()
{ {
const auto fusionStyle = QStyleFactory::create("Fusion"); const auto fusionStyle = QStyleFactory::create("Fusion");
@ -81,7 +71,7 @@ int main(int argc, char *argv[])
return controlManager.postCommand() ? 0 : FORT_ERROR_CONTROL; return controlManager.postCommand() ? 0 : FORT_ERROR_CONTROL;
} }
setupResources(); FortManager::setupResources();
FortManager fortManager(&settings, &envManager, &controlManager); FortManager fortManager(&settings, &envManager, &controlManager);