diff options
author | Qt CI Bot <qt_ci_bot@qt-project.org> | 2021-04-14 14:29:23 +0000 |
---|---|---|
committer | Qt CI Bot <qt_ci_bot@qt-project.org> | 2021-04-14 14:29:23 +0000 |
commit | fb0fcd7fe3f94a227dd66a110f5a3353008e37e5 (patch) | |
tree | 86c933ae671b80100d68365f09abcf68f7b95dcc /tests/auto | |
parent | 3766cd6ff5995a6259d3e5086168e271207f3cb0 (diff) | |
parent | 964f91fd25a59654905c5a68d3cbccedab9ebb5a (diff) |
Merge integration refs/builds/qtci/dev/1618397939
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp index f20f338517..5e272f2400 100644 --- a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp +++ b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp @@ -67,6 +67,7 @@ private Q_SLOTS: void isValidId_data(); void isValidId(); void serialize(); + void malformed(); // Backend tests void utcTest(); void icuTest(); @@ -986,6 +987,21 @@ void tst_QTimeZone::serialize() QSKIP("No serialization enabled"); } +void tst_QTimeZone::malformed() +{ + // Regression test for QTBUG-92808 + // Strings that look enough like a POSIX zone specifier that the constructor + // accepts them, but the specifier is invalid. + // Must not crash or trigger assertions when calling offsetFromUtc() + const QDateTime now = QDateTime::currentDateTime(); + QTimeZone barf("QUT4tCZ0 , /"); + if (barf.isValid()) + barf.offsetFromUtc(now); + barf = QTimeZone("QtC+09,,MA"); + if (barf.isValid()) + barf.offsetFromUtc(now); +} + void tst_QTimeZone::utcTest() { #ifdef QT_BUILD_INTERNAL |