summaryrefslogtreecommitdiff
path: root/tests/unit/Settings/TestSettings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/Settings/TestSettings.cpp')
-rw-r--r--tests/unit/Settings/TestSettings.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/unit/Settings/TestSettings.cpp b/tests/unit/Settings/TestSettings.cpp
new file mode 100644
index 0000000..1f3fbb4
--- /dev/null
+++ b/tests/unit/Settings/TestSettings.cpp
@@ -0,0 +1,16 @@
+#include <QtCore>
+#include <gtest/gtest.h>
+
+#include "TestSettings.h"
+
+void TestSettings::init()
+{
+ QSettings::setDefaultFormat(QSettings::IniFormat);
+ QCoreApplication::setOrganizationName("freshmemory");
+ QCoreApplication::setApplicationName("freshmemory");
+ QString appDir = qApp->applicationDirPath();
+ QString userSettingsDir = appDir + "/../common";
+ QString systemSettingsDir = appDir + "/../../config";
+ QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, userSettingsDir);
+ QSettings::setPath(QSettings::IniFormat, QSettings::SystemScope, systemSettingsDir);
+}