summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-231-0/+5
|\ | | | | | | Change-Id: Iaa439ba7dff19a17e3716b3d30f49f60fa6e38f8
| * Handle specified time-spec in date-time parsingAndrei Golubev2020-04-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a date-time was parsed from a string, the result was equal (as a date-time) to the correct value, but had (at least in some cases) the wrong spec, where it should have had a spec reflecting the zone specifier parsed. The time-spec imposed for the benefit of QDateTimeEdit is now moved from QDateTimeParser to QDateTimeEditPrivate, which takes over responsibility for imposing it. QDateTimeParser assumes Qt::LocalTime in member functions (where applicable) and uses the time-spec parsed from the string when constructing the date-time. QDateTime::fromString() and QLocale::toDateTime() are updated to use the full QDateTime returned by QDateTimeParser. Fixes: QTBUG-83075 Done-With: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I8b79add2c7fc13a200e1252d48dbfa70b36757bf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.15' into dev"Qt Forward Merge Bot2020-04-2223-53/+268
|\ \
| * | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-2223-53/+268
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/widgets/qabstractbutton.cpp src/widgets/widgets/qbuttongroup.cpp src/widgets/widgets/qbuttongroup.h src/widgets/widgets/qsplashscreen.cpp tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp tests/benchmarks/opengl/main.cpp Needed update: src/plugins/platforms/cocoa/CMakeLists.txt Change-Id: I7be4baebb63844ec2b3e0de859ca9de1bc730bb5
| | * Markdown writer: omit space after opening code block fenceShawn Rutledge2020-04-203-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CommonMark spec shows that it's not necessary to have a space between the code fence and the language string: https://spec.commonmark.org/0.29/#example-112 This also avoids a needless trailing space after a code fence that does not include a language string. Change-Id: I2addd38a196045a7442150760b73269bfe4ffb22 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| | * Markdown writer: don't wrap code block, and detect its endShawn Rutledge2020-04-202-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The end of a code block nested in a list item is now detected; and if the text of the list item continues after the code block, it continues to be indented. Code blocks should never be word-wrapped. Fixes: QTBUG-80603 Change-Id: I4427f8b1d4807d819616f5cb971e2d006170d9be Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| | * Replace QTime with QElapsedTimer in benchmarksEdward Welbourne2020-04-2013-45/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various benchmarks were still using the deprecated timing API. One didn't even *use* the timer it implemented this way. One was just using start as a short-hand for assigning to currentTime(). Change-Id: If406d0fb606e454fec056f386bcd0aa6726ee96e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| | * Fuzzing: Add fuzz target for QCborStreamReader::nextRobert Loehning2020-04-162-0/+46
| | | | | | | | | | | | | | | Change-Id: I8e7d90d89b66395370809935b1cb5bf144bded49 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Introduce QSocketNotifier::activate(QSocketDescriptor, QSN::Type)Mårten Nordheim2020-04-161-5/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pre-existing overload passes an int, but this can mean the descriptor gets truncated in compilations where the descriptor is 64-bit. The old overload with int is visible when querying the metaobject system so string-based connects still work as before, and connecting to it will produce a deprecation warning in the output. At the same time the PMF-based connect will, on recompile, pick the QSocketDescriptor overload. As an added improvement it also comes with the notification type, removing the need for separate slots where the code would be mostly shared anyway. The QSocketDescriptor type can be implicitly converted to and from qintptr to ensure existing code still compiles. It can also be constructed from Qt::HANDLE on Windows. In this same patch I also update the existing string-based connects in this module, which then includes updating the parameters for some slots as well. [ChangeLog][QtCore][QSocketNotifier] Added QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type). This replaces the activated(int) signal which in 64-bit environments could truncate the socket descriptor. If you use "activated" with the string-based connect() then you need to update the parameter type of the signal and slot if it had one. If you use it with the pointer to member function based connect() then all you need to do is update your slot's parameter type if it has one. If you need to compile your source code with multiple versions of Qt then connect() to this function using pointer to member function and update the slot's parameter type if needed. Task-number: QTBUG-70441 Change-Id: Ic43d6bc4c5bcb4040867b2ffad8d36fb01eed8af Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * macOS: Remove a bunch of dead (forward) declarationsTor Arne Vestbø2020-04-151-1/+0
| | | | | | | | | | | | | | | Change-Id: I402668a17b48c164658f775bacd832615a6d2587 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Add QButtonGroup::idClicked/Pressed/Released/Toggled signalsVolker Hilsheimer2020-04-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following the deprecation of the signal overloads, the remaining signals did not provide equivalent functionality for connecting a slot expecting an integer. The mapping from QAbstractButton* to the ID is comparatively cumbersome to do in the connected slot. Add uniquely named signals that emit the ID of the button directly. [ChangeLog][QtWidgets][QButtonGroup] Added signals idClicked/Pressed/Released/Toggled that replace the deprecated signal overloads. Change-Id: I77215e4f815c4fb7dd6326e1f431230e6601e8f8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Fuzzing: Add fuzz target for QTextStream's extraction operatorRobert Loehning2020-04-142-0/+46
| | | | | | | | | | | | | | | Change-Id: Ia5fa2e36f5439ebcc323d6d18c33c2dd58404aba Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
| | * QCborValue: fix the move-assignment operatorv5.15.0-beta4Thiago Macieira2020-04-111-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The double-swap technique I used was flawed and broke on self-assignment. What I had meant to use was the move-and-swap technique. Thanks to Peppe for pointing it out. This also fixes a compiler bug in the Green Hills compiler. It was finding the wrong "swap" function in qSwap: using std::swap; swap(value1, value2); It's supposed to find swap(QCborValue &, QCborValue &) due to argument- dependent lookup. It's instead finding std::swap<QCborValue>, which recurses. Fixes: QTBUG-83390 Change-Id: Ibdc95e9af7bd456a94ecfffd1603e1bee90cd107 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | Fix assigning int QFlag-type propertiesFriedemann Kleint2020-04-221-0/+51
|/ / | | | | | | | | | | | | | | | | | | | | Ensure they are handled as enumerations in QMetaType. This is required for handling QFlag-type properties in Qt Designer Fixes: QTBUG-83689 Change-Id: Ifbfb5c5b5cd34fce462e299505d063e22e725c2e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Always encode HTML as utf-8Lars Knoll2020-04-211-5/+6
| | | | | | | | | | | | | | | | | | When converting a text document to HTML, always convert it to utf-8, as required by the HTML standard. This also means that we remove the optional encoding parameter. Change-Id: I0bd2fc9df2d06734e1c5b8053b964fbfbb6881e1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Squash again some tests in concurrentmapJarek Kobus2020-04-211-351/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | After adding new tests, the source code of tst_concurrentmap grows rapidly with copy/paste/replace pattern. This intoduce the issue with maintaining the test. Get rid of separate functions for testing blocking versions of mapped/mappedReduced and test blocking versions in parallel with non-blocking flavors. So again, get rid of duplicated code. Task-number: QTBUG-83258 Change-Id: I4cac6f4e1bfd1b50363dc094610717674aebf2af Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* | Add more tests for QtConcurrent::mappedReduced()Jarek Kobus2020-04-212-0/+221
| | | | | | | | | | | | | | | | | | | | | | | | Test the case where reduce function of the form: V function(T &result, const U &intermediate) has T and U types different. Make use of numberSumReduce function and corresponding functor that reduce Number class object to the result of int type. Fixes: QTBUG-83258 Change-Id: I194d290988b48e7bca91228c0cd5d39efd1b4712 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* | Get rid of code repetition in concurrentmap testJarek Kobus2020-04-211-1825/+439
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move tests with initial value next to their original version. Join new lambda tests into a common functions testing all possible 16 combinations of functor / function / member / lambda, as they test in fact the same function. There is no need to distinguish lambda case over other cases. This helps in test readability and maintenance. Add missing tests for lambdas with a combination of initial value. Task-number: QTBUG-83258 Change-Id: I7a3d2bf87384d7feecffaaf39281cd626955b0a4 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* | Make continuations work with move-only typesSona Kurazyan2020-04-181-1/+58
| | | | | | | | | | | | | | | | | | | | Use the move-only versions of result reporting and getting operations, if the type of QFuture is not copyable. Task-number: QTBUG-81941 Change-Id: Ic9fa978380e2c24e190e68d974051a650b0e5571 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
* | Remove deprecated members from QtWidgets/itemviews classesVolker Hilsheimer2020-04-172-18/+0
| | | | | | | | | | | | | | | | Cleaning up those that are trivial to remove because they have direct replacements. Change-Id: Ie9fecd8c4822ed1a8f378b210cc4c4d9a10f7e36 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Remove deprecated members from QtWidgets/widgets classesVolker Hilsheimer2020-04-172-19/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleaning up those that are trivial to remove because they have direct replacements. The QLabel changes to the pixmap/picture getters provide the following migration path: QPixmap *ppix = l->pixmap(); // up to 5.15, warns in 5.15 QPixmap pval = l->pixmap(Qt::ReturnByValue); // new in 5.15, works in 6 QPixmap pixmap = l->pixmap(); // from Qt 6 on The overload with argument can be deprecated after the first LTS or so. Change-Id: I8494ceeea55b2aeda0bd340640ad95cb7c91f7d6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Fix digit grouping when digits are surrogat pairsEdward Welbourne2020-04-171-37/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up to commit ed2b110b6add650954dc102a0317c14ff826c677 to fix indexing errors. Added the test that should have accompanied that commit, which found some bugs, and refined the Indian number formatting test (on which it's based). Make variable i in the loops that insert grouping characters in a number be consistently a *character* offset - which, when each digit is a surrogate pair, isn't the same as an index into the QString. Apply the needed scaling when indexing with it, not when setting it or decrementing it. Don't assume the separator has the same width as a digit. Differences in index no longer give the number of digits between two points in a string, so actively track how many digits we've seen in a group when converting a numeric string to the C locale. Partially cleaned up the code for that in the process (more shall follow when I sort out digit grouping properly, without special-casing India). Change-Id: I13d0f24efa26e599dfefb5733e062088fa56d375 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Get rid of QT_OPENGL_ES*Eskil Abrahamsen Blomfeldt2020-04-173-11/+11
| | | | | | | | | | | | | | | | | | | | | | The QT_OPENGL_ES* macros are leftovers from an earlier, ad hoc configuration system, which has since been replaced by QT_CONFIG. To clean things up in Qt 6, we use the new way instead. Task-number: QTBUG-83467 Change-Id: I578dc7695bff9d5ee303b22e44f60fee22fe0c28 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Clean up memoryLars Knoll2020-04-171-0/+1
| | | | | | | | | | | | | | And remove a test failure when compiling with asan enabled. Change-Id: I2b8e676665572adcbbac6a910983d5b209bf6d23 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Simplify signature of untyped property bindingsSimon Hausmann2020-04-171-10/+6
| | | | | | | | | | | | | | | | | | Instead of requiring the implementation to do the compare dance, let's do this in the library. This reduces the amount of duplicated code slightly and makes it easier to generate binding code from qml files. Change-Id: Ia3b16cf9769e74d076b669efe4119ab84af3cdf0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Remove QString::from/toAscii()Lars Knoll2020-04-161-29/+0
| | | | | | | | | | | | | | These methods have been deprecated since 5.0 Change-Id: I3ceed57a364ea59a63ccc51452ab3b4da7140ce4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Remove deprecated members from graphics view classesVolker Hilsheimer2020-04-162-12/+4
| | | | | | | | | | Change-Id: Ia192de674b1085edcf4a88cdeada6df89b442ddd Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Remove deprecated QStyle enum valuesVolker Hilsheimer2020-04-162-70/+18
| | | | | | | | | | Change-Id: I7eba336017844c06b2976df53d440e167abd7894 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Remove deprecated members from dialog classesVolker Hilsheimer2020-04-162-134/+0
| | | | | | | | | | | | | | And a few cleanups of out-dated comments and dead code. Change-Id: I59c6b9129a21b8953626cb63c3ebbf9b6c49a657 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Move versioned OpenGL functions from QtGui to QtOpenGLJohan Klokkhammer Helsing2020-04-161-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The context—which lives in QtGui—now knows nothing about versioned functions. This changes the public API for getting version functions for a context. [ChangeLog][QtGui][OpenGL] QOpenGLContext::versionFunctions() has been removed. QOpenGLVersionFunctionsFactory::get() from the QtOpenGL module should be used instead. Previously one would call context->versionFunctions<QOpenGLFunctions_4_0_Core>(); Which now becomes QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_4_0_Core>(context); The rest of the API should be identical. Since glgen no longer compiles, and the links to its input (gl.spec and gl.tm) are dead, I've edited the previously generated files manually. If glgen is fixed, it should be quite easy to make it generate the new way. Task-number: QTBUG-74409 Change-Id: I800527e0af16a79005b276eeb74417770193c62f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Run those autotests with cmakeLars Knoll2020-04-152-1/+17
| | | | | | | | | | | | | | They seem to work just fine. Change-Id: I8cf3e682e158c67367d76fe68f5829df67d1e449 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | QObject: overhaul narrowing detectionGiuseppe D'Angelo2020-04-151-201/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use P0608's trick to detect convertibility without narrowing; and now that we can depend on C++17, use its features. First, this moves the burden of detecting a narrowing conversion on the compiler, rather than us maintaining a complicated series of checks. Of course, this exposes * bugs in compilers (e.g. GCC < 9 thinks that float->bool is not narrowing; * behavior still not (widely) implemented (pointer to bool conversions are narrowing, P1957); * interesting compiler choices, e.g. GCC 9 thinks that unscoped enumerations are non-narrowing convertible to a datatype big enum to contain all the _enumerators_, even if the underlying type of the enum (and/or its sizeof()) is wider than the target datatype. Second, it allows to detect conversions that have a narrowing conversion as an intermediate step. Given a type like struct Bad { operator double() const; }; then an object of type Bad is implictly convertible to a type like int via a narrowing conversion. Therefore, a connection is possible between a signal carrying a Bad and a slot accepting an int. We can now detect and block this. Tests regarding scoped enumerations have been dropped, for the simple reason that a scoped enumeration is not implictly convertible to an integral type, so we don't have that detection (it would constantly fail). Scoped enumerations do not take part in narrowing conversions anyhow, cf. [dcl.init.list]. [ChangeLog][QtCore][QObject] The detection of narrowing conversions when calling QObject::connect() when QT_NO_NARROWING_CONVERSIONS_IN_CONNECT now takes also into account user-defined implicit conversions that undergo through a narrowing conversion. Change-Id: Ie09d59203fe6283378b36dfbc54de1d58098ef51 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Remove QRegExp support from QSortFilterProxyModelLars Knoll2020-04-158-145/+8
| | | | | | | | | | | | | | | | Map setFilterWildcard() and setFilterFixedString() to now use QRegularExpression. Change-Id: I2dff2015234decb2badfd306975dcff8553cdd7f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Improve Map|Map-Reduce and Filter|Filter-Reduce implementationKarsten Heimrich2020-04-143-16/+1008
| | | | | | | | | | | | | | | | | | | | | | | | | | * support lambda expressions * remove the need to specify result_type * use std::invoke to apply map|filter function * remove usage of FunctionWrapper* and createFunctionWrapper Task-number: QTBUG-33735 Task-number: QTBUG-82646 Change-Id: Ibcbe4278f0742c29182bd506081db0abb516f85f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* | QTaskBuilder::spawn: add an overload that doesn't return a future objectVitaly Fanaskov2020-04-141-0/+15
| | | | | | | | | | | | Fixes: QTBUG-83175 Change-Id: Idf85e47a2732742884272200d5c753805eaa640b Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* | Port test over to use QRegularExpressionLars Knoll2020-04-131-6/+6
| | | | | | | | | | Change-Id: I7f69fbbdb9e327059cd978b0989eee2c75c5a24b Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-117-62/+302
|\| | | | | | | | | | | | | Conflicts: tests/auto/network/socket/platformsocketengine/platformsocketengine.pri Change-Id: I22daf269a8f28f80630b5f521b91637531156404
| * Stop using obsolete TouchPoint rect accessors in tests and examplesShawn Rutledge2020-04-101-51/+68
| | | | | | | | | | | | | | | | | | | | Followup to cf4a8b12fa277c2ea218f022607934f60fed1a06 68916fede41d1eca5d07eb6b1db518d41a007616 and 3c159957f863cf8d367a9261e7016e52cd0348c1. Task-number: QTBUG-83403 Change-Id: Ieaf418860c565dbe883384e7f296a829fbfa1e33 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * tst_QFileInfo: fix running with systems without /etc/passwdThiago Macieira2020-04-091-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Clear Linux containers running as root may have no /etc/passwd. But they'll have /etc/machine-id because systemd creates that. Also test /proc/version (a Linux-specific file) because that isn't writeable even by root. Take the opportunity to check with access() instead of assuming root and only root can write to the file. Change-Id: Ibdc95e9af7bd456a94ecfffd1603e8359604752b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * QCborArray: fix operator[] that extends the arrayThiago Macieira2020-04-091-0/+54
| | | | | | | | | | | | | | | | | | | | | | This was never tested. The infinite loop in QCborContainerPrivate::grow is the proof. [ChangeLog][QtCore][QCborArray] Fixed an infinite loop when operator[] was called with with an index larger than the array's size plus 1. Change-Id: Ibdc95e9af7bd456a94ecfffd1603df3855c73f20 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * QCborMap: fix assigning elements from the map to itselfThiago Macieira2020-04-091-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to the QJsonObject issue of the previous commit (found with the same tests, but not the same root cause). One fix was that copying of byte data from the QByteArray to itself won't work if the array reallocates. The second was that assign(*that, other.concrete()); fails to set other.d to null after moving. By calling the operator=, we get the proper sequence of events. [ChangeLog][QtCore][QCborMap] Fixed some issues relating to assigning elements from a map to itself. Note: QCborMap is not affected by the design flaw discovered in QJsonObject because it always appends elements (it's unsorted), so existing QCborValueRef references still refer to the same value. Task-number: QTBUG-83366 Change-Id: Ibdc95e9af7bd456a94ecfffd1603df846f46094d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * QJsonObject: add missing detach2() callsThiago Macieira2020-04-091-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The refactoring to use CBOR missed two places where we could assign from the same object and thus cause corruption. In fixing this issue, I found a design flaw in QJsonObject, see Q_EXPECT_FAILing unit test and task QTBUG-83398. [ChangeLog][QtCore][QJsonObject] Fixed a regression from 5.13 that incorrect results when assigning elements from an object to itself. Fixes: QTBUG-83366 Change-Id: Ibdc95e9af7bd456a94ecfffd1603df24b06713aa Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * tst_PlatformSocketEngine: Removee SOURCES += of QtNetwork codeThiago Macieira2020-04-091-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoids ASAN warning of ODR violation: SUMMARY: AddressSanitizer: odr-violation: global 'typeinfo name for QSocketEngineHandler' at ../../../../../src/network/socket/qabstractsocketengine.cpp This trick has not been needed since we got Q_AUTOTEST_EXPORT. The main .pro file has: requires(qtConfig(private_tests)) Change-Id: Ibdc95e9af7bd456a94ecfffd1603e598932b88ad Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * tst_QSaveFile: skip test that fails when run as rootThiago Macieira2020-04-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | FAIL! : tst_QSaveFile::retryTransactionalWrite() '!file.open(QIODevice::WriteOnly)' returned FALSE. () Loc: [/home/tjmaciei/src/qt/qt5/qtbase/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp(156)] strace reveals: access("/TEMPDIR/outfile.ro", W_OK) = 0 Change-Id: Ibdc95e9af7bd456a94ecfffd1603eb371aadb02b Reviewed-by: David Faure <david.faure@kdab.com>
| * QTemporaryFile/Linux: don't cut the root dir's slashThiago Macieira2020-04-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Normally people shouldn't create temporary files on /, but if you're running as root, why not? Caught when running tst_qtemporaryfile as root: openat(AT_FDCWD, "", O_RDWR|O_CLOEXEC|O_TMPFILE, 0600) = -1 ENOENT (No such file or directory) Change-Id: Ibdc95e9af7bd456a94ecfffd1603ebfc17cea220 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
* | QApplication: remove obsolete globalStrut functionalityVolker Hilsheimer2020-04-106-20/+22
| | | | | | | | | | | | Change-Id: If56873f86f5291264cac720f8db7dbd4db756f49 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Fix autotests after the QHash changesLars Knoll2020-04-0910-65/+413
| | | | | | | | | | | | | | | | | | | | | | | | | | Some test cases are sensitive to the exact ordering inside QHash, and need adjustments when we change QHash or the hashing functions. Some rcc tests now also need 32bit specific data, as the hashing functions for 32 and 64 bit are different now (as we use size_t). Change-Id: Ieab01cd55b1288336493b13c41d27e42a008bdd9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Change qHashBits to use MurmurHash2Lars Knoll2020-04-091-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old implementation was either using CRC32 on modern processors or a trivial, but rather slow implementation. We can't continue with CRC32, as that implementation can only give us 32bit hashes, where we now need to support 64bit in Qt 6. Change the implementation to use MurmurHash, as public domain implementation that is both very fast and leads to well distributed hashes. This hash function is about as fast as the SSE optimized CRC32 implementation but works everywhere and gives us 64 bit hash values. Here are some numbers (time for 10M hashes): 14 char 16 char QByteArray QString float old qHash (non CRC32) 127ms 134ms 48ms old qHash (using SSE CRC32 instructions 60ms 62ms 46ms new qHash 52ms 43ms 46ms Unfortunately MurmurHash is not safe against hash table DoS attacks, as potential hash collisions are indepenent of the seed. This will get addressed in followup commit, where we use SipHash or an SSE optimized AES based hashing algorithm that does not have those issues. Change-Id: I4fbc0ac299215b6db78c7a0a2a1d7689b0ea848b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Implement emplace() for QHash and QMultiHashLars Knoll2020-04-091-6/+79
| | | | | | | | | | | | | | | | | | | | At the same time use the opportunity to refactor the insertion code inside the implementation of QHash to avoid copy and move constructors as much as possible and always construct nodes in place. Change-Id: I951b4cf2c77a17f7db825c6a776aae38c2662d23 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Change qHash() to work with size_t instead of uintLars Knoll2020-04-099-34/+34
| | | | | | | | | | | | | | | | | | | | | | This is required, so that QHash and QSet can hold more than 2^32 items on 64 bit platforms. The actual hashing functions for strings are still 32bit, this will be changed in a follow-up commit. Change-Id: I4372125252486075ff3a0b45ecfa818359fe103b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>