tests: fix testqPrefDisplay

Font size are never stored on disk for the mobile version,
so testing load/save does not make sense.

add #ifndef SUBSURFACE_MOBILE

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
jan Iversen 2019-12-28 20:20:30 +01:00 committed by Dirk Hohndel
parent 9be028659e
commit d82840b468

View file

@ -106,10 +106,13 @@ void TestQPrefDisplay::test_set_load_struct()
prefs.show_developer = false; prefs.show_developer = false;
display->load(); display->load();
#ifndef SUBSURFACE_MOBILE
// Font size is never stored on disk, but qPref grabs the system default
QCOMPARE(prefs.font_size, 15.0);
#endif
QCOMPARE(prefs.animation_speed, 33); QCOMPARE(prefs.animation_speed, 33);
QCOMPARE(prefs.display_invalid_dives, true); QCOMPARE(prefs.display_invalid_dives, true);
QCOMPARE(prefs.divelist_font, "doNotCareString"); QCOMPARE(prefs.divelist_font, "doNotCareString");
QCOMPARE(prefs.font_size, 15.0);
QCOMPARE(prefs.show_developer, true); QCOMPARE(prefs.show_developer, true);
QCOMPARE(display->theme(), QString("myTheme2")); QCOMPARE(display->theme(), QString("myTheme2"));
QCOMPARE(display->lastDir(), QString("test2")); QCOMPARE(display->lastDir(), QString("test2"));
@ -147,7 +150,10 @@ void TestQPrefDisplay::test_struct_disk()
QCOMPARE(prefs.animation_speed, 27); QCOMPARE(prefs.animation_speed, 27);
QCOMPARE(prefs.display_invalid_dives, true); QCOMPARE(prefs.display_invalid_dives, true);
QCOMPARE(prefs.divelist_font, "doNotCareAtAll"); QCOMPARE(prefs.divelist_font, "doNotCareAtAll");
#ifndef SUBSURFACE_MOBILE
// Font size is never stored on disk, but qPref grabs the system default
QCOMPARE(prefs.font_size, 17.0); QCOMPARE(prefs.font_size, 17.0);
#endif
QCOMPARE(prefs.show_developer, false); QCOMPARE(prefs.show_developer, false);
} }