aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2016-10-17 18:23:45 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-10-18 11:13:37 -0700
commit713dd26d6c19de0ddc9b8caa28775486bf13c156 (patch)
treeab056b40dbc8b2ffada6f4c5582060a9a96d1081 /tests
parentcca09612d10bef5e0469196e7f5c210975aa8a02 (diff)
downloadsubsurface-713dd26d6c19de0ddc9b8caa28775486bf13c156.tar.gz
Added language testcase
Also, added a missing method / property Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/testpreferences.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/tests/testpreferences.cpp b/tests/testpreferences.cpp
index e8e3f0995..7ba25625a 100644
--- a/tests/testpreferences.cpp
+++ b/tests/testpreferences.cpp
@@ -502,7 +502,42 @@ void TestPreferences::testPreferences()
TEST(display->fontSize(), 14.0);
TEST(display->displayInvalidDives(),(short) false);
-
+ auto language = pref->language_settings;
+ language->setLangLocale ("en_US");
+ language->setLanguage ("en");
+ language->setTimeFormat ("hh:mm");
+ language->setDateFormat ("dd/mm/yy");
+ language->setDateFormatShort ("dd/mm");
+ language->setTimeFormatOverride (false);
+ language->setDateFormatOverride (false);
+ language->setUseSystemLanguage (false);
+
+ TEST(language->langLocale(), QStringLiteral("en_US"));
+ TEST(language->language(), QStringLiteral("en"));
+ TEST(language->timeFormat(), QStringLiteral("hh:mm"));
+ TEST(language->dateFormat(), QStringLiteral("dd/mm/yy"));
+ TEST(language->dateFormatShort(), QStringLiteral("dd/mm"));
+ TEST(language->timeFormatOverride(), false);
+ TEST(language->dateFormatOverride(), false);
+ TEST(language->useSystemLanguage(), false);
+
+ language->setLangLocale ("en_EN");
+ language->setLanguage ("br");
+ language->setTimeFormat ("mm:hh");
+ language->setDateFormat ("yy/mm/dd");
+ language->setDateFormatShort ("dd/yy");
+ language->setTimeFormatOverride (true);
+ language->setDateFormatOverride (true);
+ language->setUseSystemLanguage (true);
+
+ TEST(language->langLocale(), QStringLiteral("en_EN"));
+ TEST(language->language(), QStringLiteral("br"));
+ TEST(language->timeFormat(), QStringLiteral("mm:hh"));
+ TEST(language->dateFormat(), QStringLiteral("yy/mm/dd"));
+ TEST(language->dateFormatShort(), QStringLiteral("dd/yy"));
+ TEST(language->timeFormatOverride(),true);
+ TEST(language->dateFormatOverride(),true);
+ TEST(language->useSystemLanguage(), true);
}
QTEST_MAIN(TestPreferences)