summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/testqPrefDisplay.cpp21
-rw-r--r--tests/testqPrefDisplay.h2
2 files changed, 12 insertions, 11 deletions
diff --git a/tests/testqPrefDisplay.cpp b/tests/testqPrefDisplay.cpp
index 5d510fe21..4ccba5203 100644
--- a/tests/testqPrefDisplay.cpp
+++ b/tests/testqPrefDisplay.cpp
@@ -1,11 +1,12 @@
// SPDX-License-Identifier: GPL-2.0
#include "testqPrefDisplay.h"
-#include "core/settings/qPrefDisplay.h"
+#include "core/settings/qPref.h"
#include "core/pref.h"
#include "core/qthelper.h"
#include <QDate>
+#include <QTest>
void TestQPrefDisplay::initTestCase()
{
@@ -40,13 +41,13 @@ void TestQPrefDisplay::test_set_struct()
auto display = qPrefDisplay::instance();
display->set_display_invalid_dives(true);
- display->set_divelist_font("comic");
+ display->set_divelist_font("doNotCareAtAll");
display->set_font_size(12.0);
display->set_show_developer(false);
display->set_theme("myTheme");
QCOMPARE(prefs.display_invalid_dives, true);
- QCOMPARE(prefs.divelist_font, "comic");
+ QCOMPARE(prefs.divelist_font, "doNotCareAtAll");
QCOMPARE(prefs.font_size, 12.0);
QCOMPARE(prefs.show_developer, false);
QCOMPARE(prefs.theme, "myTheme");
@@ -59,20 +60,20 @@ void TestQPrefDisplay::test_set_load_struct()
auto display = qPrefDisplay::instance();
display->set_display_invalid_dives(false);
- display->set_divelist_font("helvitica");
+ display->set_divelist_font("doNotCareString");
display->set_font_size(15.0);
display->set_show_developer(true);
display->set_theme("myTheme2");
prefs.display_invalid_dives = true;
- prefs.divelist_font = copy_qstring("comic");
+ prefs.divelist_font = copy_qstring("doNotCareAtAll");
prefs.font_size = 12.0;
prefs.show_developer = false;
prefs.theme = copy_qstring("myTheme");
display->load();
QCOMPARE(prefs.display_invalid_dives, false);
- QCOMPARE(prefs.divelist_font, "helvitica");
+ QCOMPARE(prefs.divelist_font, "doNotCareString");
QCOMPARE(prefs.font_size, 15.0);
QCOMPARE(prefs.show_developer, true);
QCOMPARE(prefs.theme, "myTheme2");
@@ -85,21 +86,21 @@ void TestQPrefDisplay::test_struct_disk()
auto display = qPrefDisplay::instance();
prefs.display_invalid_dives = true;
- prefs.divelist_font = copy_qstring("helvitica");
+ prefs.divelist_font = copy_qstring("doNotCareAtAll");
prefs.font_size = 17.0;
prefs.show_developer = false;
prefs.theme = copy_qstring("myTheme3");
display->sync();
prefs.display_invalid_dives = false;
- prefs.divelist_font = copy_qstring("comic");
+ prefs.divelist_font = copy_qstring("noString");
prefs.font_size = 11.0;
prefs.show_developer = true;
prefs.theme = copy_qstring("myTheme");
display->load();
QCOMPARE(prefs.display_invalid_dives, true);
- QCOMPARE(prefs.divelist_font, "helvitica");
+ QCOMPARE(prefs.divelist_font, "doNotCareAtAll");
QCOMPARE(prefs.font_size, 17.0);
QCOMPARE(prefs.show_developer, false);
QCOMPARE(prefs.theme, "myTheme3");
@@ -117,7 +118,7 @@ void TestQPrefDisplay::test_multiple()
auto display_direct = new qPrefDisplay;
prefs.display_invalid_dives = true;
- prefs.divelist_font = copy_qstring("helvetica");
+ prefs.divelist_font = copy_qstring("multipleCharsInString");
prefs.font_size = 15.0;
prefs.show_developer = false;
prefs.theme = copy_qstring("myTheme8");
diff --git a/tests/testqPrefDisplay.h b/tests/testqPrefDisplay.h
index 6af2d2be5..dfc81aee2 100644
--- a/tests/testqPrefDisplay.h
+++ b/tests/testqPrefDisplay.h
@@ -2,7 +2,7 @@
#ifndef TESTQPREFDISPLAY_H
#define TESTQPREFDISPLAY_H
-#include <QtTest>
+#include <QObject>
class TestQPrefDisplay : public QObject
{