summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-11-101-2/+2
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/serialization/qcborcommon.h src/corelib/tools/qlocale_data_p.h tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp Done-with: Edward Welbourne <edward.welbourne@qt.io> Change-Id: Ibed987f6d77a0294f78f67d78625237616082416
| * QCborStreamReader: make sure setDevice() clears the last errorThiago Macieira2018-11-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The unit tests weren't running into this problem because the every setDevice() was preceded by the object being initialized with the exact same data, so there was never a previous error state. I've only changed a couple of tests, left the other setDevice() unchanged so we test both behaviors. Fixes: QTBUG-71426 Change-Id: I1bd327aeaf73421a8ec5fffd1561a590e3933376 Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | QByteArrayList: add indexOf(const char*) overloadDavid Faure2018-11-061-0/+26
| | | | | | | | | | | | | | | | | | | | | | This avoids memory allocation and data copying in e.g. QObject::property(). Detected by heaptrack's "Temporary allocations" counter in an application using the breeze widget style (many animations). Change-Id: Iabdb58a3e504cb121cce906ef707b0722de89df6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge "Merge remote-tracking branch 'origin/5.12' into dev" into ↵Qt Forward Merge Bot2018-11-062-0/+22
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-062-0/+22
| |\| | | | | | | | | | Change-Id: Id1e4664d3c942226b76e2c3b338df3116ff89297
| | * QMimeType: Use default key as fallback for comment() propertyGary Wang2018-11-021-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QMimeProvider parses the shared mime database xml files, it will read the <comment> element for mime comment and treat the `xml:lang` attribute as locale language string. When no `xml:lang` attr is provided, QMimeProvider will read the value and treat it as a en_US locale string as the default key. When we call QMimeType::comment(), it will try to get the locale comment string with the default language (QLocale().name()), once it can't find a matched result, it should return the default key (which QMimeProvider set it as en_US locale before) as fallback. Task-number: QTBUG-71314 Change-Id: I444f8159d6f19dfef6338cd79312f608d8f13394 Reviewed-by: David Faure <david.faure@kdab.com>
| | * Treat shorts as int in QVariant::canConvert()Allan Sandfeld Jensen2018-11-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Follow the pattern of char and float, and treat shorts as a more generic type in QVariant::canConvert() Task-number: QTBUG-60914 Change-Id: Ib1cc7941ee47cb0fc0098f22f98a03cd6f6b63fe Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | New proxy model: QTransposeProxyModelLuca Beldi2018-11-053-0/+922
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented a new proxy model to transpose the source model. Rows will become columns and vice-versa. Both flat and tree models supported. [ChangeLog][QtCore] New class QTransposeProxyModel to swap rows and columns of the source model. Change-Id: I902963c6b81aa0f63b5ad2bddca538f28b565084 Reviewed-by: David Faure <david.faure@kdab.com>
* | | Fix use of deprecated ItemDataRoles Background/TextColorRoleChristian Ehrlicher2018-11-052-4/+4
|/ / | | | | | | | | | | | | | | | | | | Replace BackgroundColorRole/TextColorRole with BackgroundRole/ForegroundRole and explicit deprecate them for 5.13 Change-Id: I6b0d99844a32d2f5fdfd1878317a7b7422b800d3 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Fully support operator[] on QCborValue and QCborValueRefEdward Welbourne2018-11-011-2/+57
| | | | | | | | | | | | | | | | | | | | | | Added operator[] to QCborValueRef and mutating operator[] both there and in QCborValue. If the value (referenced) is not a container, it is replaced with a map and a reference into the result is returned. If the value is an array and the key is a string, negative, or more than 0xffff, the array is first converted to a map. Change-Id: Ibbc9e480fb25eb3d05547c8a1b99e762b2a68b68 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-016-9/+95
|\| | | | | | | Change-Id: I6f8d3abd3247dc980dc7834801a017a89c8f4286
| * QObject: Fix isSignalConnected() when signals have been disconnectedKari Oikarinen2018-10-311-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bitmap cache for the first 64 signals being connected was only set when the connection is added. It was never unset when the connection was removed. Internal use of the connectedSignals bitmap is not hurt by it occasionally saying a signal is connected even though it is not, since the purpose of those checks is avoiding expensive operations that are not necessary if nothing is connected to the signal. However, the public API using this cache meant that it also never spotted signals being disconnected. This was not documented. Fix the behavior by only using the cache if it is up to date. If it is not, use a slower path that gives the correct answer. To avoid making disconnections and QObject destructions slower, the cache is only updated to unset disconnected signals when new signal connections are added. No extra work is done in the common case where signals are only removed in the end of the QObject's lifetime. Fixes: QTBUG-32340 Change-Id: Ieb6e498060157153cec60d9c8f1c33056993fda1 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
| * tst_QCborValue: Disable support for spaceship operatorJüri Valdmann2018-10-311-1/+1
| | | | | | | | | | | | | | Spaceship operator was disabled for QCborValue, but not the test. Change-Id: Icb91da689f62ef6de9f4fa926346505c5e50e9eb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * winrt: Skip a test row of tst_QRegularExpression::threadSafetyOliver Wolff2018-10-311-0/+4
| | | | | | | | | | | | | | | | | | PCRE2 does not support JIT on winrt. This test row takes a long time (30 seconds here) without JIT and thus might cause test timeouts in COIN when run on winrt. Change-Id: I79d9f6be16dbe16594ae2bf51f353acd06b3d2fe Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * qendian: Fix float conversionsIvan Komissarov2018-10-281-3/+37
| | | | | | | | | | | | | | | | | | Since Qt 5.10, qTo/FromBig/LittleEndian<float/double> stopped working. It may be confusing, but big endian floats do exist, so not to break old code, we should support them. Change-Id: I21cdbc7f48ec030ce3d82f1cd1aad212f0fe5dd0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * tst_qeventdispatcher: remove macOS from the BLACKLISTTimur Pocheptsov2018-10-251-2/+0
| | | | | | | | | | | | | | | | | | the test is stable in Qt 5.12. Task-number: QTBUG-60993 Change-Id: I0c366567121688d9518e90b5e8f9ec1b4006b7b9 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * Remove QSKIP and bring the test back to businessTimur Pocheptsov2018-10-251-3/+0
| | | | | | | | | | | | | | | | | | on macOS, where it was skipped but where it now seems to be stable/work. Task-number: QTBUG-39983 Change-Id: I100a57f23b43074ebacc012be247d92acc6ae336 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Simplify the Q_FOREACH macro when using C++17Olivier Goffart2018-10-312-0/+41
| | | | | | | | | | | | | | This way there is only one for loop, which is more optimizer friendly Change-Id: Iaa02026627d5259c3eea1ff5664e8f22664eef73 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-10-254-20/+37
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/animation/qpropertyanimation.cpp src/gui/image/qicon.cpp tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21
| * Fix building tests with -no-guiJüri Valdmann2018-10-201-2/+2
| | | | | | | | | | Change-Id: I37307080e5adc334fcfcdd2fee650d675228a746 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Fix odd test in tst_qflagsAllan Sandfeld Jensen2018-10-171-1/+1
| | | | | | | | | | | | | | | | This test triggered a compiler warning for good reason, it made no sense, trying to change it to what it was probably meant to be. Change-Id: I01a848272b42dae2aaa58a4f5bed998644d864da Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * QMetaEnum: fix UBAnton Kudryavtsev2018-10-171-0/+10
| | | | | | | | | | | | | | | | | | Check ptr before usage. Change-Id: Iac757a2e260b237d837318932cc0b5896c6e04c2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Improve support for QImages in QDataStream read transactionsEirik Aavitsland2018-10-151-17/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QImage's operator>>(QDataStream&) did not set an error mode on the stream on read failures. That would break QDataStream transactions. Since the current QImage serialization cannot differentiate between truncated and corrupted data, we set the ReadPastEnd error as expected by the transaction system. Also specify the expected file format on decoding QImage from stream, to avoid all the format handlers' canRead() being invoked. This is necessary since some of them may call ungetChar(), which fails when the stream is in a transaction. Also add testing of this feature to the QDataStram transaction autotest. That required a slight rewrite of the fake sequential QIODevice subclass. The previous implementation had incorrect behavior of peek(), which is required by QImage decoders. Task-number: QTBUG-70875 Change-Id: If3f1ca7186ad1e6ca0e6e8ea81d2b2fbece6ea01 Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Avoid races on TZ in environment via tzset() callsEdward Welbourne2018-10-221-33/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX specifies that tzset() consults environment variable TZ and modifies some globals; it also specifies mktime(), localtime() and strftime() to behave as if they called tzset(). Fortunately, we only call strftime() from a test and only call localtime() when not threaded. Provide wrappers for tzset() and mktime() that share the lock used by our environment-access code, to prevent races on the environment (and tzset()'s globals) when we call them. In the process, re-use tst_QDateTime's TimeZoneRollback in its older test systemTimeZoneChange() and presume that this can now be tested cross-platform, since TimeZoneRollback is used in another test where this works. Fixes: QTBUG-71030 Change-Id: I79f559b8857ea2803e73501008bf0d7158c6731f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-10-092-0/+11
|\| | | | | | | Change-Id: I5cbfd39cf728036bbdfdeec8e8739568e0a3025b
| * Support QCborMap::operator[] taking a string literalEdward Welbourne2018-10-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a template on the size of the char[], as suggested by Ville Voutilainen. This resolves ambiguity about whether such look-ups should be done via QString or QCborValue (not that it would have made any difference). When we come to add mutating indexing of QCborValue, chained dereferences like map[i][j][k] need to stay in operator[] const throughout, to avoid detaching intermediates to create references into them due to using the mutating operator[] on the earlier dereference's return. So const-qualify the QCborValue operator[] const variants at the same time, to match those of QCborValue itself. Change-Id: Ib1652ae9440fe3767a653afa2856b74040210e07 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-10-081-0/+8
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qtimezoneprivate.cpp Change-Id: Icbb5999d378711ce3786a4fe0aba176a45ac702c
| | * QDateTimeParser: avoid using an invalid hour by defaultEdward Welbourne2018-10-021-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a time-zone does a spring-forward, skipping an hour (either to start DST or to move its standard time), there's an hour that doesn't exist on the day in question. That hour can be the first hour of the day, in which case using 0:0 as the default time is broken. So catch this case and use the first time that day that makes sense. Fixes: QTBUG-70823 Change-Id: I23dae9320a3cdd2c988841a7db1b111edb945730 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Use the stack for storing objectsJesus Fernandez2018-10-081-669/+646
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Theoretically, it could improve the speed. Some of the modified lines also make the style homogeneous. Change-Id: Iaed7b16fa75e485be0f825220c366903525448ce 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>
* | | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-10-081-0/+10
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/styles/qstylesheetstyle.cpp Change-Id: I3a503b44ae413fbc0a90f4af70b8f84daffd86ad
| * | QSFPM: don't let setFilterRegExp(QString) overwrite CaseSensitivityDavid Faure2018-10-031-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a regression from commit 346c15102b, which creates a new QRegExp in setFilterRegExp, losing previously set case sensitivity property (i.e. when the code does proxy->setFilterCaseSensitivity(Qt::CaseInsensitive) before setFilterRegExp). Interestingly that commit ensured that setFilterFixedString would still preserve CaseSensitivity, but not setFilterRegExp(QString). Change-Id: I3d37d001ce6e86dd90e7e07431440a42607172f9 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
* | | Implement QDataStream operator for main CBOR classesJędrzej Nowacki2018-10-033-3/+121
| | | | | | | | | | | | | | | | | | Change-Id: Ib3b68b1963625432c68d02be3bf2ec3c4baf1104 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Implement QJsonValue data stream operatorJędrzej Nowacki2018-10-033-1/+84
| | | | | | | | | | | | | | | | | | Change-Id: I9cff40828ab68b4e2474da506b2da2cfed479f2c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
* | | Implement QJsonObject data stream operatorJędrzej Nowacki2018-10-033-1/+59
| | | | | | | | | | | | | | | Change-Id: I8528f18ad72828cd97a5ac00e1925958acf73f9f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Implement QJsonArray data stream operatorJędrzej Nowacki2018-10-033-12/+72
| | | | | | | | | | | | | | | Change-Id: Ib3c83c06605f0fe39108855bc3416bf453cab043 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Handle errors when streaming QJsonDocument through QDataStreamJędrzej Nowacki2018-10-031-0/+26
| | | | | | | | | | | | | | | | | | Change-Id: I96df896d446e89dc4f9733a6cc6cec61a6826a1f Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Implement QJsonDocument data stream operatorsJędrzej Nowacki2018-10-032-1/+41
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-48313 Change-Id: I25ebeed94c9340819e925a7740bbee21de73a0ca Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-10-015-6/+17
|\| | | | | | | | | | | Change-Id: Ic8cdb1c2b7c0a786b1313b6c3a3bf7e9ec288712
| * | Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-09-305-6/+17
| |\| | | | | | | | | | Change-Id: Iaa438d14357be1bf75bb645cb8d3245947c055b8
| | * Fix QUrl::matches for when removing authority parts (other than host)Thiago Macieira2018-09-291-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QUrl::RemoveAuthority is RemoveUserInfo | RemovePort | 0x10, so the condition if (options & QUrl::RemoveAuthority) would match if any of the other bits for the username, password or port were set, which meant we would skip the host comparison. Ditto for username and RemovePassword. [ChangeLog][QtCore][QUrl] Fixed a bug that caused QUrl::matches to incorrectly compare two URLs with different hostnames or different usernames as equal, if certain QUrl::RemoveXxx options were passed. Change-Id: I015970a03b874898bba7fffd155856ab9d6cb1be Fixes: QTBUG-70774 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| | * QCommandLineParser: Ensure that an option text ends with a newlineAlexander Akulich2018-09-282-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change we inserted newline only if an option has a description and ended up with an arbitrary long line with all options. [ChangeLog][QtCore][QCommandLineParser] Fixed a bug that caused the help output to show two options or more in the same line if the options didn't have a description. Task-number: QTBUG-70174 Change-Id: Id54b9ae13ee596869e4dc14e09301aea19eed2f8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Modernize the "filesystemwatcher" featureLiang Qi2018-09-272-6/+3
| | | | | | | | | | | | | | | | | | Change-Id: If030b56ad97e047d89d442629262b4839df306d4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Expose type id from QMetaType instanceJędrzej Nowacki2018-10-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | There is not reason why it should be kept in secret. Not having public accessor forces a user code to keep a copy of the id. Visible for example in QML (QQmlValueType). Change-Id: If0de65fb8d91bcd50880c66b5f87c68f6d888dd3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | tst_qfileinfo: Refactor ntfsJunctionPointsAndSymlinks()Friedemann Kleint2018-09-301-47/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the creation of the symbolic link/junction from the _data() slot into the actual test function. The parameters are passed by a newly introduced struct. This ensures only the symbolic links/junctions that are actually needed are created. It can then no longer happen that filtering for one data row invokes recursive deletion of the mountpoint junction. Also use of the newly introduced convenience createSymbolicLink() in canonicalFilePath() Task-number: QTBUG-63989 Change-Id: Ia78fd4ad6097136934ab5a375f4c352713d0f115 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-295-15/+65
|\| | | | | | | | | | | Change-Id: I6083c3e61b7dbe188f83676f7e7bb268e5ccf2f3
| * | Fix QXmlStreamWriter xmlns attribute placementhjk2018-09-281-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | Done-by: Eugenio Rustico Change-Id: Ibd6aa6cc8be9090a4fad4f96628086d8a498b8e0 Fixes: QTBUG-63434 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | Re-enable thread autotestsAllan Sandfeld Jensen2018-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Replacing the qmake test with the one corelib/thread/thread.pri uses for those classes. Change-Id: Ie803190b821736c89b056ae51b7dfe92046189eb Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * | Add tests for decoding too-short UTF-8 sequencesThiago Macieira2018-09-252-13/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were handling this properly, but not testing them. I guess we weren't testing because the condition is a valid intermediate state, so hasFailure() is correct it returning false. Testing inspired by the bug reported in https://github.com/intel/tinycbor/issues/137 Change-Id: Ib47c56818178458a88b4fffd1554ecfdd0af637e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | tst_QCborValue: eliminate unused lambdaEdward Welbourne2018-09-251-1/+0
| | | | | | | | | | | | | | | Change-Id: Icb8bd9bd170c8c22978c7d730a8c8b671705adfc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-252-0/+2
|\| | | | | | | | | | | Change-Id: I4d123c3cdf86524716ba67091e0347309b49c837