summaryrefslogtreecommitdiffstats
path: root/tests/testqPrefDisplay.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-07-28 17:21:51 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-30 07:43:22 -0700
commit600da8b9ff4946d6500e2327dc8f7e361a3616cc (patch)
tree0a688b20a7941c7c61eb78388d41b85f4b1d1c0e /tests/testqPrefDisplay.cpp
parent311b2672da5bda0efbdda70bfe33ccc088ba5c8d (diff)
downloadsubsurface-600da8b9ff4946d6500e2327dc8f7e361a3616cc.tar.gz
tests: correct test_multiple in all qPref classes
test_multiple did not test correctly, correct. Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'tests/testqPrefDisplay.cpp')
-rw-r--r--tests/testqPrefDisplay.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/tests/testqPrefDisplay.cpp b/tests/testqPrefDisplay.cpp
index 8b7275a39..0f534c0da 100644
--- a/tests/testqPrefDisplay.cpp
+++ b/tests/testqPrefDisplay.cpp
@@ -109,26 +109,16 @@ void TestQPrefDisplay::test_struct_disk()
void TestQPrefDisplay::test_multiple()
{
// test multiple instances have the same information
-
- prefs.display_invalid_dives = false;
+ auto display_direct = qPrefDisplay::instance();
prefs.divelist_font = copy_qstring("comic");
- prefs.font_size = 11.0;
- prefs.show_developer = true;
- prefs.theme = copy_qstring("myTheme");
- auto display_direct = new qPrefDisplay;
- prefs.display_invalid_dives = true;
- prefs.divelist_font = copy_qstring("multipleCharsInString");
- prefs.font_size = 15.0;
- prefs.show_developer = false;
- prefs.theme = copy_qstring("myTheme8");
auto display = qPrefDisplay::instance();
+ prefs.font_size = 15.0;
- QCOMPARE(display->display_invalid_dives(), display_direct->display_invalid_dives());
QCOMPARE(display->divelist_font(), display_direct->divelist_font());
+ QCOMPARE(display->divelist_font(), QString("comic"));
QCOMPARE(display->font_size(), display_direct->font_size());
- QCOMPARE(display->show_developer(), display_direct->show_developer());
- QCOMPARE(display->theme(), display_direct->theme());
+ QCOMPARE(display->font_size(), 15.0);
}
QTEST_MAIN(TestQPrefDisplay)