summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* QtTest: Remove Windows CE.Friedemann Kleint2016-04-061-1/+1
| | | | | | | | | Remove #ifdef sections for Q_OS_WINCE and wince .pro file clauses in library and tests. Task-number: QTBUG-51673 Change-Id: I552b3fe8d6e0eb7c8c7b3a3d41558e5e21904dd2 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QChar: optimize comparison with QString{,Ref}Marc Mutz2016-04-051-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Instead of relying on the QString relational operators to implicitly convert the QChar to a QString, add relational operator overloads that compare the QChar without first turning it into a QString, saving one memory allocation per comparison, and allowing to mark the operation as nothrow. Consequently, in tst_QStringBinOps, verify now that all relational operations are noexcept. The added overloads make QChar ==/!= int comparisons ambiguous. De-ambiguate by providing a constrained template that matches int and nothing but int (otherwise, the QChar and the int versions would compete for a QChar::SpecialCharacter argument, and end up creating new ambiguities). This solution may not be perfect, but it can be easily extended should more ambiguities crop up. The existing overload deals with all patterns found in qtbase. Change-Id: I4156d918e9b9134c1da684b8b69e0ee526ad24e3 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/devLaszlo Agocs2016-04-05105-295/+855
|\
| * Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-04-05105-295/+855
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/corelib/ipc/ipc.pro src/plugins/platforms/xcb/qxcbbackingstore.cpp tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp Change-Id: Ia006e10ff1732fe78f90138c41f05b59b49486cf
| | * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-0438-47/+286
| | |\ | | | | | | | | | | | | Change-Id: I35ca979395620e104e50b06366d0869433a4ffc2
| | | * QVariant: Fix flags for type-erased associative iterator keyStephen Kelly2016-04-031-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The flags here are passed to a private QVariant constructor, and they really represent a boolean - IsPointer or not. Because the flag for the key_type was incorrectly populated with the flag for the value_type, memory would be corrupted when using a mapping type whose value_type is a pointer, but whose key type was not, such as QMap<QString, int*> This typo has been there since the concept was introduced in commit v5.2.0-alpha1~807 (Add container access functionality for associative containers in QVariant., 2013-04-05). Task-number: QTBUG-52246 Change-Id: I9ecb13c603015eed2dc2ca43947fa0ecd6be8b5a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | * Fix QtGui dependencies in tests/benchmarksKai Pastor2016-04-015-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, -no-gui builds failed already while running qmake. Change-Id: I3e300a16669371098589822806c5cf8aa9b801c7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | | * QPointer: add a test for const QPointer<X>Marc Mutz2016-04-011-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | People use this, so make sure there's a test for it. I don't expect this test to fail, but static and dynamic checkers should be presented with this use-case, so they have a chance of warning, because certain implementation strategies of QPointer may make this code undefined. Change-Id: I334bd73204ba4e186c4098fc6b7188917407e020 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | * Autotest: Remove blacklistingsSimo Fält2016-04-018-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removing blacklistings from tests that are now passing. Change-Id: I00aa1ce286d3e7715fb4bee4a36d0d77049a29ae Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
| | | * Fixup for text labels in lancelot graphics testEirik Aavitsland2016-03-312-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some strings were drawn with a different size or scaling than what the string itself said, causing confusion. Change-Id: I4b187cba6d467cfa0900576bdf451052baa806e6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| | | * moc: bail out early on missing or invalid options fileJoerg Bornemann2016-03-311-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If moc is invoked with the @ argument and no options file is specified or the options file cannot be read, do not try to parse the empty arguments list. Otherwise QCommandLineParser will print an additional error message that is of no value for the user. Task-number: QTBUG-51847 Change-Id: I9aa1eb20a44097b553123be8bc6fded87473a03a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | * Fix possible crash in QImage::pixel()Eskil Abrahamsen Blomfeldt2016-03-311-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QImage::pixel() assumed that the color table was valid for the values in the bitmap. This was always wrong for indexed images with explicit no color table set and was wrong for mono images that were constructed from preexisting data. For mono images, we default to a black/white color table, like we do when constructing with uninitialized data. For indexed image, we always default to no color table, but instead of crashing in pixel(), we warn and return an undefined value. [ChangeLog][QtGui][Image] Fixed possible crash in QImage::pixel() for mono or indexed images. Change-Id: Ieaf19c03984badddfd06e1855a7e287b862adc70 Task-number: QTBUG-50745 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| | | * Enable cmake auto tests for -no-guiKai Pastor2016-03-303-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change disables tests which require QtGui. Change-Id: Ib647afd086f54536054cb4c0cde5696d762ee8c4 Reviewed-by: Stephen Kelly <steveire@gmail.com> Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
| | | * QTextEdit::inputMethodQuery(): Preserve types when applying offset.Friedemann Kleint2016-03-301-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code converted QRectF into QRect when applying the offset. Change the offset point to QPointF and change the conversions accordingly. Add an autotest similar to that of QPlainTextEdit. This minimizes rounding errors and prevents conversions since the input method logic mostly uses qreal. Task-number: QTBUG-51923 Change-Id: I0c2f80ccae028d8bbbb97ec603f8782f69959c76 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | | * QtWidgets: Add autotests for Qt::WA_OutsideWSRange flagBłażej Szczygieł2016-03-291-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-48321 Task-number: QTBUG-49445 Task-number: QTBUG-51788 Change-Id: I6c04919ff788cad684df69d0aee73d86fd985bb9 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
| | | * QPlainTextEdit: Take vertical offset into account when answering input ↵Friedemann Kleint2016-03-291-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | method queries. Determine offset point to similar to QTextEdit::inputMethodQuery() and add an autotest. Task-number: QTBUG-51923 Change-Id: I8232eb348063e2cd95d0632fe74a6eb30c897eda Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | | * Purge sRGB chunks from PNGs in tests.Edward Welbourne2016-03-2910-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Subjects each *.png file that matched grep -law "sRGB" to: pngcrush -ow -brute -rem allb -reduce (Two needed -force but did get smaller.) Change-Id: Ia030f0bc1d3617ba716bcc26677ff919ef58423c Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
| | | * Allow to style arrows drawn with drawPrimitive in QCommonStyle.Hannah von Reth2016-03-251-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Its currently not possible to style the arrows with QCommonStyle because drawPrimitive from QCommonStyle is called instead from the proxy. Change-Id: I910b13df110601cb18578bc16edfa5ddaa17bbd2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | * Fix qSetMessagePattern to have many time/backtrace partsM. Moellney2016-03-251-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation overwrote multiple 'time' parts in the qSetMessagePattern with the last setting in the pattern line. %{time}%{time process}%{time boot} ended up to be output as if %{time boot}%{time boot}%{time boot} was set. This fix keeps the arguments of each individual 'time' part. The same holds for multiple 'backtrace' parts. The previouse implementation overwrote multiple 'backtrace' arguments with the arguments of the last occurrence. This fix keeps the individual arguments for the 'process' parts. The individual arguments are applied in qFormatLogMessage. A new test to verify the individual 'time' arguments application is added, too. Task-number: QTBUG-51944 Change-Id: Ib757614a482c5f31ed0a61b550daa2eea4b907b4 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | * Update comment in tst_QLocalSocket::readBufferOverflowJoerg Bornemann2016-03-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWindowsPipeWriter doesn't write in a separate thread anymore. Change-Id: Id978bfdfa2531be91cce94476ab9b0dff237bd61 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
| | * | Check that window has been paintedMilla Pohjanheimo2016-03-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test is preventing us to take RHEL 7.1 in the CI for Qt 5.7. Changed the paintEvent() test to be less strict about the paintCount. Task-number: QTBUG-51809 Change-Id: I84f797442e38c66dc23862e92eda6db08bcac368 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * | Remove the traces of the discontinued android-no-sdk platformEirik Aavitsland2016-03-3035-48/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleaning out the workarounds for the discontinued "Embedded Android" platform of Boot2Qt. Change-Id: I0ff9d770e82a43457fb7e5da0428f4597ead4038 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | * | Unify license header usage.Jani Heikkinen2016-03-2925-75/+325
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update files using old header.LGPL3 to header.LGPL Update files using old FDL template to use new one Update files using old BSD template to use new one Change-Id: I36a78272516f9953d02956522f285b40adfc8915 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| | * | Merge remote-tracking branch 'origin/5.6' into 5.7Simon Hausmann2016-03-246-97/+141
| | |\| | | | | | | | | | | | | Change-Id: I13c7ea6a74eb98606cf45702ae068101943bec6a
| | | * tst_QAtomicInteger: fix UBs (signed overflow)Marc Mutz2016-03-241-93/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop addSub() test. It executes exactly the union of fetchAndAdd() and fetchAndSub(), which have already had their UBs fixed. No need to do fixes in duplicated code. Change-Id: Ib72caab0310fce3ff9a40c261d8a38518f91ecaf Reviewed-by: David Faure <david.faure@kdab.com>
| | | * Add a write buffer to QLocalSocket/WinJoerg Bornemann2016-03-241-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 0307c008 removed the buffering of data-to-be-written from QWindowsPipeWriter, because it was assumed that users of this class (QProcess and QLocalSocket) already buffer data internally. This assumption was wrong for QLocalSocket. The following sequence localSocket->write(someData); localSocket->write(someMoreData); would not write anything on the second write. Add a write buffer to the Windows implementation of QLocalSocket. Task-number: QTBUG-52073 Change-Id: I6d0f03a722ec48138cbde3e2f69aae7dafe790d3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | | * QAbstractItemView test: check that the selection model is in sync with the viewGiuseppe D'Angelo2016-03-231-0/+55
| | | | | | | | | | | | | | | | | | | | Change-Id: Ifca91154b47184a9d9a1979e1fba471517e16698 Reviewed-by: Stephen Kelly <ske@ableton.com>
| | | * QAbstractItemView: trigger handlers (and redraw) when changing selection modelGiuseppe D'Angelo2016-03-231-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The most visible problem is that changing selection model didn't update() the view, resulting in the old selection/current item still being drawn. In general trigger the handlers for when the selection/current item changes. Change-Id: Ib3b2ad70412e6a21a182d4c173e617710bcc630d Task-number: QTBUG-50535 Reviewed-by: Stephen Kelly <ske@ableton.com>
| | | * Initialize input method for read-only QTextBrowserMarko Kangas2016-03-231-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set input method attribute to be aligned with read-only value in QTextBrowser initialization Task-number: QTBUG-52071 Change-Id: If0e64bf09e2a2d505ed66fcbfb8cd12ae39844d3 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
| | | * Fix tests for build with -no-guiKai Pastor2016-03-232-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I48d5452daeaf3490ed7a5b8c30953da019bb33af Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
| | * | Merge remote-tracking branch 'origin/5.6' into 5.7Simon Hausmann2016-03-232-28/+55
| | |\| | | | | | | | | | | | | Change-Id: I9a10e1f3c9506ec8554d8f59b6300825ac730939
| | | * Remove QPROCESS_USE_SPAWN and all that it surroundsJames McDonnell2016-03-221-28/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The spawn code was only used to make QProcess work on QNX 6.5.0. Fork works on QNX 6.6.0. The QNX spawn implementation has a flaw that causes a deadlock in certain situations. When a working directory is specified for the process, the QNX spawn implementation stops all threads except the one doing the spawn so that it can temporarily change the process' working directory. This can lead to a deadlock if the thread does anything that conficts with something being done in a stopped thread. QNX 6.5.0 is no longer supported in Qt 5.6.0 so we can just switch QNX to the fork implementation and get rid of the spawn implementation. Made a QNX specific adjustment to the hardExit test. There's a bug in the OS that the test can run into because it does something that normal applications wouldn't. Task-number: QTBUG-47250 Change-Id: Ib32567d2c15ce651815858000035ac5aa6f35224 Reviewed-by: Dan Cape <dcape@qnx.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
| | | * Add auto-test for crash in QCocoaBackingStoreGabriel de Dietrich2016-03-211-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This issue has been solved some time between 5.6 and 5.6.0. We just make sure to protect against further regressions. Change-Id: Ic3fdad901ed5f36792ae04b3d65047da95eea668 Task-number: QTBUG-50561 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | | | QChar: add missing relational operators against QLatin1String/QStringRefMarc Mutz2016-04-051-22/+0
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For QChar <> QStringRef, equality and inequality were already provided (via QChar -> QString implicit conversions, to be fixed in a separate patch). Missing were the less/greater than (or equal) operators. Added. For QChar <> QLatin1String, all relational operators were missing. Added, too. [ChangeLog][QtCore][QChar] Added missing operator{<,>,<=,>=} comparing against QLatin1String and QStringRef. [ChangeLog][QtCore][QChar] Added missing operator{==,!=} comparing against QLatin1String. Change-Id: I9941fe7e7281ea560b3bd5970cb9651ffadc1495 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Remove Windows CE from tests (others).Friedemann Kleint2016-03-3128-663/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove #ifdef sections for Q_OS_WINCE, wince .pro file clauses and CE-specific files. Task-number: QTBUG-51673 Change-Id: Ibf599204f5c0daaef086edaf8fac86853db3ee14 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | QtGui: Remove Windows CE.Friedemann Kleint2016-03-3023-144/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove #ifdef sections for Q_OS_WINCE and wince .pro file clauses in library, and tests. Task-number: QTBUG-51673 Change-Id: I55f61845c3b54027c467a5c59c122e7d16955358 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | QtCore: Remove Windows CE.Friedemann Kleint2016-03-3057-742/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove QSysInfo::WV_CE_5/6 enumeration values, #ifdef sections for Q_OS_WINCE and wince .pro file clauses in library, examples and tests. Task-number: QTBUG-51673 Change-Id: Ib63463445f3a26e04d018b193e4655030002f5f9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | QtNetwork: Remove Windows CE.Friedemann Kleint2016-03-2928-166/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove #ifdef sections for Q_OS_WINCE and wince .pro file clauses in library, examples and tests. Task-number: QTBUG-51673 Change-Id: I3706336395620522ceda414d7437295d9ec64f16 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Add QCommandLineOption::Flags containing HiddenFromHelp and ShortOptionStyleOlivier Goffart2016-03-232-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new option, QCommandLineOption::ShortOptionStyle, which helps applications (such as compilers, so moc and now qdoc) which need to mix long-style and short flags. [ChangeLog][QtCore][QCommandLineOption] Added flags() and setFlags() methods. Added ShortOptionStyle and HiddenFromHelp flags. Change-Id: I944ce56aff2b28ecd6bb9d2d23c4e726e9d06647 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-03-2259-346/+1357
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/common/wince/qplatformdefs.h src/plugins/platforms/directfb/qdirectfbbackingstore.cpp src/plugins/platforms/xcb/qxcbbackingstore.cpp Change-Id: Ied4d31264a9afca9514b51a7eb1494c28712793c
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-2124-87/+544
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/styles/qgtkstyle_p.cpp tests/auto/corelib/io/qtextstream/test/test.pro tests/auto/corelib/plugin/plugin.pro Change-Id: I512bc1b36acf3933ed2b96c00f476ee3819c1f4b
| | * Fix QFINDTESTDATA when using cmake ninja generatorStephen Kelly2016-03-195-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Qt CI does not have ninja, but the autotest can be used for manual regression finding. cd qtbase/tests/auto/cmake qmake make check cd build cmake . -DHAVE_NINJA=ON ctest -R FINDTESTDATA Change-Id: Ic3f3748f6ab04e37fa5287c59486e5cd46dcabb4 Reviewed-by: Stephen Kelly <steveire@gmail.com>
| | * Manual High DPI test: Create Dnd pixmap with device pixel ratio.Friedemann Kleint2016-03-161-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Apply the device pixel ratio from the widget unless Shift is pressed. Task-number: QTBUG-46068 Task-number: QTBUG-50938 Change-Id: Ib806b7e545fa228043566800d22d1002728732bf Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
| | * WinRT: Fix QTimeZone transitions by switching backendMaurice Kalinowski2016-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously WinRT was using the UTC backend which fails on all platforms for some QDateTime autotests related to timezone items. Hence switch to the Windows implementation for WinRT as well. However, the windows backend does query the registry heavily, which is not supported on WinRT. Instead use the API version provided by the SDK. Long-term we might want to switch to this version on desktop windows as well, as direct registry access would not be required and we could harmonize the codepaths for both platforms. Change-Id: I620b614e9994aa77b531e5c34c9be1da7e272a30 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
| | * Manual High DPI test: Add test for window masks.Friedemann Kleint2016-03-161-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | Add a toggle for setting a triangular mask on the main window. Task-number: QTBUG-50938 Change-Id: Id4a3ee0b80e170f4ee1d195e60ce7bfa8e524359 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
| | * tst_QXmlStream::writerHangs(): Create file in temporary directoryMaurice Kalinowski2016-03-161-1/+2
| | | | | | | | | | | | | | | | | | | | | A test should not write to its directory. Change-Id: I34dfc36387cf5a637b325be29c8a19ff51d9b9c3 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
| | * QTextStream test: Change current directoryMaurice Kalinowski2016-03-162-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | For platforms with builtin testdata/sandboxed platforms we need to change the current directory to be able to create files. Change-Id: I440205c95dd6df1308c6bf24b1b0f67fd697feab Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
| | * tst_qtabbar sizeHints fixMilla Pohjanheimo2016-03-161-16/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tst_qtabbar uses fixed values to check the minimumSizeHint and it fails with screens that have a higher resolution. The test still uses the default values, but now in the beginning it creates enough tabs so that it goes over the default. Change-Id: I3f891d2661288d7fad50ad522d73f634b3e91958 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
| | * QRect: fix UB (int overflow) in center()Marc Mutz2016-03-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QRect::center() should be defined for any QRect(x1,y1,x2,x2), INT_MIN <= x1, x2, y1, y2 <= INT_MAX because the average of two signed integers is always representable as a signed integer. But not when it's calculated as (x1+x2)/2, since that expression overflows when x1 > INT_MAX - x2. Instead of playing games with Hacker's Delight-style expressions, or use Google's patented algorithm, which requires two divisions, take advantage of the fact that int is not intmax_t and perform the calculation in the qint64 domain. The cast back to int is always well- defined since, as mentioned, the result is always representable in an int. Fix a test-case that expected a nonsensical result due to overflow. [ChangeLog][QtCore][QRect] Fixed integer overflow in center(). This fixes the result for some corner-cases like a 1x1 rectangle at (INT_MIN, INT_MIN), for which the previous implementation could return anything (due to invoking undefined behavior), but commonly returned (0, 0). Change-Id: I1a885ca6dff770327dd31655c3eb473fcfeb8878 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| | * tst_QRect: drop a test that depends on int overflowMarc Mutz2016-03-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compiler can statically check that this is undefined behavior: tst_qrect.cpp:3173:52: warning: integer overflow in expression [-Woverflow] << QRect(QPoint(0,0), QPoint(INT_MAX+(0-INT_MIN),INT_MAX+(0-INT_MIN))); ~^~ tst_qrect.cpp:3173:72: warning: integer overflow in expression [-Woverflow] << QRect(QPoint(0,0), QPoint(INT_MAX+(0-INT_MIN),INT_MAX+(0-INT_MIN))); ~^~ Fix by skipping the test (like most of the others are in the block). Change-Id: I359a5e16db6c660c9f11d7dd8fbb40730bd63887 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>