summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Unblacklist tests that are no longer flakyDimitrios Apostolou2022-08-171-4/+0
| | | | | | | | | | | Couldn't reproduce flakiness on OpenSUSE KDE/X11 and can't see any history of flakiness in the last 3 months in our testresults database. Task-number: QTBUG-62967 Task-number: QTBUG-63262 Change-Id: Id50291798eda922283e04b45205ae9105e9fdab2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Stabilize test by not activating windowDimitrios Apostolou2022-08-172-8/+2
| | | | | | | | | | | | | | Window activation is not working reliably on X11 when combined with X11BypassWindowManagerHint, see QXcbWindow::requestActivateWindow(). The test itself counts repaints, so qWaitForWindowExposed() shouldn't be needed. This way we don't need to QSKIP() the test if window activation fails. Fixes: QTBUG-98921 Change-Id: I849b7261c757fb7cbcde73f11bbe1a74a862cb9c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Update BLACKLIST for tst_qgraphicsviewDimitrios Apostolou2022-08-171-14/+2
| | | | | | | | | | | | | Removed entries that do not reproduce on OpenSUSE and that are no longer flaky in our CI according to our testresults statistics database. Adjusted entry for resizeAnchor testcase which has been seen flaky in RHEL-8.4 and cursor2 which is very flaky on macOS. Task-number: QTBUG-105249 Task-number: QTBUG-105247 Change-Id: I3e258f81d6bbf540a4b3dec763fdfd4bdc511847 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Unblacklist tests that are no longer flakyDimitrios Apostolou2022-08-171-5/+0
| | | | | | | | | Can't reproduce in OpenSUSE, and no flakiness has been seen in the past 6 months in our testresults statistics database. Task-number: QTBUG-63260 Change-Id: I465aa4b9f82726e9685f64b0dc235d3235c4bd9c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix testcase that fails when run individuallyDimitrios Apostolou2022-08-171-1/+1
| | | | | | | | | | | | | | | | Executing the tst_qgraphicsitem::sorting() testcase individually always fails on my KDE/X11 desktop. The window never seems to have focus and the call to qWaitForWindowActive() returns error after a few seconds. It seems qApp->setActiveWindow(&view) never succeeds in giving focus to the window containing the widget. Fixes: QTBUG-105221 Task-number: QTBUG-74760 Change-Id: I148dab09d0fb592376b3902e4ed10799f9a52274 Done-with: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* qdbusxml2cpp: remove the old "In"-for-signal compatibility codeThiago Macieira2022-08-162-31/+105
| | | | | | | | | | | | | | | This led to an infinite recursion in case the annotation was completely missing. Instead of trying to fix that, I'm simply implementing the "### Qt6" request from c62f71722639c39f210ddbec0c4d832521b3f187 . [ChangeLog][qdbusxml2cpp] Removed the old compatibility code that accepted "In" annotations for signal argument names, introduced in Qt 5.8. Pick-to: 6.4 Fixes: QTBUG-104722 Change-Id: Ie4bb662dcb274440ab8bfffd1709bfc3daf0846d Reviewed-by: David Faure <david.faure@kdab.com>
* Maintain the window z-order properly in wasm compositorMikolaj Boc2022-08-162-0/+277
| | | | | | | | | | | | | The old stack structure used to keep track of windows has been improved to conform to the actual windowing assumptions: there shall be one root window, which is always at the bottom. The first created window immediately becomes the root window. Should the root window be removed, all windows are non-root, i.e. any of them can become the top-level window Fixes: QTBUG-105094 Pick-to: 6.4 Change-Id: Ic553244fa9f5bc3ee590b702935e66cfc62d5f8f Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* rhi: tst_qrhi: Check for OpenGL cap on the platformLaszlo Agocs2022-08-161-37/+11
| | | | | | | | | | | | | | | | | | | | | | | Running tst_qrhi -platform eglfs will pass on RPi4 / Mesa 22. This does not test Vulkan of course since the platform plugin cannot create a Vulkan instance. Running tst_qrhi -platform vkkhrdisplay will enable Vulkan but will still try OpenGL since the autotest does not query the platform integration about OpenGL support. Make this nicer by skipping most of the GL test if the platform integration we have cannot handle OpenGL stuff anyway. For some tests the data-driven approach has to be removed since doing QFETCH without any rows will crash. These two OpenGL-specific tests now check OpenGL support directly and QSKIP if needed. While we are at it, fix up the Vulkan instance API version as well. Pick-to: 6.4 Change-Id: I2891c04540bc2dfd0ccf475629bd23542bff15f5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Update QTimeZone benchmark's list of tested zonesEdward Welbourne2022-08-161-9/+16
| | | | | | | | | | | It purports to be a list of those named in QDateTime's tests, but was a bit out of date. In the process, sort them into somewhat coherent order (to make it easier to verify whether one is missing next time I check) and reformat. Pick-to: 6.4 6.3 6.2 Change-Id: I16e7ded6f8b00e226513bd06d6174a79f7a0c675 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_qbytearray: remove qCompress_data for QT_NO_COMPRESSMarc Mutz2022-08-151-2/+2
| | | | | | | | | The _data function is useless without its test function (and it's not used in other _data functions). Pick-to: 6.4 6.3 6.2 5.15 Change-Id: I7aa6006ed1a9d89008577b750af4ea717dae237f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix QFontDatabase::hasFamily() for ambiguous familiesEskil Abrahamsen Blomfeldt2022-08-152-4/+5
| | | | | | | | | | | | | | | | | | | | | | | If a font family has several instances from different foundries, we disambiguate this by adding the foundry name in brackets behind the family. But QFontDatabase::hasFamily() would only check for families().contains(familyName). So if the database contains e.g. Foo [Bar] and Foo [Baz] then a check for hasFamily("Foo") would fail. So we need to actually check for the family name instead. In doing this, we also skip the extra step of building the list and then searching it, but just go directly to the source. This removes the BLACKLISTing of Ubuntu and also introduces a QSKIP on Unix-based platforms without fontconfig, since there is no way to know which default fonts are acceptable on those platforms. Pick-to: 6.4 Fixes: QTBUG-86967 Change-Id: Id8ad80a1671daf1c14fbad8bb8f4c51ee1c59709 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* rhi: d3d11: Enable tessellation and geometry with some caveatsLaszlo Agocs2022-08-1512-4/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | The caveat being having to manually create HLSL versions of the hull, domain, and geometry shaders in parallel with the Vulkan GLSL ones, while keeping the interfaces intact (stage inputs and outputs, cbuffer layouts, binding points/registers). This is not always trivial but typically doable in not very complicated case after inspecting the SPIRV-Cross-generated vertex/fragment code in the .qsb files. Once written, the HLSL files can be injected into a .qsb file with qsb -r. or the corresponding CMake syntax. Conceptually this is no different from how samplerExternalOES support is implemented for Multimedia. (there the problem is that the shaders cannot be compiled to SPIR-V to begin with, here it is that we cannot translate from SPIR-V, but in the end the workaround for both problems is effectively the same) The manual tests demonstrate this, both the tessellation and geometry apps work now with D3D out of the box. On the bright side, the implementation here in the the D3D backend of QRhi does not need to know about how the shaders got there in the QShader. So none of the implementation is dependent on this manual process. If some day qsb would start translating to these kind of shaders as well, it would all still work as-is. Change-Id: I32d9ab94e00174e4bd5b59ac814dfedef9f93ad1 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix DeferredFlag implementation for QTestEventLoopEdward Welbourne2022-08-121-4/+12
| | | | | | | | | | | As discovered in the expanded testing of QTRY_COMPARE() using the same class, the timer needs a context object and a slot to call. This amends commit 35ad157d88c7bfcb9b90b01111b0f43dd2e012d9 Pick-to: 6.4 6.3 Task-number: QTBUG-104441 Change-Id: I41fc23de84ce8c7d6608db0005276a2071974494 Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Test QTRY_COMPARE() and expand testing of QTRY_VERIFY*()Edward Welbourne2022-08-127-36/+180
| | | | | | | | | | | | | In the process, simplify the latter while adding some actual time-variation for the QTRY_* loop to navigate round - based on the extendedcompare test's ClassWithDeferredSetter. Testing remains primitive, but is at least a bit more thorough. Pick-to: 6.4 Change-Id: I40be8fb485f3f18f0a4f4bc62ad36cccac691979 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Remove the stale expected_crashes_[345].txtEdward Welbourne2022-08-123-16/+0
| | | | | | | | | | | These contain output only ever sent to stderr, which tst_selftests no longer looks at; it merely verifies stderr is empty for all tests except those expected to produce stderr output, and ignores the stderr output for these last. Change-Id: I50fee445d84c2d125e6db5303fc389e87746455e Reviewed-by: Jason McDonald <macadder1@gmail.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QMetaType: don't use global relocations to the lambdas and structuresThiago Macieira2022-08-121-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | The way the Qt 6.0 QMetaTypeInterface was designed, using a static inline variable in a template, would normally require the linker and dynamic linker to merge all copies and choose a single copy as the official one. But because of hidden visibility and of Windows DLLs, QMetaType already copes with multiple copies NOT getting merged. So we may as well ask the linkers not to bother and use simpler, local relocations to find those symbols. They are all supposed to still be equivalent and it's an ODR violation if they're not. The Apple ld64 linker complains if you use this type of global relocation: ld: warning: direct access in function [...] to global weak symbol 'QtPrivate::QMetaTypeInterfaceWrapper<int>::metaType' Fixes: QTBUG-93471 Pick-to: 6.3 6.4 Change-Id: Id0fb9ab0089845ee8843fffd16f98a10aa719434 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QMetaType: add a test to confirm that types are equal across librariesThiago Macieira2022-08-127-5/+193
| | | | | | | | Because of the template shenanigans. This is just to make sure. Pick-to: 6.4 Change-Id: Id0fb9ab0089845ee8843fffd16f989e7d555894f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use the local file APIs to save/load files on WASMMikolaj Boc2022-08-125-46/+650
| | | | | | | | | | | | QFileDialog::saveFileContent, QFileDialog::getOpenFileContent are now using local file APIs to access files on any browser that passes a feature check. The feature is thoroughly tested using sinon and a new mock library. Task-number: QTBUG-99611 Change-Id: I3dd27a9d21eb143c71ea7db0563f70ac7db3a3ac Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Wait for window focus instead of expose eventDimitrios Apostolou2022-08-112-3/+1
| | | | | | | | | | This fixes the flakiness seen in OpenSUSE KDE/X11 desktop. Fixes: QTBUG-70590 Task-number: QTBUG-105177 Change-Id: I7c2431e58b2a60ea04e26d4e70c0f2867d544ff2 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Try to stabilize window activation on macOSDimitrios Apostolou2022-08-101-14/+30
| | | | | | | | Use activateWindow() that is documented as the right way to raise a window. Task-number: COIN-892 Change-Id: Ic9aadee0d3a526fd8e46e5b1099b5b0861700207 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Test is stable on OpenSUSE, un-blacklist itDimitrios Apostolou2022-08-101-1/+0
| | | | | | Task-number: QTBUG-74760 Change-Id: I78ca3779407d1076a11d0a948b61f4438d1ab4cc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Test is no longer flaky, unblacklist itDimitrios Apostolou2022-08-101-2/+0
| | | | | | | | | | I can't reproduce the test failing after hundreds of iterations on OpenSUSE, and the test hasn't flaked at all in our CI in the last 6 months according to our dashboards. Fixes: QTBUG-70612 Change-Id: I2397f3db5caf97f674de7d75fd99bd14c14166a4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Test is not flaky any longerDimitrios Apostolou2022-08-101-4/+0
| | | | | | | | | | I can't reproduce the issue after hundreds of iterations on OpenSUSE, and the test hasn't flaked at all in the last 3 months according to our dashboards. Task-number: QTBUG-66371 Change-Id: I9c4daf851e09fbcb47a6ab39418e7b213ccd9dfe Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove assertion from ownMethodIndex that breaks testsSami Shalayel2022-08-101-0/+39
| | | | | | | | | | | | | | | | | | | | ownMethodIndex works for all kind of methods, also for constructors. Therefore, remove the assertion there (that checks for non constructors) and add a test in qtbase so it does not happen again. The test broken by the assertion is in qtdeclarative: tst_QJSEngine::newQMetaObject(). Also rename QMetaMethodPrivate::ownConstructorIndex() to ownConstructorMethodIndex() as the previous naming implied that ownMethodIndex() could not be used for constructors. amends b73ab954dffffc462b6f6efe5a2dd97efeab0038 Task-number: QTBUG-105360 Change-Id: I0244993ed79bee055645b5443f5d02e1c089a6c6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Tests: remove #define COMMAThiago Macieira2022-08-092-13/+12
| | | | | | | | | | Those were workarounds to passing a comma to a macro, but there are ways around it. The simplest is to just use variadic macros; another, which has been applied to Q_DECLARE_METATYPE for a long time, is to define an alias to the thing you're trying to use. Change-Id: Ie4bb662dcb274440ab8bfffd17097fbf0c53eabc Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* CMake: Support big resources in qt_add_resourcesJoerg Bornemann2022-08-0910-0/+137
| | | | | | | | | | [ChangeLog][CMake] The target-based variant of qt6_add_resource gained the option BIG_RESOURCES. This can be used instead of qt6_add_big_resources, which is not target-based. Fixes: QTBUG-100268 Change-Id: Ib3fa783cbfbfd10f59c2f952bc88508a91f25e26 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Wayland: Remove XFAIL after underlying bug was fixedEskil Abrahamsen Blomfeldt2022-08-091-2/+0
| | | | | | | | | | The intialSize bug has been fixed in Qt Wayland Client, and thus this test will now start XPASSing. Pick-to: 6.4 Task-number: QTBUG-66818 Change-Id: I4b9cb8bd9306a67f04295eb23f09574dad0e97f7 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Add some testing of QTestEventLoopEdward Welbourne2022-08-0810-2/+333
| | | | | | | | | | | | Fairly minimal for now, just enough to verify a bug and serve as the sign of success when it's fixed. Tests fail in ways they shouldn't, for now; see expected_eventloop.* for details, notably "Earlier test failed to clean up" messages. Pick-to: 6.4 6.3 Task-number: QTBUG-104441 Change-Id: I59be4aa5f21fed23b19a0593a8c2f6c9956507df Reviewed-by: Jason McDonald <macadder1@gmail.com>
* tst_qimage: skip exifReadComments when the feature is not activeJanne Juntunen2022-08-081-0/+3
| | | | | | | | | | We need to skip the exifReadComments test case if reading text from image has been configured off, like in webOS's Yocto recipe for QtBase. Fixes: QTBUG-105393 Pick-to: 6.4 Change-Id: If45872ca7ed26620fa38bc6b47132363d661acdc Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Don't skip QDoubleConverter's digit-count check for non-whole boundEdward Welbourne2022-08-081-0/+1
| | | | | | | | | | | | | | | | Using convertDoubleTo() to get a whole number, from which to determine the number of digits we're allowed before the fractional part, fails if the double isn't a whole number, which lead to the skip being checked. Use qFloor() of the double (as this should have as many digits as the double had before its decimal point, which is what we care about; qCeil() might round up to a power of ten). This amends commit ff6d2cb0d5779d81e89d94d65c8d164602fa2567 Fixes: QTBUG-105341 Pick-to: 6.4 6.3 6.2 Change-Id: I4e0105d4602682c59e9830ec9a37556c96db884e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* wasm: add event loop auto testMorten Sørvig2022-08-087-1/+352
| | | | | | | | | | Add basic tests for timers and event processing, for different use cases such as on the main thread, on a secondary thread, and with asyncify. Pick-to: 6.4 Change-Id: Ie0f82b5de97f639867b1e65dbb0ab8b11db86f85 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Remove blacklist of tryAcquireWithTimeout on WindowsAllan Sandfeld Jensen2022-08-071-6/+0
| | | | | | | Hasn't failed on Windows in months Change-Id: Id14eaead667dfba93807592a7e0cb4da7f91f16f Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* qputenv: port to QByteArrayViewMarc Mutz2022-08-068-16/+16
| | | | | | | | | | | | | | | | | | | | The vast majority of in-tree users pass simple and short C string literals as the value. By porting to QByteArrayView, we document that we'll accept non-NUL-terminated data, and do the NUL-termination internally, using SSO'ed std::string, saving memory allocations in the common case of short strings. I didn't bother to check which direction std::string takes for nullptrs these days (there was a change accepted in that area for C++20 or 23), so play it safe and protect against them. Follow-up to Task-number: QTBUG-105302 Change-Id: I2369acc62f1d5cbc26135396cfe0602d8c75300c Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* tests: add a textfield in qt-client-widgetLiang Qi2022-08-062-0/+13
| | | | | | | To test drag and drop. Change-Id: I609c7edebea3af7763ec53fdbb7257a4b89371b9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tests: make xembed/qt-client-raster betterLiang Qi2022-08-062-1/+3
| | | | | | Pick-to: 6.4 6.3 6.2 5.15 Change-Id: Id45bcfb92eb24c4455cf50497e28312eb87e0f9a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tests: make xembed/qt-client-widget betterLiang Qi2022-08-062-1/+5
| | | | | | | | | | See also QX11EmbedWidget::QX11EmbedWidget() in src/gui/kernel/qx11embed_x11.cpp in qt4. https: //github.com/qt/qt/blob/4.8/src/gui/kernel/qx11embed_x11.cpp#L475-L477 Pick-to: 6.4 6.3 6.2 5.15 Change-Id: I47504a2d8f3e33c367f092d01ee5d7e1b16b5106 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tests: replace gtk-embedder.py with a gtk3 appLiang Qi2022-08-0619-92/+122
| | | | | | | | | All linux CI machines have gtk3 installed. And Python GTK things are too complicate to setup. Pick-to: 6.4 6.3 6.2 5.15 Change-Id: I3c0d967f61aebea508784df79569b9d0064f66e2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Declare logging category exported in tst_QDockWidgetAxel Spoerl2022-08-051-6/+0
| | | | | | | | | | | | The logging category lcQpaDockWidgets was explicitly declared in tst_QDockWidget. That failed to complile on static builds. This patch replaces the explicit declaration with Q_DECLARE_EXPORTED_LOGGING_CATEGORY(lcQpaDockWidgets, Q_WIDGETS_EXPORT) Pick-to: 6.4 6.3 6.2 Change-Id: I1cad0e672313be84297eeddf992f6cafe9a35977 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* qputenv: defend against non-NUL-terminated QByteArray valuesMarc Mutz2022-08-051-1/+5
| | | | | | | | | | | | | | | | | | | | | | | The old code assumed that a QByteArray's data() is always NUL-terminated. Due to the conflation of owners and non-owners in QByteArray (but also in case we ever get efficient substringing), this is not always the case, e.g. QByteArray::fromRawData() does not ensure NUL-termination. From QString::utf16(), we learn that the condition to check for is QArrayData::isMutable(). After working around the fact that QByteArray::data_ptr() doesn't exist for const QBAs and that empty QBAs always refer to QByteArray::empty_, which is !isMutable(), we can detect this situation and re-allocate without introducing new API. This is the fix for Qt ≤ 6.4. For Qt 6.5, we'll port the function to QByteArrayView. Pick-to: 6.4 6.3 6.2 5.15 Fixes: QTBUG-105302 Change-Id: I3416535ab09d601e0e87b2767f2c024ba1217e64 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: Fix mockplugins test not to fail in a non-prefix buildAlexandru Croitor2022-08-051-5/+10
| | | | | | | | | | Explicitly running the install step would fail in a non-prefix build. Do it conditionally on the no_prefix feature. Pick-to: 6.4 Change-Id: I78cd63f51c499a0df451b08290c6dfc84e52666c Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* tst_QFocusFrame: fix -WparanthesesMarc Mutz2022-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Says Clang 10: tst_qfocusframe.cpp:73:28: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] QTRY_VERIFY(focusFrame = window.findChild<QFocusFrame *>()); ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [...] tst_qfocusframe.cpp:73:28: note: place parentheses around the assignment to silence this warning QTRY_VERIFY(focusFrame = window.findChild<QFocusFrame *>()); ^ ( tst_qfocusframe.cpp:73:28: note: use '==' to turn this assignment into an equality comparison QTRY_VERIFY(focusFrame = window.findChild<QFocusFrame *>()); ^ == Amends f1812aad895ed2b8337a6d98d05623714680aba9. Pick-to: 6.4 6.3 6.2 5.15 Change-Id: I3920ab0da725b76fb6c19bbc7cde7920f351af4a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Add Latin 1 case-insensitive Boyer-Moore searcherØystein Heskestad2022-08-041-0/+104
| | | | | | | | | | The std::boyer_moore_searcher is buggy for older verions of Microsoft's STL, and missing in AppleClang's libc++ with an inefficient fall back. Fixes: QTBUG-100236 Change-Id: Ic3cc916946546d2ef78456cd15e1425d957b989d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QDomDocument: Add a way to enable spacing-only text nodesSona Kurazyan2022-08-041-0/+61
| | | | | | | | | | | | | | | | Added a parse option that can be passed to setContent(), to specify that spacing-only text nodes must be preserved. [ChangeLog][QtXml][QDomDocument] Spacing-only text nodes can now be preserved by passing the ParseOption::PreserveSpacingOnlyNodes option to setContent(). Fixes: QTBUG-104130 Fixes: QTBUG-89690 Task-number: QTBUG-90003 Change-Id: Id43730ce5b79a856c4b434d1f1d4dd7c49c25f31 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix initialization of QDateEdit and QTimeEditEdward Welbourne2022-08-041-2/+0
| | | | | | | | | | | | Since 6.3 these use Qt::UTC as time-spec but I neglected to take that into account in QDateTimeEditPrivate::init()'s construction of a QDateTime from the QDate or QTime. This amends commit c00ee2f31013e99c79b820a0db57003c110a5510. Fixes: QTBUG-105322 Pick-to: 6.3 6.4 Change-Id: I11dec9808a54cf7da401b1734a9a2812f5fd2e63 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix handling of invalid input to Q(Date|Time)Edit constructorsEdward Welbourne2022-08-041-2/+1
| | | | | | | | | | | Change to match how QDateTimeEdit()'s overloads taking a QDate or QTime work, substituting a default value in place of an invalid one. This fixes one surprising anomaly in a recently-extended test, so that it now only fails the way I expected. Task-number: QTBUG-105322 Change-Id: Ied4da6160b7efe70990f956798fb826b5b36d8bb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Expand QDateTime edit constructor tests to cover Q(Date|Time)EditEdward Welbourne2022-08-041-20/+51
| | | | | | | | | | | | | | The constructor_qdate() and constructor_qtime() tests only tested QDateTimeEdit with a QDate or QTime. Extend them to also test QDateEdit and QTimeEdit constructors, respectively. This revealed one surprise; the QDateEdit constructor doesn't replace an invalid QDate with the usual start-date, as the QDateTimeEdit does. It also serves to reproduce a bug reported in Qt 6.3, see Task-number. These are all marked XFail for now. Task-number: QTBUG-105322 Change-Id: Ifafb40a9b78d9314b74ca9a1710d362b9a3cb18d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Simplify the data tables for some QDateTimeEdit constructor testsEdward Welbourne2022-08-041-75/+30
| | | | | | | | | | | | | | | | | | It makes no sense to pass, as parameters, values that can't vary between test data rows, so eliminate m{in,ax}imum{Dat,Tim}e columns. There were no parameters used to control how those would be set, so they were always going to be the type's defaults. The displayDateTime was only needed for the invalid test, in which its value is known and fixed; for the normal test it was necessarily implied by the parameter used to initialize the QDateTimeEdit. While the QDate and QTime tests do have to supplement that construction information, the other part is again known and fixed. We can check the data-tag against "invalid" to determine which known and fixed data to use, saving the need for a data table column. Change-Id: I3754ba1a6a127a4a872a7f4a3e7edad9a5ff0ec0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* moc: handle attributes in class declarationsFabian Kosmale2022-08-031-1/+1
| | | | | | | | | | | | We already had code to handle attributes on funtcions, but we didn't handle them correctly for classes so far. Fix this by simply skipping over the attribute. Fixes: QTBUG-105310 Pick-to: 5.15 6.2 6.3 6.4 Change-Id: Ic4149f940e74820de4f2fa9540d9dc5b4e626a3a Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Improve QDomDocument::setContent() APISona Kurazyan2022-08-031-2/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new setContent() overloads, that: - take parameter of new ParseOptions enum type for specifying the parse options that can be used for enabling namepsace processing and, in future, whitespace-only text nodes, etc. - use ParseResult for returning the information about error message, line and coulmn number, instead of three parameters for each. - use QAnyStringView for a QString input data. To avoid ambiguities when calling setContent() with one argument, removed the default argument for errorString from all the overloads. [ChangeLog][QtXml][QDomDocument] Added new setContent() overloads that allow specifying different parse options through ParseOptions flags. These overloads use a new ParseResult struct for returning the information about an error, and QAnyStringView for passing string input. [ChangeLog][QtXml][QDomDocument][Potentially Source-Incompatible Changes] setContent() overloads that take only one argument now return ParseResult instead of a bool. ParseResult explicitly converts to bool, so the expressions calling setContent() with one argument will continue compiling, if they are contextually convertible to bool. If an implicit convertion is required (e.g. bool b = doc.setConetnt(data)), the result needs to be explicitly converted to bool first (e.g. bool b = bool(doc.setConetnt(data)). Task-number: QTBUG-104507 Change-Id: If6a78f8c9b1458f0e3ae719bfd3703a0b965449c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Rearrange the skipping of a test to give a better messageEdward Welbourne2022-08-031-2/+4
| | | | | | | | | | When tst_QDateTime::fromStringStringFormat_localTimeZone_data() skips due to feature timezone being undefined, it should report that as the issue, rather than claiming the system doesn't support the particular zones used in the test. Change-Id: I9837ac95c6d92317fbec7fcca184f7b7e6f81441 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>