Changeset View
Changeset View
Standalone View
Standalone View
autotests/klanguagenametest.cpp
Show All 19 Lines | |||||
20 | 20 | | |||
21 | #include <QObject> | 21 | #include <QObject> | ||
22 | #include <QtTest> | 22 | #include <QtTest> | ||
23 | 23 | | |||
24 | #include "klanguagename.h" | 24 | #include "klanguagename.h" | ||
25 | 25 | | |||
26 | static void setEnvironment() | 26 | static void setEnvironment() | ||
27 | { | 27 | { | ||
28 | qputenv("LOCALE", "C.UTF-8"); | 28 | qputenv("LANG", "C.UTF-8"); | ||
29 | qputenv("LANG", "en"); | 29 | qputenv("LANGUAGE", "en"); | ||
30 | qputenv("XDG_DATA_DIRS", qUtf8Printable(QFINDTESTDATA("kf5_entry_data"))); | 30 | qputenv("XDG_DATA_DIRS", qUtf8Printable(QFINDTESTDATA("kf5_entry_data"))); | ||
31 | // There is a distinct chance of the envionrment setup being to late and | ||||
32 | // causing flakey results based on the execution env. | ||||
33 | // Make sure we definitely default to english. | ||||
34 | QLocale::setDefault(QLocale::English); | ||||
31 | 35 | | |||
32 | // NOTE | 36 | // NOTE | ||
33 | // - fr has no translations | 37 | // - fr has no translations | ||
34 | // - es has no kf5_entry at all | 38 | // - es has no kf5_entry at all | ||
35 | // - other languages under testing are complete | 39 | // - other languages under testing are complete | ||
36 | } | 40 | } | ||
37 | 41 | | |||
38 | class KLanguageNameTest : public QObject | 42 | class KLanguageNameTest : public QObject | ||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |