summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/tools/qlocale/tst_qlocale.cpp')
-rw-r--r--tests/auto/corelib/tools/qlocale/tst_qlocale.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
index 6f20e3db91..5d13d9e454 100644
--- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
@@ -35,7 +35,9 @@
#include <QScopedArrayPointer>
#include <qtextcodec.h>
#include <qdatetime.h>
-#include <qprocess.h>
+#if QT_CONFIG(process)
+# include <qprocess.h>
+#endif
#include <float.h>
#include <locale.h>
@@ -78,6 +80,7 @@ private slots:
void ctor();
void emptyCtor();
void legacyNames();
+ void consistentC();
void unixLocaleName();
void matchingLocales();
void stringToDouble_data();
@@ -152,7 +155,7 @@ tst_QLocale::tst_QLocale()
void tst_QLocale::initTestCase()
{
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
const QString syslocaleapp_dir = QFINDTESTDATA("syslocaleapp");
QVERIFY2(!syslocaleapp_dir.isEmpty(),
qPrintable(QStringLiteral("Cannot find 'syslocaleapp' starting from ")
@@ -165,7 +168,7 @@ void tst_QLocale::initTestCase()
QVERIFY2(fi.exists() && fi.isExecutable(),
qPrintable(QDir::toNativeSeparators(m_sysapp)
+ QStringLiteral(" does not exist or is not executable.")));
-#endif // QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
void tst_QLocale::cleanupTestCase()
@@ -420,7 +423,7 @@ void tst_QLocale::ctor()
#undef TEST_CTOR
}
-#if !defined(QT_NO_PROCESS)
+#if QT_CONFIG(process)
static inline bool runSysApp(const QString &binary,
const QStringList &env,
QString *output,
@@ -472,7 +475,7 @@ static inline bool runSysAppTest(const QString &binary,
void tst_QLocale::emptyCtor()
{
-#ifdef QT_NO_PROCESS
+#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
#define TEST_CTOR(req_lc, exp_str) \
@@ -577,6 +580,15 @@ void tst_QLocale::legacyNames()
#undef TEST_CTOR
}
+void tst_QLocale::consistentC()
+{
+ const QLocale c(QLocale::C);
+ QCOMPARE(c, QLocale::c());
+ QCOMPARE(c, QLocale(QLocale::C, QLocale::AnyScript, QLocale::AnyCountry));
+ QVERIFY(QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript,
+ QLocale::AnyCountry).contains(c));
+}
+
void tst_QLocale::matchingLocales()
{
const QLocale c(QLocale::C);