From 568ee7da5ad603c65704c33cfea9526d61fb4c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Mon, 25 Jun 2018 16:45:39 +0200 Subject: Android: Pass tst_qlocale To make it run we make sure it finds the syslocaleapp, however since it causes a crash we skip the test that uses it... "formatTimeZone" was failing, but it is the exact same issue as in e08ba34f26197fb9893fd48a38bdd0dfff7d4a60, so we solve it the exact same way. Change-Id: Ifd5c796735775dad94acf55210cf18c0f4d375ca Reviewed-by: Eskil Abrahamsen Blomfeldt --- tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'tests/auto/corelib/tools/qlocale/tst_qlocale.cpp') diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index 375cecd521..884cff553c 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -168,14 +168,18 @@ tst_QLocale::tst_QLocale() void tst_QLocale::initTestCase() { #if QT_CONFIG(process) +# ifdef Q_OS_ANDROID + m_sysapp = QCoreApplication::applicationDirPath() + "/libsyslocaleapp.so"; +# else // !defined(Q_OS_ANDROID) const QString syslocaleapp_dir = QFINDTESTDATA("syslocaleapp"); QVERIFY2(!syslocaleapp_dir.isEmpty(), qPrintable(QStringLiteral("Cannot find 'syslocaleapp' starting from ") + QDir::toNativeSeparators(QDir::currentPath()))); m_sysapp = syslocaleapp_dir + QStringLiteral("/syslocaleapp"); -#ifdef Q_OS_WIN +# ifdef Q_OS_WIN m_sysapp += QStringLiteral(".exe"); -#endif +# endif +# endif // Q_OS_ANDROID const QFileInfo fi(m_sysapp); QVERIFY2(fi.exists() && fi.isExecutable(), qPrintable(QDir::toNativeSeparators(m_sysapp) @@ -502,6 +506,9 @@ void tst_QLocale::emptyCtor() #if !QT_CONFIG(process) QSKIP("No qprocess support", SkipAll); #else +#ifdef Q_OS_ANDROID + QSKIP("This test crashes on Android"); +#endif #define TEST_CTOR(req_lc, exp_str) \ { \ /* Test constructor without arguments. Needs separate process */ \ @@ -1542,17 +1549,25 @@ void tst_QLocale::formatTimeZone() QSKIP("You must test using Central European (CET/CEST) time zone, e.g. TZ=Europe/Oslo"); } +#ifdef Q_OS_ANDROID // Only reports (general) zones as offsets (QTBUG-68837) + const QString cet(QStringLiteral("GMT+01:00")); + const QString cest(QStringLiteral("GMT+02:00")); +#else + const QString cet(QStringLiteral("CET")); + const QString cest(QStringLiteral("CEST")); +#endif + QDateTime dt6(QDate(2013, 1, 1), QTime(0, 0, 0), QTimeZone("Europe/Berlin")); #ifdef Q_OS_WIN QEXPECT_FAIL("", "QTimeZone windows backend only returns long name", Continue); #endif - QCOMPARE(enUS.toString(dt6, "t"), QLatin1String("CET")); + QCOMPARE(enUS.toString(dt6, "t"), cet); QDateTime dt7(QDate(2013, 6, 1), QTime(0, 0, 0), QTimeZone("Europe/Berlin")); #ifdef Q_OS_WIN QEXPECT_FAIL("", "QTimeZone windows backend only returns long name", Continue); #endif - QCOMPARE(enUS.toString(dt7, "t"), QLatin1String("CEST")); + QCOMPARE(enUS.toString(dt7, "t"), cest); // Current datetime should return current abbreviation QCOMPARE(enUS.toString(QDateTime::currentDateTime(), "t"), -- cgit v1.2.3