summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Improve QT5_GET_MOC_FLAGS macroStephen Kelly2012-10-044-0/+127
| | | | | | | | | | | | We need to handle CMAKE_INCLUDE_CURRENT_DIR for include directories. Otherwise generated files located in the current binary directory are not found as expected. e.g. *.json file as meta data for Qt5's plugins generated at build time. Change-Id: I14ae1e7013f9d8b485aa990d50db4a03ca4f4b81 Reviewed-by: Yuchen Deng <loaden@gmail.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* tst_QLocale: remove QSKIP, wrap Q_OS_MAC/Q_OS_WINSergio Ahumada2012-10-041-5/+8
| | | | | Change-Id: I44755379561b98e43dd19c8c01b40349be203e14 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Remove #if 0 usage in QElapsedTimer autotest.Leonard Lee2012-10-041-20/+3
| | | | | | | | | Given QElapsedTimer t1, t2 variable, the t1-t2, t1+1000 (add 1 second) operations not supported. Task-number: QTBUG-22446 Change-Id: Idd87f778c212831aa7f92242452538d113c9cfcf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix #if 0 usage in collections autotest.Leonard Lee2012-10-041-22/+20
| | | | | | | | Removed inappropriate use of #if 0 in collections autotest. Task-number: QTBUG-22471 Change-Id: Ibf4e5fae8e671ebfd0dc5734875fcc8879b330af Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove unused function.Frederik Gladhorn2012-10-031-11/+0
| | | | | Change-Id: Ie8eecf7e4a7475ac84a66b6055149ce92d019785 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Fix for integer overflow in QString::replaceChristian Strømme2012-10-031-2/+0
| | | | | | | Task-number: QTBUG-22967 Change-Id: I604e6a725d46eab4c4369ebb54e8c9ea1350f492 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QTextBoundaryFinder assignment operatorKonstantin Ritt2012-10-031-0/+25
| | | | | | | for the case when the boundary finder is assigned to an invalid one. Change-Id: I5b60984ff3fd99972fcae21895684bd83b012780 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Overhaul a little the QUrl error reporting.Thiago Macieira2012-10-021-11/+16
| | | | | | | | | | | | | | | | | | | | | | Keep the original QString that triggered the parsing error, instead of just one QChar. This provides more powerful error messages, like: Invalid IPv6 address; source was "http://[:::]"; scheme = "http", host = "" (QUrl cannot keep invalid hostnames) Invalid port or port number out of range; source was "http://example.com:abc"; scheme = "http", host = "example.com" (QUrl cannot keep a non-numeric port number) Invalid path (character '%' not permitted); source was "foo:/path%?"; scheme = "foo", path = "/path%25%1F" (the tolerant parser runs first, so the faulty component is fixed) This stores the error state in a special structure which is not allocated under normal conditions, keeping the memory consumption down. On 32-bit systems, QUrlPrivate does not increase in size; on 64-bit systems, it grows by 8 bytes. Change-Id: I93d798d43401dfeb9fca7b6eed7ea758da10136b Reviewed-by: David Faure <faure@kde.org>
* Update some error messages in QUrl::errorString()Thiago Macieira2012-10-021-8/+12
| | | | | | | | | Make both invalid hostname messages start with "Invalid hostname". And split the empty port error from the invalid port one. Change-Id: I870d1ed6fb07ec494f553871a37ed167141ffc06 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Remove the annoying qWarning when QUrl::setPort is out of rangeThiago Macieira2012-10-021-3/+0
| | | | | | | | | | That's what we have QUrl::errorString() for. This will become evident especially now that QUrl::toString() / toEncoded() return empty if there are errors. Change-Id: I64a84e9c6ee57c0fc38cc0c58f5286ddc1248d1f Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: David Faure <faure@kde.org>
* Make QUrl::errorString() usable for QtTest output in invalid URLsThiago Macieira2012-10-024-8/+8
| | | | | | | | | If an URL is invalid, let's indicate that in the test output. To be helpful, let's make QUrl::errorString() include the component form of the URL. Change-Id: Iaafe16973ded79c7ea688fbb23808d91253e8c14 Reviewed-by: David Faure <faure@kde.org>
* Make QUrl::toString() / toEncoded() return empty for invalid URLsThiago Macieira2012-10-021-4/+43
| | | | | Change-Id: I6ebb4ad2901a9bacb09fb81082202f37ebbc2e97 Reviewed-by: David Faure <faure@kde.org>
* Add two compound URL invalidity cases for isValid()Thiago Macieira2012-10-021-14/+32
| | | | | | | | | | | | | | These two errors can only happen if one calls setPath() explicitly. They cannot happen for parsed URLs, which is why they are only caught with isValid(). It's not possible to set the error condition in setPath() either because they depend on the presence / absence of the authority and scheme. Also update all the unit tests that set a path not starting with a slash and were just "freeloaders" on the previous behaviour. Change-Id: Ice58cd4589a850452d7573a5b19667bbab2fb43e Reviewed-by: David Faure <faure@kde.org>
* QProcess.tests: adding test for channel forwardingThomas Hartmann2012-10-024-0/+89
| | | | | | | | | | This tests QProcess::setProcessChannelMode(). The tests verifies if testForwarding really forwards the output of testProcessEcho (spawned by testForwarding). Change-Id: Ifc4164569256aeaeab0edef42116986272362c01 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Rename createLocalFile to createNativeFile & deprecate createLocalFileAndy Shaw2012-10-024-1/+44
| | | | | | | | | | | | | | | | | | As it was confusing to use the term local file when referring to a file that was accessible using native APIs and not just a file that was on a hard disk somewhere already the function name has been changed. By renaming it to createNativeFile we keep it consistant with QFileInfo which has an isNativeFile() function too. Test also added. Task-number: QTBUG-3169 Change-Id: I410e7ed28133d68fd312c6c0faf3f7191460d7ce Reviewed-by: João Abecasis <joao@abecasis.name> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* typo fixed in tst_QLocalSocket::verifyListenWithDescriptor_dataJoerg Bornemann2012-10-021-1/+1
| | | | | Change-Id: Ic549c8fa7f98052a45b391d6a9bfef3d2557c709 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
* QWinOverlappedIoNotifier test for multiple I/O operations addedJoerg Bornemann2012-10-021-20/+102
| | | | | | | | | | | tst_QWinOverlappedIoNotifier::multipleOperations starts asynchronous read and write operations on the same named pipe handle. The received notifications must contain the right byte count and OVERLAPPED pointer corresponding to the I/O operation. Change-Id: I6f3fa5cf3ca6d62fcb9bc7073d28611fcfa7d98a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
* QWinOverlappedIoNotifier: multiple I/O operations on the same handleJoerg Bornemann2012-10-021-4/+4
| | | | | | | | | | | | | When doing multiple I/O operations on the same handle, we get notified for every operations. These must be distinguished by comparing the pointer to the OVERLAPPED struct. We now pass the OVERLAPPED pointer via the notified signal and let the receiver decide if it wants to handle this notification. Change-Id: I4efe70f39c6ae5282b949f2f4b21f6e7dd3df785 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* remove tests/auto/network/socket/qlocalsocket/exampleJoerg Bornemann2012-10-026-196/+0
| | | | | | | | | | The programs in the example isn't used in the test. Examples should be in the right directory and be of a certain quality. Change-Id: Id77bd1295efb3387fa54c379eb9c882cdc5b88bd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* make tst_QLocalSocket::listenAndConnect fasterJoerg Bornemann2012-10-021-4/+2
| | | | | | | Replaced qWait/QCOMPARE with QTRY_COMPARE. Change-Id: Ic534443c187f791c75fe9528251bf47e54f33eed Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QXcbWindow: Don't recreate window when reparenting.Yoann Lopes2012-10-011-40/+11
| | | | | | | | | | | | For consistency, this behavior has been kept across Qt versions... Just get rid of it. Also fixes native child widgets not being notified of the change of window handle (winId) when being reparented. Updated auto-test. Change-Id: I3616dc0f1c32a519d78a4846297d6d4a6e926fbf Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fix moc stumbling over gcc __attribute__ extensionsSimon Hausmann2012-10-012-1/+59
| | | | | | | | | | | | | | | | | Reported by David Faure. In KDE a DEPRECATED macro gets defined in a header file created by cmake. The define is not guarded with #if Q_CC_GNU or similar because at cmake time the compiler is determined. Therefore moc suddenly sees this gcc specific token and stumbles over it. This patch simply defines an empty __attribute__ macro that will expand to nothing and thus become invisible to moc's "C++ parser" after the pre-processing. Change-Id: I4448b9ac3f72b6334e32b27484401fb0fca23a0c Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make documentation of QVariant::isNull more explicit.Jędrzej Nowacki2012-09-291-2/+1
| | | | | | Task-number: QTBUG-22933 Change-Id: I1d8d3fc778ba00bcad11caaaf8af7d87186f18e8 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* QFlags: use unsigned int when the enum's underlying is unsignedMarc Mutz2012-09-281-2/+16
| | | | | | | | | | | Replace storage and operator int() return types with unsigned int if the enum is unsigned. This fixes a number of exisiting warnings, in particular with Qt::MouseButton under GCC. Change-Id: Ia12d36212329aec3e9d62a5fbd38809a6c2b36d0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Include qexception.h instead of qtconcurrentexception.hMarc Mutz2012-09-282-2/+2
| | | | | Change-Id: I9a54412b77596aa74af7a513c33b10eb52257db2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QFutureSynchronizer back to QtCoreMarc Mutz2012-09-284-2/+2
| | | | | | | This class, too, belongs with QFuture. Change-Id: I41a532ca66c156f1631e4b22ffc1a5879c854488 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QFutureWatcher back to QtCoreMarc Mutz2012-09-285-1/+1
| | | | | | | | This belongs with QFuture. Change-Id: I555cd01c1d3890fbbaca4fd8a9170292ea4eb0fb Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QFuture from QtConcurrent to QtCoreMarc Mutz2012-09-287-6/+6
| | | | | | | | | This class belongs to QThreadPool/QRunnable more than to QtConcurrent, so move to QtCore, where QThreadPool awaits it. Change-Id: Ibf20288a986593bf779453427c2dae8db1e1423a Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QtConcurrent::ResultStore as QtPrivate::ResultStore to QtCoreMarc Mutz2012-09-285-36/+34
| | | | | | | | | | No compatibility header needed. While this wasn't marked as private API, it wasn't documented, either. This is a prerequisite for moving QFuture to QtCore. Change-Id: I8e986e6e2a22fbe5cf08d0600ec39ae9ae993e20 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QtConcurrent::Exception as QException back to QtCoreMarc Mutz2012-09-284-24/+24
| | | | | | | | | Leave the old name as a deprecated typedef; adapt users. This is a prerequisite for moving QFuture back to QtCore. Change-Id: I81dcee2c7e6eb234c16f3f42e2415ca0da3dc4f8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_QDateTimeEdit: cleanup whitespace & follow Qt coding styleJ-P Nurmi2012-09-281-76/+31
| | | | | Change-Id: Iae04cd0c9ac6ea85621b293f2ce184d673548e9b Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Update the NaN tests to deal with non-conformance betterThiago Macieira2012-09-281-15/+16
| | | | | | | | | | | | ICC apparently optimises 0 * anything directly to zero, even when it should be doing a multiplication to conform to IEEE requirements. GCC in fast-math mode does the same, but that also makes the rest of the function unreliable, so we try to turn off fast-math mode if we can. Task-number: QTBUG-22340 Change-Id: I0e3c5f4927b0a6bcb3189bb156c18843fc4b29b9 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Run application main run loop in color/font dialog testTeemu Katajisto2012-09-272-24/+46
| | | | | | | | | | | | | | | | | | In cocoa the timers are associated with main run loop but the way font and color dialog tests are executed the modal dialog run loop is only run in cocoa. This causes timers to not to fire and test cases to hang. Unfortunately this does not completely fix the test failure because the QTest::keyClick is not working with cocoa native dialog helpers and therefore the tests are marked with QEXPECT_FAIL. Task-number: QTBUG-24320 Task-number: QTBUG-24321 Change-Id: I88740a20ad2b794b6ca15e1b6455f436ffd39335 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Fix drag and drop with native widgetsjian liang2012-09-271-1/+26
| | | | | | | | | | | | | | | Task-number: QTBUG-27336 Don't check 'widget != m_widget' in QWidgetWindow::handleDragEnterMoveEvent() since the current window's parent widget may be the actual drop target. I replace it with a check '!widget->isWindow()' to prevent we pass through a top level window. I also change 'widget->mapFrom(m_widget, event->pos())' to 'widget->mapFromGlobal(m_widget->mapToGlobal(event->pos()))' since m_widget may not be widget's parent. Change-Id: Ia4f10f85ccdf1e27223ddc51afabd98b5d16f2fb Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Test: Enable tst_QWMatrix::operator_star_qwmatrixCaroline Chao2012-09-271-7/+2
| | | | | | | | | | Expecting results were not correct. The test is passing. Task-number: QTBUG-22362 Change-Id: Ie41c262019f76aace9062d7897d7934dc7437c3a Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Test: Split tst_QVarLengthArray::oldTestsCaroline Chao2012-09-271-46/+48
| | | | | | | | | | | | | | | The entire test is currently skipped while only the last part is causing problems. Move the out of memory test code to its own test function and skip only this function with the appropriate bug number. By allocating too much memory this test is causing a crash. Task-number: QTBUG-27361 Task-number: QTBUG-22342 Change-Id: Ia308099b7f12cf2c567b62063a7bbcc6fb38515b Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* tst_QLabel: remove QSKIP, wrap Q_OS_MACJ-P Nurmi2012-09-271-3/+5
| | | | | Change-Id: If67dbb07900bfa8f1bcf55aa457bd90ef0550900 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* tst_QMenu: remove QSKIP's -> wrap Q_OS_WINCEJ-P Nurmi2012-09-271-6/+10
| | | | | Change-Id: If8cb4a7dc0630aca83e4796bffb46f547abc4b6f Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* tst_QMainWindow: remove QSKIP, wrap Q_OS_MACJ-P Nurmi2012-09-271-4/+4
| | | | | Change-Id: Ided3c4cbdc7508a36e96351b5f60d79532bb7f26 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* tst_QAbstractButton::keyNavigation(): QSKIP -> XFAILJ-P Nurmi2012-09-271-3/+7
| | | | | | | Task-number: QTBUG-22286 Change-Id: If2c0e9181f2d954f3487dbb4c3f440d26a38adb6 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* remove no-op test from tst_qfileJoerg Bornemann2012-09-271-23/+0
| | | | | | | | | | According to the repo history the tailFile was introduced with the S60 port but the functionality it's testing was never implemented. Task-number: QTBUG-22341 Change-Id: I16e8e43bbd799f05f8b136925cb0add0b918289e Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* tst_QCommandLinkButton: cleanup whitespaceJ-P Nurmi2012-09-271-17/+11
| | | | | Change-Id: Ia1aab643f7b93b0532a38b27d7777fbcf5f489bc Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Remove CDE and Motif styles from qtbaseJens Bache-Wiig2012-09-276-53/+24
| | | | | | | | | | | | | | | | | It is time to clean up some of our legacy code. These styles have not been actively maintained for a long time and I think it is safe to say that they should no longer belong as part of the default distribution of Qt. We dont support any platforms based on CDE with our source packages. Note that even if we are removing these styles from the default distribution of Qt, applications that depend on them will still be able to bundle the existing (and unmodified) styles along with their own source code as we are not breaking compatibility. Change-Id: I1709630c20ba8e8088cd01628628d86856db57a4 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* tst_qcheckbox: remove duplicate codeJ-P Nurmi2012-09-271-8/+0
| | | | | Change-Id: Ic5d7694251e42a6d5ad7fea19137b71bc499ac94 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* QtWidgets auto tests: revise clipboard related testsJ-P Nurmi2012-09-273-85/+20
| | | | | | | | Use PlatformClipboard::isAvailable() and omit relevant test cases when QT_NO_CLIPBOARD is defined. Change-Id: I7e7b20a0a18f1a82987564f0e5e6c76d9207bc4b Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Revise QClipboard auto testsJ-P Nurmi2012-09-273-24/+33
| | | | | | | | Use PlatformClipboard::isAvailable() and fix build when QT_NO_CLIPBOARD is defined. Change-Id: I18c3af42fe39cf7618c2530723149848a10db985 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Auto tests: add PlatformClipboard::isAvailable()J-P Nurmi2012-09-271-0/+69
| | | | | Change-Id: Ie04060c2cae61ff8268644e9cd8001a1f5745f31 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* tst_QDialog: fix Q_OS_WINCE & QT_NO_SIZEGRIP usageJ-P Nurmi2012-09-271-9/+23
| | | | | Change-Id: I443381ef4f10492eeda0fc681c390e0cd4d4125e Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* tst_qsidebar: remove duplicate codeJ-P Nurmi2012-09-271-6/+3
| | | | | Change-Id: I8ee59022199fda7ea56891a2f924954cb4aefa42 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* QMetaType build fix with Q_NO_CURSOR and friends.Jędrzej Nowacki2012-09-271-1/+1
| | | | | | | | | | | | QMetaType has a way to "switch off" some types from the build. QtMetaTypePrivate::TypeDefinition<T>::IsAvailable is defined as false for all unaccessible types. Sadly that information was never used by gui and widget handlers. The patch implements it. Change-Id: Ie5835be4c88cfbbca8a4e9199e31ddfc20cae190 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Jing Bai <jing.bai@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>