summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix OpenGL vs. GLESv2 linkage, attempt number threeSimon Hausmann2019-06-051-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | We introduced WrapOpenGL to link against either desktop GL or GLESv2 depending on the GL feature in QtGui. This works "fine", with two caveats: (1) find_package(WrapOpenGL) must be called after find_package(Qt5Gui) in order for the feature check in FindWrapOpenGL.cmake to work. That's error prone. (2) More and more places are popping up, in particular examples, where GL linkage is required due to inline functions in Qt that forward to GL functions - such as on Android. This in particular explains the qmake behavior of making the GL linkage (desktop _or_ GLES) a public dependency of QtGui, so only Gui linkage is required. Those two aspects combined are the nail in the coffin of FindWrapOpenGL and it would seem much easier to simply make the Desktop GL vs. GLES decision once in Gui's CMakeLists.txt and let Qt5GuiDependencies.cmake propagate this well. This allows us to get rid of plenty of special cases as well. Change-Id: I3a7e8af49537ce5f215f24470e075a4ae9aeb944 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: build with exceptions disabled by defaultAlbert Astals Cid2019-06-053-0/+3
| | | | | | | | | Only re-enable exceptions for the modules that do CONFIG+=exceptions in qmake Change-Id: I9f19078adbdc1b8fa3d4102fb51a099e7e35522e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Include the .prev_CMakeLists.txt files for selftestsAlexandru Croitor2019-06-0458-1/+1252
| | | | | | | | | | This will help with future regeneration. Amends 6d1c695b0e32b644d13a088ab3363b6aef75de68 Change-Id: I2454dc36cfc00f7aad72488fb7927d7807978fd8 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Fix tests that need helper binariesAlbert Astals Cid2019-06-044-2/+13
| | | | | | | Compile the binaries where they are expected not in builddir/bin Change-Id: I5c9461424a4b3f9fb7f39f5b9d3cd9b96887cfbc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Fix testlib/selftestsAlbert Astals Cid2019-06-0457-81/+1758
| | | | | | | | | | Actually build tst_selftest Fix the subdirs of it not to be actually built as tests (so that ctest doesn't pick them up and tries to run them) Change-Id: Id9d069f44241027dbd103884d36551163382b216 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-06-0310-9/+169
|\ | | | | | | Change-Id: Ide5b3408bfefca410323cf26b810b44c06d3a227
| * QTextBrowser: detect and load markdown rather than assuming HTMLShawn Rutledge2019-05-302-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So we add the QTextDocument::ResourceType::MarkdownResource enum value to indicate the type. QMimeDatabase is generally unable to detect markdown by "magic", so we need to use the common file extensions to detect it (the same extensions as declared in the mime database XML). Change-Id: Ib71f03abd535c17e5a8c99bd92d0a6062e972837 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * tst_qtextbrowser: add markdown test data to TESTDATAShawn Rutledge2019-06-011-1/+1
| | | | | | | | | | | | | | It's necessary to make the test pass on certain platforms. Change-Id: I717d492df437c0ffb75b21d9ef23ce602160fad1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * QCommandLineParser: add --help-all, to show Qt options as wellDavid Faure2019-05-151-5/+62
| | | | | | | | | | | | | | | | | | | | | | Sample output at http://www.kdab.com/~dfaure/2019/help-all-example.txt Fixes: QTBUG-41802 Change-Id: I7a3350200761d41481fcb10ec4328e96e548d246 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * qhashfunctions.h: add specializations of std::hash for some Qt typesMarc Mutz2019-05-291-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a problem. Our types don't play well with the std unordered containers, because they do not specialize std::hash. We therefore force our users to come up with an implementation, hindering interoperability, since any two developers are unlikely to come up with compatible implementations. So combining libraries written by different developers will result in ODR violations. Now that we depend on C++11, and thus the presence of std::hash, we still face the problem that the standard does not provide us with a means to compose new hash functions out of old ones. In particular, we cannot, yet, depend on C++17's std::hash<std::string_view> to implement std::hash<QByteArray>, say. There's also no std::hash for std::tuple, which would allow easy composition by using std::tie(). So piggy-back on the work we have done over the years on qHash() functions, and implement the std::hash specializations for Qt types using the existing qHash() functions, with a twist: The standard allows implementations to provide means against predictable hash values. Qt has this, too, but the seed is managed by the container and passed to the qHash() function as a separate argument. The standard does not have this explicit seed, so any protection must be implicit in the normal use of std::hash. To reap whatever protection that std library has on offer, if any, we calculate a seed value by hashing int(0). This will be subject to constant folding if there's no actual seed, but will produce a value dependent on the seed if there is one. Add some tests. A question that remains is how to document the specialization. Can we have a \stdhashable QDoc macro that does everything for us? Task-number: QTBUG-33428 Change-Id: Idfe775f1661f8489587353c4b148d76611ac76f3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * QTextMarkdownWriter: fix some bad cases with word wrapShawn Rutledge2019-05-243-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If any non-breakable content (such as a link) already went past 80 columns, or if a word ended on column 80, it didn't wrap the rest of the paragraph following. Change-Id: I27dc0474f18892c34ee2514ea6d5070dae29424f Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * QTextMarkdownImporter: don't keep heading level on following list itemShawn Rutledge2019-05-242-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When reading a document like # heading - list item and then re-writing it, it turned into # heading - # list item because QTextCursor::insertList() simply calls QTextCursor::insertBlock(), thus inheriting block format from the previous block, without an opportunity to explicitly define the block format. So be more consistent: use QTextMarkdownImporter::insertBlock() for blocks inside list items too. Now it fully defines blockFormat first, then inserts the block, and then adds it to the current list only when the "paragraph" is actually the list item's text (but not when it's a continuation paragraph). Also, be prepared for applying and removing block markers to arbitrary blocks, just in case (they might be useful for block quotes, for example). Change-Id: I391820af9b65e75abce12abab45d2477c49c86ac Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-06-03201-2561/+6923
|\| | | | | | | | | | | Take 5. Change-Id: Ifb2d20e95ba824e45e667fba6c2ba45389991cc3
| * Merge "Merge remote-tracking branch 'origin/5.13' into dev"Friedemann Kleint2019-05-2715-1180/+1298
| |\
| | * Merge remote-tracking branch 'origin/5.13' into devFriedemann Kleint2019-05-2715-1180/+1298
| | |\ | | | | | | | | | | | | Change-Id: Ia279fc4a8226626041c772902a07b2f90f37b53b
| | | * Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-05-279-1167/+1276
| | | |\ | | | | | | | | | | | | | | | Change-Id: Iaf6bd52972b562b9c91d9e93a988d26b0eb9d3b4
| | | | * Blacklist tst_qwindow::spuriousMouseMove() on WindowsFriedemann Kleint2019-05-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test is failing in 5.13 for unknown reasons. Task-number: QTBUG-72296 Task-number: QTBUG-72344 Change-Id: I24c1ad1b6def3096de99caeeebeee6e204cc75ca Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| | | | * tst_QMdiSubWindow::setSystemMenu(): Pass in High DPI/multi-screen setupsFriedemann Kleint2019-05-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The window tends to grow to span screens in multi-screen setups; force it to be on the primary screen by showing it maximized in that case. Change-Id: I984ba7a4cd4abd1f862c59c8dca0e2275f44c724 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| | | | * Brush up tst_QMdiSubWindowFriedemann Kleint2019-05-201-170/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use nullptr - Use range-based for - Use correct static invocation - Set a title on shown windows to make it possible to identify slow tests - Fix the class declarations, use override, member initializations - Use Qt 5 connection syntax where possible - Ensure top level widget list is empty after each test, delete left-over menu bars and disable menu animations Change-Id: Ieeb943ea669cd139f1835088b816802e777a9676 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | | * Make tst_qwidget_window pass on High-DPI screens (Windows)Friedemann Kleint2019-05-161-22/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a fuzz check (cf 63090627220a6209652d236cf991305fbeb188b8) and a minimum size similar to tst_qwidget to make the test pass on large monitors with or without active scaling. Change-Id: I5a9e28e38e1d007057894c349c94f0e6fe12009c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | | * Brush up tst_QWidgetFriedemann Kleint2019-05-161-510/+548
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use nullptr - Fix C-style casts - Fix redundant bool expressions - Fix else after return - Remove unnecessary casts to int from registered enums - Fix most signedness-related warnings - Use range-based for - Use correct static invocation - Set a title on shown windows to make it possible to identify slow tests - Fix the class declarations, use override, member initializations - Use Qt 5 connection syntax - Remove unused variables - Streamline code in some cases Change-Id: I1350b382b0b7d0f3198039fdc78892cfa1dd498d Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | | | * Brush up tst_QWindowFriedemann Kleint2019-05-151-94/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use nullptr - Fix C-style casts - Remove unnecessary casts to int from registered enums - Fix most signedness-related warnings - Use range-based for - Use correct static invocation - Set a title on shown windows to make it possible to identify slow tests - Fix the class declarations, use override, member initializations - Streamline code in some cases Change-Id: I4c9b99126cff02136def0e03accdf1129fe6d72b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| | | | * Brush up tst_QApplicationFriedemann Kleint2019-05-154-371/+331
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use nullptr - Fix C-style casts - Use range-based for - Use correct static invocation - Set a title on shown windows to make it possible to identify slow tests - Fix the class declarations, use override, member initializations - Use Qt 5 connection syntax; use lambdas where applicable to remove helper slots - Streamline code in some cases - Replace helper function to convert touch points by the one in QWindowSystemInterfacePrivate - Use a logging category for the debug outpt, silencing some output Change-Id: Ia46c7ad7c08f3afc8e5869ea99b66e406de97781 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| | | * | QAbstractSpinBox: fix some ui glitchesChristian Ehrlicher2019-05-102-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix some ui glitches for QAbstractSpinBox: - update geometry when buttons are toggled on/off - calc button size with subControlRect instead hardcoded 20px - when buttons are not shown, don't add the button size in sizeFromContents for common and macOS style Fixes: QTBUG-39713 Fixes: QTBUG-75303 Task-number: QTBUG-67126 Change-Id: Ibf330c76deb16358a481bba6bd429fff6a5d57ae Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * | Fix new[] delete mismatch in testAllan Sandfeld Jensen2019-05-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QScopedPointer uses normal delete, but we need delete[]. Change-Id: Id62a2c55f75ef4aa60580f5e04c4bf306a6dd3c9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * | Fix canonicalFilePath() for files with trailing slashesVolker Hilsheimer2019-05-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Such files do not exist (as per QFileInfo::exists), but on some platforms that rely on realpath(), QFileInfo::canonicalFilePath did not return the empty string. Use the same logic on macOS as we already did on Android, and include a test case. Remove the unnecessary dynamic memory allocation and use a stack-allocated array instead, unless we use modern POSIX in which case realpath() will alloc the memory for the result for us. Change-Id: Ide987c68ebf00cbb7b1a66c2e9245a12c7807128 Fixes: QTBUG-44242 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-162-2/+3
| | | |\| | | | | | | | | | | | | | | | Change-Id: I1bdc28a3ae825ea35e83f20fe16d2409515e5a3d
| | | | * Skip flaky qfloat16 1/inf == 0 test on QEMU/Arm64Edward Welbourne2019-05-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not clear why this test fails - and only does so sometimes - but fail it does, so we ned to skip it to let development keep going. As it happens, the same platform over-optimizes various computations using qfloat16; which can at least be used to test for this platform, since it wrongly distinguishes two qfloat16 values that theory and all other platfomrs agree should coincide. Fixes: QTBUG-75812 Change-Id: Ie9463d7dc21bca679337b475d13417b9f42bbf9b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| | | | * winrt: Return monospace font for ↵Oliver Wolff2019-05-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFontDatabase::systemFont(QFontDatabase::FixedFont) Fixes: QTBUG-75648 Change-Id: I0e5e5e012d3cd5985d1e9a63e776e73ce2d7bf98 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * | | | Tests: Fix some warnings about deprecated functions not under testFriedemann Kleint2019-05-2716-80/+85
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix warnings like: baselineserver/shared/baselineprotocol.cpp:295:72: warning: ‘int QImage::byteCount() const’ is deprecated: Use sizeInBytes [-Wdeprecated-declarations] tst_qnetworkreply.cpp:1560:17: warning: ‘static QList<QSslCertificate> QSslSocket::defaultCaCertificates()’ is deprecated [-Wdeprecated-declarations] tst_qnetworkreply.cpp:1560:39: warning: ‘static QList<QSslCertificate> QSslSocket::defaultCaCertificates()’ is deprecated [-Wdeprecated-declarations] tst_qnetworkreply.cpp:8153:60: warning: ‘T* QWeakPointer<T>::data() const [with T = const QNetworkSession]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Wdeprecated-declarations]. ... st_qprinter.cpp:1318:74: warning: ‘QList<QPagedPaintDevice::PageSize> QPrinterInfo::supportedPaperSizes() const’ is deprecated [-Wdeprecated-declarations] tst_qprinter.cpp:1362:74: warning: ‘QList<QPagedPaintDevice::PageSize> QPrinterInfo::supportedPaperSizes() const’ is deprecated [-Wdeprecated-declarations] tst_largefile.cpp:492:85: warning: ‘bool qEqual(InputIterator1, InputIterator1, InputIterator2) [with InputIterator1 = char*; InputIterator2 = char*]’ is deprecated: Use std::equal [-Wdeprecated-declarations] tst_largefile.cpp:498:91: warning: ‘bool qEqual(InputIterator1, InputIterator1, InputIterator2) [with InputIterator1 = char*; InputIterator2 = char*]’ is deprecated: Use std::equal [-Wdeprecated-declarations] tst_qabstractitemmodel.cpp:312:25: warning: ‘void QAbstractItemModel::reset()’ is deprecated [-Wdeprecated-declarations] ... tst_qabstractitemmodel.cpp:1793:28: warning: ‘void QAbstractItemModel::setRoleNames(const QHash<int, QByteArray>&)’ is deprecated [-Wdeprecated-declarations] ... tst_qcolor.cpp:1425:33: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations] tst_qcolor.cpp:1432:31: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations] tst_qprinterinfo.cpp:303:61: warning: 'QList<QPagedPaintDevice::PageSize> QPrinterInfo::supportedPaperSizes() const' is deprecated [-Wdeprecated-declarations] tst_qprinterinfo.cpp:304:65: warning: 'QList<QPair<QString, QSizeF> > QPrinterInfo::supportedSizesWithNames() const' is deprecated [-Wdeprecated-declarations] tst_qtextdocumentfragment.cpp:947:52: warning: ‘QString QTextCharFormat::anchorName() const’ is deprecated: Use anchorNames() instead [-Wdeprecated-declarations] tst_qtextlayout.cpp:2261:61: warning: ‘void QTextLayout::setAdditionalFormats(const QList<QTextLayout::FormatRange>&)’ is deprecated: Use setFormats() [-Wdeprecated-declarations] tst_qtextlayout.cpp:2330:42: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] tst_qitemselectionmodel.cpp:2214:37: warning: ‘QModelIndex QModelIndex::child(int, int) const’ is deprecated: Use QAbstractItemModel::index [-Wdeprecated-declarations] ... tst_qtextlist.cpp:317:68: warning: 'bool QTextList::isEmpty() const' is deprecated: Use count() instead [-Wdeprecated-declarations] tst_qpainter.cpp:373:32: warning: ‘void QPainter::setMatrixEnabled(bool)’ is deprecated: Use setWorldMatrixEnabled() instead [-Wdeprecated-declarations] tst_qpainter.cpp:374:40: warning: ‘bool QPainter::matrixEnabled() const’ is deprecated: Use worldMatrixEnabled() instead [-Wdeprecated-declarations] tst_qpainter.cpp:702:45: warning: ‘const QBrush& QPalette::background() const’ is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations] tst_qpainter.cpp:1573:29: warning: ‘void QPainter::drawRoundRect(const QRect&, int, int)’ is deprecated: Use drawRoundedRect(..., Qt::RelativeSize) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:76:38: warning: ‘virtual void QPdfWriter::setPageSize(QPagedPaintDevice::PageSize)’ is deprecated: Use setPageSize(QPageSize(id)) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:81:41: warning: ‘virtual void QPdfWriter::setPageSizeMM(const QSizeF&)’ is deprecated: Use setPageSize(QPageSize(size, QPageSize::Millimeter)) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:105:30: warning: ‘virtual void QPdfWriter::setMargins(const QPagedPaintDevice::Margins&)’ is deprecated: Use setPageMargins(QMarginsF(l, t, r, b), QPageLayout::Millimeter) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:172:37: warning: ‘virtual void QPdfWriter::setPageSizeMM(const QSizeF&)’ is deprecated: Use setPageSize(QPageSize(size, QPageSize::Millimeter)) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:258:38: warning: ‘virtual void QPdfWriter::setPageSize(QPagedPaintDevice::PageSize)’ is deprecated: Use setPageSize(QPageSize(id)) instead [-Wdeprecated-declarations] qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp:3980:54: warning: ‘QModelIndex QModelIndex::child(int, int) const’ is deprecated: Use QAbstractItemModel::index [-Wdeprecated-declarations] tst_qlocale.cpp:434:26: warning: 'QString::null' is deprecated: use QString() [-Wdeprecated-declarations] ... Change-Id: I77c1a934b27119eedeb26a77c913686314a2a5c7 Reviewed-by: David Faure <david.faure@kdab.com>
| * | | tst_QVariant: Fix warnings about deprecated functions not under test —Friedemann Kleint2019-05-241-247/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Silence a warnings flood about qVariantFromValue(), QString::null and QWeakPointer::data(). Change-Id: I73347190c0fa396b39b9efd00447cf24e48259a0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * | | Add a bench-mark for QDate's isValid() and daysInMonth()Edward Welbourne2019-05-222-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The two perform related calculations, so test them together. RESULT : tst_QDate::monthLengths(): 0.33 msecs per iteration (total: 87, iterations: 256) Change-Id: I86b36a9182b00c0a1f40e858ed3e7812434974c4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Tidy up in tst_QDateTimeEdward Welbourne2019-05-221-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use QCOMPARE rather than QVERIFY an equality; ditch a stray blank line. Change-Id: Ie828837919fb9d3cc774d82d0eebcf7728fed645 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Remove usages of Q_OS_WINCEJoerg Bornemann2019-05-234-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This platform is history. Change-Id: Iddfab008a509f4828c321730414c8204055cf7af Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| * | | QTextBrowser: set base URL and document URL before loading contentShawn Rutledge2019-05-221-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setHtml() or setMarkdown() can result in attempting to load resources such as images that are needed to render the page. Whenever the resource has a relative URL, loading depends on the baseURL having already been set so that a complete URL can be constructed. QTextDocument::resource() is called to load images, and uses baseUrl(). A little later, QTextBrowserPrivate::resolveUrl() is given an URL that already has been extended with the baseURL if known; but it has its own logic to resolve the resource URL against currentURL, or else to treat it as a local file path if a file exists at that location. The autotest was relying on this fallback to the local relative file path before; but now it tests both with a local filename in the current directory for the source HTML and also with a fully resolved source URL containing the complete file path. Also made minor style improvements in tst_QTextBrowser's TestBrowser class. Change-Id: I46a850015d0e9c5bc5f13b9e37179a9323ab1980 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | | tst_QActionGroup: avoid Java-style iteratorsMarc Mutz2019-05-221-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They are going to be deprecated soon. Use a lambda to mimic the adjacent addActions() calls. Also, I didn't want to add a scope or extend the lifetime of the return value of actions() until the end of the function, and for (QAction *action : actGroup.action()) would detach. I'd've made it a helper function, but it's used only once, so... a lambda. Change-Id: I2b3aae463036fd61a9cca7b4ef991b8752869bf3 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| * | | Long live Qt::SplitBehavior!Marc Mutz2019-05-211-0/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The is a copy of the QString::SplitBehavior enum, but scoped in the Qt namespace instead of inside QString, where it creates problems using it elsewhere (QStringView, in particular). Overload all QString{,Ref} functions taking QString::SplitBehavior with Qt::SplitBehavior. Make Qt::SplitBehavior a QFlags for easier future extensions (e.g. a hint to use Boyer-Moore searching). Added tests in QStringApiSymmetry. [ChangeLog][QtCore] Added new Qt::SplitBehavior. [ChangeLog][QtCore][QString/QStringRef] The split functions now optionally take Qt::SplitBehavior. Change-Id: I43a1f8d6b22f09af3709a0b4fb46fca61f9d1d1f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | QFileSystemWatcher: lock autotest code away into a cold sectionMarc Mutz2019-05-211-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code contained a sizeable chunk of string parsing along with qDebug()s in the normal path of execution. That code, however, was only used for Qt's own autotests. The idea of this patch is, then, to not only move the autotest case into the cold text section (using Q_UNLIKELY), but also to completely exclude it, when QT_BUILD_INTERNAL is not set. Unfortunately, the structure of the function did not really lend itself to #ifdefing that part of the code out (production code was in the middle of non-production code), so I transformed the engine selection code into a lambda, replacing assignment with returns, and swapping the branches of the central if around to yield a single block of code that can be excluded from compilation with just one #ifdef. As a consequence, the runtime code is almost unaffected, and the function is much easier to read now. Since the test-specific code is only compiled into Qt now in developer builds, guard the tests that rely on this behavior with the same macro. Change-Id: I9fd1c57020a13cef4cd1b1674ed2d3ab9424d7cd Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * | | QStateMachine: handle parallel child mode for state machinesErik Verbruggen2019-05-161-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting the childMode property to ParallelStates will result in an invalid state machine. This is never checked (worse, we explicitly allow it and have a constructor to set it), but it results in findLCCA failing, which then results in a failing assert or crash. This fix in this patch is to handle this case separately. The proper fix would be to remove completely the ability to set the childMode on a QStateMachine, but that will have to wait until Qt6. Fixes: QTBUG-49975 Change-Id: I43692309c4d438ee1a9bc55fa4f65f8bce8e0a59 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * | | QtCore: mark obsolete enumerations as deprecatedChristian Ehrlicher2019-05-176-57/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following enumerations were obsolete for a log time but not marked as deprecated: - WA_NoBackground - WA_MacNoClickThrough - WA_MacBrushedMetal - WA_MacMetalStyle - WA_MSWindowsUseDirect3D - WA_MacFrameworkScaled - AA_MSWindowsUseDirect3DByDefault - AA_X11InitThreads - ImMicroFocus mark them as deprecated and remove the usage inside QtBase so they can be removed with Qt6 Change-Id: Ia087a7e1d0ff1945286895be6425a6cceaa483fb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * | | Enable tst_QWidget_window::tst_resize_count on Ubuntu 18.04Frederik Gladhorn2019-05-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test passes, according to our metrics it kept on failing on 16.04 and on OpenSuse. This reverts commit d2015b4d06d89cb760d686876d639452f73d80fe. Change-Id: Ibe81f848238d9df651a74f9fd82ac636c2c249f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * | | Add setAutoDeleteReplies to QNetworkAccessManagerMårten Nordheim2019-05-151-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following the introduction of AutoDeleteReplyOnFinishAttribute to QNetworkRequest it seems natural to make it easy to enable for all replies created with the current QNetworkAccessManager. [ChangeLog][QtNetwork][QNetworkAccessManager] Added setAutoDeleteReplies to QNetworkAccessManager to enable the AutoDeleteReplyOnFinishAttribute attribute for all QNetworkRequests that are passed to QNetworkAccessManager. Change-Id: I7f96dd1fc9a899328e89732be17780b4e710c2a2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | | Introduce AutoDeleteReplyOnFinishAttribute for QNetworkRequestMårten Nordheim2019-05-151-0/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtNetwork][QNetworkRequest] Added the AutoDeleteReplyOnFinishAttribute attribute to QNetworkRequest, which makes QNetworkAccessManager delete the QNetworkReply after it has emitted the "finished" signal. Change-Id: I03d4ac0830137882e51dd28795a8ec817762a300 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | | QFtp: Skip the flaky QTestEventLoop::timeout in Coin networkRyan Chu2019-05-151-32/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When migrating QFtp test to docker server, it seems it is easy to get "QTestEventLoop::instance().timeout()" during the test in Coin network. To move the task of migration forward, those flaky timeout errors will be ignored for short-term. Task-number: QTBUG-75549 Change-Id: I797952b82c0ceb637f40c77fac2a88ca2a9a0eae Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * | | Fix the timing issue of QFtp tests when using Docker serversRyan Chu2019-05-152-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes, it fails in tst_QFtp::proxy or tst_QFtp::activeMode under the stress test. It complains about "Network operation timed out" on vsftpd.test-net.qt.local. When this issue happens in tst_QFtp::proxy, it shows "USER-ERR reject: 172.18.0.5 (ForkLimit 40)" in the log of ftp-proxy. By default, the ftp-proxy only supports 40 incoming client connections per minute. To make the ftp-proxy more powerful, this change extends the limits from 40 to 2000. When this issue happens in tst_QFtp:activeMode, vsftpd shows 426 Failure writing network stream error. It is a known issue of vsftpd. A quick fix is turning use_sendfile off. Change-Id: Iad50469654041bf30f92ef00805034f0d4aa9c3f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * | | Rework QFtp test and resolve the unresolved itemsRyan Chu2019-05-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The proxy_data() defined in tst_qftp.cpp expects five items (bigfile, nonASCII, rfc3252, rfc3252.txt, and upload) in the server folder (ftp/qtest). The file rfc3252 and nonASCII folder were missing. Change-Id: I995d6e254875ade22a1def53187077f1cc8d4c98 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | | Migrate QFtp test to new test serverVolker Hilsheimer2019-05-152-84/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use docker test server to run test, following instructions on https://wiki.qt.io/Network_Testing. Verified on Ubunutu 18.04. Several test failures due to network timeouts and inconsistent configuration of FTP server and assumptions made in the tests. However, the test is either way blacklisted, and the docker test server is not in use yet. Done-with: Ryan Chu <ryan.chu@qt.io> Fixes: QTQAINFRA-2275 Change-Id: I4cbd0109ce3f4cfb23ba2303a85796681d12febc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-152-1/+27
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qfloat16.cpp src/corelib/global/qfloat16.h src/plugins/platforms/windows/qwindowswindow.cpp Change-Id: I0938aaa6a9771f55e48c95ed29f6f5291431b947
| | * | Add 'well-formated' JSON string valuesMichal Klocek2019-05-141-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for surrogate code points U+D800 through U+DFFF, represent them with JSON escape sequences. https://github.com/tc39/proposal-well-formed-stringify Change-Id: I84fea53a8ef400beebefdba10ea82dc510fe7dda Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-121-0/+1
| | |\| | | | | | | | | | | | | Change-Id: I0c00ffe0eabebc919f22d6faa4bf958b288e8fd9