summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Port QSslKey to the new plugin-based implementationTimur Pocheptsov2021-02-191-24/+24
| | | | | | | | | | | | | The idea is to have QSslKey(Private) backend-neutral and hide all library-specific code inside plugins. Fixes: QTBUG-90953 Task-number: QTBUG-65922 Change-Id: I2eeee3b2b72c78c2e24f2fb914abce3caa913be8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 0352cf8e1bf57615b9faf3f6f383896444e762ac) Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QProcess::startDetached/Unix: move up the chdir() and remove qWarningThiago Macieira2021-02-181-0/+15
| | | | | | | | | | That qWarning cannot be in the child process (we don't know if a user logger is fork-no-exec-safe) and the failure to chdir() should be reported as a failure in QProcess::startDetached() instead. Change-Id: Ic90d8429a0eb4837971dfffd1664e7577c81610b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: David Llewellyn-Jones <david.llewellyn-jones@jolla.com>
* QJsonObject: Fix operator<=()Ulf Hermann2021-02-181-0/+31
| | | | | | | | | | We had a copy-paste error there. Pick-to: 6.0 6.1 Change-Id: Ib1448197ac4f4641c6559f133f41dcf326f210f1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix warning about unused variableAndreas Buhr2021-02-181-0/+1
| | | | | | | | I get a warning about the variable t_var being set but not used. This patch fixes the warning. Change-Id: Ib2df5ed2dddd283eb87f71a8b85951d1f67f04f2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Return early after test-helpers if they failEdward Welbourne2021-02-181-0/+10
| | | | | | | | | | | The QTimeZone tests have some helper functions to test details of a QTZP instance; these use QCOMPARE(), so may return early on failure. The callers then need to notice the failure and, in their turn, also return. Change-Id: I0a188e9641ced70c9ffedd95e91f39681fad768a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Skip a timezone transition test on AndroidEdward Welbourne2021-02-182-3/+5
| | | | | | | | | | | | Its back-end lacks transition data, so the test can't possibly succeed. Make the skip conditional on the tested zone having transitions, so that the test will come back into play if we ever gain support for transitions on Android. Fixes: QTBUG-69129 Change-Id: Ie4f96601b8b18cd496efbde7cf2557875cf3c1c9 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* tst_qprocess: enable test again for cross-compilationsSamuli Piippo2021-02-163-10/+1
| | | | | | | | | | | | All test cases pass with QEMU. Fixes: QTBUG-85287 Fixes: QTBUG-67760 Pick-to: 6.1 Change-Id: I188d70c05f6d858e17f1099d3c02862ea9b2a2ab Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* tst_qapplication: Prevent desktopaware test from deactivating main testTor Arne Vestbø2021-02-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Applications on macOS are automatically activated (put into the foreground), when launched from the Finder, or via 'open' on the command line. But when launched from the terminal, e.g. foo.app/Contents/MacOS/foo, the application will launch in the background (inactive). In Qt we override this behavior, activating the app even when launched from the terminal, as a convenience, as long as the application is a GUI application. Unfortunately this means that when tst_qapplication launches a subprocess that is a GUI app, it will steal activation from tst_qapplication, which in turn will break tests that later try to activate a window and check that the window is then active. The window will not be active until the application is active. We can work around it by preventing Qt from activating the application, but ideally we'd find a better solution to this, as we don't want to sprinkle overrides all over our tests. Fixes: QTBUG-90699 Pick-to: 6.1 6.0 5.15 Change-Id: If53a86548002b739df0c0a7153d6244924a4a205 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix QTimer::setInterval to remove existing bindingsAndreas Buhr2021-02-151-0/+4
| | | | | | | | | | A recent change ( a7ca8b1a2864e47cacd530f6b10d2b415c5193f7 ) led to failure of binding removal in setInterval(). This was fixed by introducing setterScope. This patch add unit tests for this regression. Change-Id: Ic8da1f2d82ad6c8ccd81c9b1eff72d42cf75f28a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Drop parsing of antique TextDate formatEdward Welbourne2021-02-151-43/+42
| | | | | | | | | | | | | | | | | | | | | | Apparently we used to have (back in 2007, only on Windows, incompatibly with what we were then using on Unix) a TextDate format (only for QDateTime, QDate used what it still uses) that put the day-of-month number, with a dot after it, before the month's short name. We have retained parsing of this format, on all platforms, ever since. It no longer matches the format we now use (since 5.2, in 2013, commit 61b56a89a1cf8a388ff925492700e5eef019c3aa, which harmonised the format with Unix and QDate); now seems like a good time to stop complicating our parser for its sake. [ChangeLog][QtCore][QDateTime] The parsing of Qt::TextDate in QDateTime::fromString() no longer supports the old TextDate format used (only) on Windows by Qt < 5.2 ("ddd d. MMM yyyy" with an "HH:mm:ss" time either appended or inserted before "yyyy"). Change-Id: I73a798ab78f187543e415119cc4a11f1cfd73820 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime::toString(): use UTC-offset as time-zone suffixEdward Welbourne2021-02-151-13/+2
| | | | | | | | | | | | | | | | | | | Since fromString() can't parse the (ambiguous at the best of times; also backend-dependent and thus potentially system-locale-dependent) abbreviations currently produced (since 5.9) and can parse UTC-based offsets, the OffsetName of the zone is a more robust format for the zone-suffix. This also makes it possible to consistently use the C locale, compatibly with everything else about post-6.0 date-time serialization. [ChangeLog][QtCore][QDateTime] When spec is Qt::TimeZone, the offset-suffix now used for the toString(Qt::TextDate) format is now a UTC-based offset string, compatible with the parsing (now) supported by fromString(). The zone-abbreviation suffix in use since 5.9 was not parseable. Change-Id: I4024ae87980c6d3590c68a67b8d1c8f433e36855 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Prepare TextDate to use UTC-offset rather than GMT-offset zone suffixesEdward Welbourne2021-02-151-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are GMT-offset zones whose convention for the sign of the offset is the reverse of what we are (still) using, which is the usual convention for UTC-offset zone: for example, the Olson Database's Etc/GMT+3 has offset -3 hours in the UTC-based system we use, so we give it suffix GMT-0300. The UTC-based suffix is also what we use as the abbreviation for OffsetFromUTC() in toString(). For now this only adds support for parsing a planned future form: the old form using GMT is retained, to give client code some chance to prepare for a backwards-compatible transition. Although the GMT prefix is matched case-insensitively, only match UTC if fully upper-case; there is no meaningful precedent for case-insensitive usage here. [ChangeLog][QtCore][QDateTime] The Qt::TextDate format now recognizes UTC-based offset suffixes in addition to suffixes based on the deprecated alias GMT. This prepares for toString() to use such UTC-based suffixes for time-zones (fromString() cannot parse the present abbreviation suffix). A future release of Qt shall use UTC-based suffixes in place of the present GMT-based suffixes (which conflict with GMT-based IANA zone names) for Qt::LocalTime and Qt::OffsetFromUTC time-specs. Client code is encouraged to use and recognize UTC-based zone suffixes in preparation for that transition, unless compatibility with versions before 6.2 is required. Change-Id: I5a42a488f1232a30f4b427b7954759283423b9b3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Extend colorspace testing and fix bug it uncoveredAllan Sandfeld Jensen2021-02-131-0/+119
| | | | | | | | | | When changing transferfunction the look-up-tables needs to be regenerated. Pick-to: 6.1 6.0 5.15 Change-Id: I83ca5fe570f85d478a374f52c0a82db84e70c3b8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Move QEMU emulation detector to QTestSamuli Piippo2021-02-1325-184/+40
| | | | | | | | | The emulation detection has been usable only on qtbase tests, move it to QTest so that it can be used in other modules as well. Pick-to: 6.1 Change-Id: I4b2321b7856414d7b1cfd5e6b1405a633c6bb878 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Disable warnings from using deprecated QScopedPointer::takeVolker Hilsheimer2021-02-131-0/+6
| | | | | | | | It's the QScopedPointer test, so we want to test deprecated APIs. Change-Id: I029103b3150c576cba9b395aafc571b9fccc914a Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix QImage::fill with semi-transparent QColorAllan Sandfeld Jensen2021-02-121-7/+31
| | | | | | | | | A few formats were not treating the input QColor correctly. Fixed and added more exhaustive test. Pick-to: 6.1 6.0 5.15 Change-Id: I872aeeb45e518f9a34b4ac35642264821f9927f2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Rework tst_QDateTime::toString_isoDate() to eliminate an XFAILEdward Welbourne2021-02-121-16/+17
| | | | | | | | | | | | | | | Instead of an XFAIL, actually test what we expect will happen for the test, namely that the milliseconds will be lost. In the process, verify that milliseconds since epoch also matches what was expected, change an "expecting empty" condition to check for the "invalid" test-case to which it's actually relevant and note that this test-case shall need amended when we update our ISODate support to the 2019 update, which extends the year range. Task-number: QTBUG-56552 Pick-to: 6.1 6.0 5.15 Change-Id: I680aa31ee0dcc8fadabb5d4cd6c083a8afd48573 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix tst_QDateTime::systemTimeZoneChange() for 32-bit systemsEdward Welbourne2021-02-121-18/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test verified that a LocalTime's time since Epoch changes when the system time-zone changes. This works when the QDateTime object is in short form and recomputes its offset from UTC every time it is needed, but fails with a pimpled QDateTime, as this caches its offset from UTC when it is created, saving the recomputation which - in the far more usual case where the system time-zone does not change in the lifetime of a QDateTime object - would normally produce the same result. Changed the test to use a newly-created QDateTime constructed with the same parameters, which doesn't have the cached out-of-date knowledge of its zone offset. Removed the XFAIL. Made the test data-driven and added test-cases: one so close to the Epoch that it should be short even on 32-bit systems, one so far that it's pimpled even on 64-bit systems (used in reproducing the issue in order to debug it). This then revealed that Android 5 doesn't seem to support the POSIX zone IDs used by this test, so it now verifies that LocalTime has the expected offset from UTC after zone changes, QSKIP()ping if not. Documented that the behavior of LocalTime is undefined after a change to the system time-zone. Cleaned up the existing doc of Qt::TimeSpec in the process. Fixes: QTBUG-89889 Pick-to: 6.1 6.0 5.15 Change-Id: I1058f47a1ff3ee1c326f3579ac80bd8bab242e28 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace QScopedPointer with std::unique_ptrVolker Hilsheimer2021-02-121-7/+7
| | | | | | | | Fix compile warning from QScopedPointer::take being deprecated. Change-Id: I7f86e08a5a1021263ee57898cbc1d5942ea3113b Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix compiler warning: don't mix signed and unsigned int in comparisonVolker Hilsheimer2021-02-111-1/+1
| | | | | Change-Id: Ib6609d70900a0c26dd88bbfd16e886773ae67420 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix compiler warning: initialize variableVolker Hilsheimer2021-02-111-2/+2
| | | | | | | The initialization happens outside the bechmarking loop. Change-Id: Id661fa2f995e964277a5c388b8fac13ff8687d92 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix registerNativeMethods for goodAssam Boudjelthia2021-02-113-0/+79
| | | | | | | | | | | | | | | | | The initial implementation and the commit c00ab6f8eaa3cdc9a29dd103c91b2eaf212cac9f was wrong: * env->findClass() in fact returns a global reference, and in any case we shouldn't be calling that, instead QJniObject would be enough. * The size param provided to env->RegisterNatives was wrong. * A test for registerNativeMethods() is added to ensure such break is not repeated again. Task-number: QTBUG-89633 Pick-to: 6.1 Change-Id: I4d3a6a9270755f465c40add25521fb750dd4de0a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* macOS: Be honest about the system localeTor Arne Vestbø2021-02-111-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The system locale of a macOS application is not affected by environment variables like LANG. Yet, we were reporting a name determined from environment variables as the fallbackUiLocale(), rather than one based on the language and country of the actual system locale. This lead, via the usual CLDR likely-subtag fallback, to claiming the system locale's name, language, script and country were those obtained from these environment variables, even when they were at odds with the actual locale being used by the system, which was being used for some queries. Worse yet, any data not supplied by these queries was being obtained from the same CLDR locale as the name, making for an inconsistent mix of locale data. While we cannot avoid the likely-subtag fallback step for fallback data, it is more consistent to use the actual system locale's name as start-point for that fallback. At the same time, add support for the language, script and country queries, so that the QLocale::system() describes itself faithfully, instead of claiming to be the locale that results from that fallback. If we want to support LANG or other environment variable overrides, they should be handled by the layer above the system locale, by changing the default locale of the Qt application, as if the user had called QLocale::setDefault(). [ChangeLog][QtCore][QLocale] QLocale::system() on macOS no longer pretends to support LANG or other environment variables as overrides, as this is not a feature that the system locale on macOS supports. To override the locale of an application, use QLocale::setDefault(), or pass -AppleLocale en_US. Fixes: QTBUG-90971 Change-Id: Ibdaf5ff9a2050f61233a88eabf3c29094f7757f1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Make QDate's text round-trip test do actual comparisonsEdward Welbourne2021-02-111-5/+7
| | | | | | | | Previously the only test was that it produced no warnings, if anyone paused to read the output to notice them. Change-Id: I225ca99c7ec316186702c0fdb355585374c014a4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix recently added auto test of text layout overflowEirik Aavitsland2021-02-101-1/+2
| | | | | | | | | Ignore width of trailing space. Pick-to: 6.1 6.0 5.15 Fixes: QTBUG-91038 Change-Id: I74e278366a2c3b170335738bf6d6ee23933b361a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Restore pre-Qt6 QList::fill() behaviorAndrei Golubev2021-02-101-7/+63
| | | | | | | | | | | | | | | | | | Somehow QList::fill(t, newSize) introduced a regression in Qt6: when newSize < QList::size() we should resize to the newSize. This is aligned with QVector::fill() in 5.15 and std::vector::assign() While 6.0 is already out, picking it to 6.0.x could save someone who haven't migrated yet as well as fix some accidental bugs in Qt's code [ChangeLog][QtCore][QList] Fixed QList::fill() regression introduced in 6.0: calling fill() with size < current list size wouldn't truncate the list Fixes: QTBUG-91042 Pick-to: 6.0 6.1 Change-Id: Ic166e2c5e42390b61df1030f7c705e344433f7f2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Split up the QMetaType unit testVolker Hilsheimer2021-02-097-915/+969
| | | | | | | | | | | gcc 9 consumed enourmous amounts of memory building the test, regularly dying on a VM with 4GB RAM. Splitting it up helps. As a drive-by, use inline static variables, and rename the header used by other tests to tst_qmetatype_common.h. Change-Id: Ib716d8e3506aac6c87845e57b04cb1a4f6c68387 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QTextureFileData: support key value metadataJonas Karlsson2021-02-094-0/+19
| | | | | | | Task-Id: QTBUG-76970 Pick-to: 6.1 Change-Id: I9dba1b373250cea4d0c806997290a7afcdc900d7 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Clarify what QSystemLocale::fallbackLocale() is used forTor Arne Vestbø2021-02-091-1/+1
| | | | | Change-Id: I8f073f996505ccb42020b32fd76520ecef54e628 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QPlainTextEdit: adjust scroll bars when showing upWang Chuan2021-02-091-0/+32
| | | | | | | | | | | The text of QPlainTextEdit might change when it is invisible, so an adjustment of scroll bars is needed when the QPlainTextEdit showing up, otherwise the range of scroll bars might be incorrect. Fixes: QTBUG-77937 Pick-to: 5.15 6.0 6.1 Change-Id: I45c686c7e09ca7b2944c36122e9157de0ec4f0e0 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Blacklist tst_macgui::scrollBarPainting()Tor Arne Vestbø2021-02-081-0/+3
| | | | | | | | | It fails on 10.15 and 11, preventing those from being significant, and the test is already marked as expect-fail based on QTBUG-20984. Task-number: QTBUG-20984 Change-Id: I6911166a1c3e9173d6d36f2a3a68b37778fd3406 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Handle macOS 11 issues in softHyphens testAllan Sandfeld Jensen2021-02-081-17/+42
| | | | | | | | | | Calculate the effective width of the hyphen better, and compare with ceiled sizes. Pick-to: 6.1 6.0 Fixes: QTBUG-90698 Change-Id: I7ed2eb44c54240ecb2f8a38e5acf1f32608b2bfb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Switch QNetworkInformation manual test back to using qDebugMårten Nordheim2021-02-071-17/+8
| | | | | | | | | | | | It turns out QTextStream on Android isn't as easily visible as it is when going through qDebug (where it can easily be seen with `adb logcat -v brief libqnetworkinformation_<arch>.so:* -s`) Change-Id: I3b495d7a3d331fda6cfe602c461107dd1d0b3faf Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 677797929d8080199990d741773832f80a654265) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove QNetworkStatusMonitorMårten Nordheim2021-02-061-52/+13
| | | | | | | | | | Since the old code is now fully integrated in QNetworkInformation backends Change-Id: Ia843d17bb3c98333e8d68752e25722b5860f48e0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 7860b9e6ffece207d054ac0c321bc3c5b983708f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qtexttable: fix fail on QEMU ARMv7Samuli Piippo2021-02-051-1/+1
| | | | | | | | | | | Different font was used when running on QEMU ARMv7 and the second page was never reached. Pick-to: 6.1 Task-number: QTQAINFRA-4127 Change-Id: Ic85b76661cf3642b69e6e1b21e8062d7c36231e3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Fix flakiness in tst_QGlyphRun::drawRightToLeftEskil Abrahamsen Blomfeldt2021-02-042-6/+0
| | | | | | | | | | | | | | | | As described in 3279c8e7d72c5eee379fa8e4a2789acfe40445c0, we can't depend on the widths of decoration to always be the same for drawText() and equivalent drawStaticText/drawGlyphRun. This is typically visible as an off-by-one when using the default fonts on OpenSUSE. Since this test was actually made to test positions of RTL glyphs, we can just disable the decoration and simplify the text. Fixes: QTBUG-89086 Change-Id: I139fe3e1c5e98d8b1d7e0e7c19645fd4717d1d95 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* a11y: Report mixed state if QCheckBox is PartiallyCheckedJan Arve Sæther2021-02-043-3/+7
| | | | | | | | | | Previously it only returned checked or unchecked for a tri-state checkbox. Fixes: QTBUG-84616 Pick-to: 5.15 6.0 6.1 Change-Id: Ife72098e35f8295fd389bda232de5478ffa7e87f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix QMetaType benchmarkFabian Kosmale2021-02-041-3/+5
| | | | | | | | The benchmark used to crash because QMetaType::typeName would return an empty string, which is not a legal value for newRow. Change-Id: I9e6c6c1cf153943bfa21181cd2cca596a7943ea0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* tst_qdatetime: remove blacklisting and expect failureSamuli Piippo2021-02-042-4/+4
| | | | | | | | | Amend ac970d48fdd35b03686d4c77d955875d6e8b1d68 and use QEXPECT_FAILURE for systemTimeZone test on 32bit systems. Task-number: QTBUG-89889 Change-Id: I0eed35df871c69a20bcd7c544fc0e9a48dd8db7b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix compiler warning in QNetworkReply testVolker Hilsheimer2021-02-031-2/+2
| | | | | | | | Clang warning: 'isSequential' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] Change-Id: I1a7c5516d2656469eab556e7f9d310192510b99b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove false Q_UNREACHABLE from shaping codeEskil Abrahamsen Blomfeldt2021-02-032-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was added by 9ff76c27b9031ae7c49c4c9e8b5a3bea1e0e3c78 on the basis that it signifies a shaping error and would later assert or crash. But the line is easily reachable by user code. If Harfbuzz returns 0 glyphs, it just means it is unable to shape the string, for instance if the input string only contains default ignorables (like a ZWJ) and does not have any appropriate glyph to use for replacement. Qt expects there to always be at least one glyph in the output (num_glyphs == 0 is used to indicate shaping is not yet done), so to avoid asserts later on, we simply populate the output with a single 0 token, which is a required entry in the font that is reserved for representing unrepresentable characters. This also adds a test and therefore a zero-width joiner to the test font to reproduce the issue. [ChangeLog][QtGui][Text] Fixed a possible crash with certain fonts when shaping strings consisting only of control characters. Fixes: QTBUG-89155 Pick-to: 5.15 Pick-to: 6.0 Change-Id: Ia0dd6a04844c9be90dcab6c464bebe339a3dab11 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Optimize RGBA64->RGBA64PM for SSE2/AVX2Allan Sandfeld Jensen2021-02-031-0/+5
| | | | | | | | And remove the direct conversion so we can get both the SIMD optimization and threading applied. Change-Id: Id032ea91cc40c1cbf1c8a1da0386de35aa36cfb5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix a few compiler warnings in testsAllan Sandfeld Jensen2021-02-0211-42/+37
| | | | | Change-Id: I22f6ac8ed02dd4ef4083ce3c781552623a0b08da Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* NetworkListManager based backend for QNetworkInformationMårten Nordheim2021-02-023-0/+72
| | | | | | | | | | For Windows. Based on the code I wrote for QNetworkStatusMonitor. It also renames the netlistmgr feature, avoiding the abbreviation. Locally my MinGW fails the networklistmanager feature test so it may not be supported on MinGW, likely leaving it without a backend at all. Change-Id: I13bbe4127edc2a9c0bb91602c95f1cb206a85a69 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Purge various BLACKLIST entries that are now fixedEdward Welbourne2021-02-025-21/+0
| | | | | | | | | | | | | Based on BPASS results from recent test-runs. Task-number: QTBUG-69131 Fixes: QTBUG-87416 Fixes: QTBUG-87662 Task-number: QTBUG-87663 Fixes: QTBUG-88705 Change-Id: I8ebe014517bfa8d124e86b821650b07c591ea16e Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Remove qmake project files for benchmarksJoerg Bornemann2021-02-01144-1058/+0
| | | | | | | | Also remove tests/tests.pro that would be empty without the benchmarks. Change-Id: Iaf92a729d1286b3e0c03bf9f877b59e1d83708e6 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Support cubemap ktx filesJonas Karlsson2021-02-014-0/+22
| | | | | | Change-Id: I6905c393647d31fab958cdd9471bb0a6ffe83596 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix handling of Sunday in POSIX time-zone rulesEdward Welbourne2021-02-011-11/+18
| | | | | | | | | | | | | | | | | | | | | Dating from the origins of our support for the zoneinfo file format, the mapping of POSIX's day-numbering (0 = Sunday through 6 = Saturday, see [*]) to Qt's (1 = Monday through 7 = Sunday) was done by mapping 0 to 1, when it should have been 7. [*] http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html Corrected a QTimeZone test that trusted the results it got without checking which day of the week those were: they were all Mondays. Verified that the corrected dates are in fact Sundays. Checked the zone abbreviations, too. Fixes: QTBUG-90553 Pick-to: 6.0 5.15 Change-Id: I84b4b14f9892ff687918cd3c42c7c9807e45313c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Remove QObjectCompatProperty::operator= for safer usageAndreas Buhr2021-01-291-11/+11
| | | | | | | | | | | | | Introduction of QObjectCompatProperty requires every write to the property to be examined whether it is OK or should be replaced by a setValueBypassingBindings/markDirty combination. The existence of operator= make this difficult as it is easy to miss places where it is written. By not having operator=, we can help developers make sure they had a conscious decision about each write to the property. Change-Id: Ia61ea4722eb0bab26ce7684b85dd03d710cd1751 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Revert "Port QThreadPool to the new property system"Allan Sandfeld Jensen2021-01-291-78/+14
| | | | | | | | | | This reverts commit 8f8405e04642b98663d4752d4ae76c304ae33b01. Reason for revert: Appears not entirely thread-safe and caused QTBUG-90705 Change-Id: I390c0b1a555a18e6a095b52010371d017071e26b Fixes: QTBUG-90705 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>