diff options
-rw-r--r-- | src/corelib/time/qtimezoneprivate.cpp | 6 | ||||
-rw-r--r-- | tests/auto/corelib/time/qtimezone/BLACKLIST | 12 | ||||
-rw-r--r-- | tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp | 11 |
3 files changed, 25 insertions, 4 deletions
diff --git a/src/corelib/time/qtimezoneprivate.cpp b/src/corelib/time/qtimezoneprivate.cpp index 569b343187..00dc8b4ced 100644 --- a/src/corelib/time/qtimezoneprivate.cpp +++ b/src/corelib/time/qtimezoneprivate.cpp @@ -632,7 +632,13 @@ bool QTimeZonePrivate::isValidId(const QByteArray &ianaId) // Somewhat slack hand-rolled version: const int MinSectionLength = 1; +#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) + // Android has its own naming of zones. + // "Canada/East-Saskatchewan" has a 17-character second component. + const int MaxSectionLength = 17; +#else const int MaxSectionLength = 14; +#endif int sectionLength = 0; for (const char *it = ianaId.begin(), * const end = ianaId.end(); it != end; ++it, ++sectionLength) { const char ch = *it; diff --git a/tests/auto/corelib/time/qtimezone/BLACKLIST b/tests/auto/corelib/time/qtimezone/BLACKLIST index 840c3b1181..b820bab3d9 100644 --- a/tests/auto/corelib/time/qtimezone/BLACKLIST +++ b/tests/auto/corelib/time/qtimezone/BLACKLIST @@ -2,10 +2,6 @@ [dataStreamTest] android -# QTBUG-69128 -[isTimeZoneIdAvailable] -android - # QTBUG-69129 [specificTransition] android @@ -75,10 +71,14 @@ android android [transitionEachZone:Asia/Chita@1970] android +[transitionEachZone:Asia/Choibalsan@1970] +android [transitionEachZone:Asia/Dushanbe@1970] android [transitionEachZone:Asia/Ho_Chi_Minh@1970] android +[transitionEachZone:Asia/Hovd@1970] +android [transitionEachZone:Asia/Kathmandu@1970] android [transitionEachZone:Asia/Katmandu@1970] @@ -109,6 +109,10 @@ android android [transitionEachZone:Asia/Thimphu@1970] android +[transitionEachZone:Asia/Ulaanbaatar@1970] +android +[transitionEachZone:Asia/Ulan_Bator@1970] +android [transitionEachZone:Asia/Ust-Nera@1970] android [transitionEachZone:Atlantic/Cape_Verde@1970] diff --git a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp index 9f51ff8ba8..f425691d9c 100644 --- a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp +++ b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp @@ -706,6 +706,7 @@ void tst_QTimeZone::isValidId_data() // a-z, A-Z, 0-9, '.', '-', '_' are valid chars // Can't start with '-' // Parts separated by '/', each part min 1 and max of 14 chars + // (Android has parts with lengths up to 17, so tolerates this as a special case.) #define TESTSET(name, section, valid) \ QTest::newRow(name " front") << QByteArray(section "/xyz/xyz") << valid; \ QTest::newRow(name " middle") << QByteArray("xyz/" section "/xyz") << valid; \ @@ -713,8 +714,13 @@ void tst_QTimeZone::isValidId_data() TESTSET("empty", "", false); TESTSET("minimal", "m", true); +#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) + TESTSET("maximal", "East-Saskatchewan", true); // Android actually uses this + TESTSET("too long", "North-Saskatchewan", false); // ... but thankfully not this. +#else TESTSET("maximal", "12345678901234", true); TESTSET("too long", "123456789012345", false); +#endif TESTSET("bad hyphen", "-hyphen", false); TESTSET("good hyphen", "hy-phen", true); @@ -759,8 +765,13 @@ void tst_QTimeZone::isValidId_data() QTest::newRow("a,z alone") << QByteArray("a,z") << false; QTest::newRow("/z alone") << QByteArray("/z") << false; QTest::newRow("-z alone") << QByteArray("-z") << false; +#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) + QTest::newRow("long alone") << QByteArray("12345678901234567") << true; + QTest::newRow("over-long alone") << QByteArray("123456789012345678") << false; +#else QTest::newRow("long alone") << QByteArray("12345678901234") << true; QTest::newRow("over-long alone") << QByteArray("123456789012345") << false; +#endif #else QSKIP("This test requires a Qt -developer-build."); |