summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fixes for tst_QTemporary(File|Dir)::nonWritableCurrentDirJoão Abecasis2011-12-092-6/+4
| | | | | | | | - Check path/fileName is empty upon failure, variable was unused - Use /home instead of /, as / is writable by admins on Mac Change-Id: I705471fda8b73843e98b30eb52aa0a73634ec075 Reviewed-by: David Faure <faure@kde.org>
* Extend touch events.Laszlo Agocs2011-12-095-70/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The capability flags indicate which information is valid in the touch points. Previously there was no way to tell if e.g. the value returned by pressure() is actually the value provided by the driver/device or it is just something bogus due to pressure not being supported. The points' flags return information about the individual touch points. One use case is to differentiate between touches made by finger and pen. Velocity, if available, is now also exposed. Each touch point can now contain an additional list of "raw" positions. These points are not reported individually but are taken into account in some way by the underlying device and drivers to generate the final, "accurate" touch point. In case the underlying drivers expose these additional positions, they are made available in the lists returned by the touch points' rawScreenPosition(). The raw positions are only available in screen coordinates to prevent wasting time with mapping from global positions in applications that do not use this data. Instead, apps can query the QWindow to which the touch event was sent via QTouchEvent::window() and can call mapFromGlobal() manually if they need local raw positions. The capability and device type information is now held in a new QTouchDevice class. Each touch event will contain only a pointer to one of the global QTouchDevice instances. On top of type and capability, the new class also contains a name which can be used to differentiate between multiple touch input devices (i.e. to tell from which one a given QTouchEvent originates from). The introduction of QTouchDevice has three implications: The QTouchEvent constructor and QWindowSystemInterface::handleTouchEvent need to be changed (to pass a QTouchDevice pointer instead of merely a device type value), and each platform or generic plug-in is now responsible for registering one or more devices using the new API QWindowSystemInterface::registerTouchDevice. Change-Id: Ic1468d3e43933d8b5691d75aa67c43e1bc7ffe3e Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove QtWidgets dependency from QTcpSocket autotestShane Kearns2011-12-093-33/+12
| | | | | | | | | | | | | | QMessageBox was being used to test nested event loops. This has been changed to use QEventLoop directly. Also, there was an unnecessary use of QPushButton to trigger a test case, which has been removed. As a result, 3 test cases can be run on VXWORKS, and one more test case on Windows that were previously skipped. Change-Id: Ic65ed441cd37d242f89df3ef3b8638a1458d9cf3 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Fix unstable test caseShane Kearns2011-12-092-2/+1
| | | | | | | | | | | | | tst_QTcpSocket::disconnectWhileLookingUp required the host lookup + connect + disconnect procedure to complete in <50ms, which is not always true. When disconnecting (rather than aborting with close()), wait for the disconnection to complete with a timeout of 5 seconds. Task-number: QTBUG-21043 Change-Id: I3b59abf9a8eb2c6d99416e1a8ec6b528885b656e Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* QProcess-test: Fix executable location on Windows.Friedemann Kleint2011-12-091-7/+0
| | | | | | | | | | The executable needs to be in the test directory as it expects it sub-executables from there. Breakage introduced by 3385fb91e1e55e1bfa1f78dfb8ce2e9f3fdaedef Change-Id: Ic1f3db70851f65e2f12041c3a16cb8f0b7bdf35e Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* Promote openStandardStreams sub-tests to top levelJoão Abecasis2011-12-091-10/+2
| | | | | | | | | | | | Commit a72468e820c2922540737c053eef27d033c2e77b split the test into two functions, but kept them combined in a single slot for QTest to invoke. That being the case, we might as well have them as test functions of their own right. Should work nicer with test failures, skips and such. Change-Id: I62c1fc7777c08b3e87a5903632d73dc1e1d97e1a Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* QPixmap test: Re-enable tests of Windows bitmap/icon conversion.Friedemann Kleint2011-12-091-40/+48
| | | | | | | | | | - QPixmap::to/fromWinHICON/BITMAP() became free internal functions (see b8d330904b279de57d70caef70ab2d2a6770f0cc) - Improve QImage check function similar to 11732d133b6a1e367b43d6a2853b3e297eafbf9f Change-Id: I80ff066964ce6c339a6b9bfa5a0e10421dca162a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Tests: Fix the language change test.Friedemann Kleint2011-12-092-15/+21
| | | | | | | | | | | | | | | - Use correct overload for QTranslator::translate() - Fix LTR source text - Use QDir::TempDir correctly (check for slash). - Do not copy executable on Windows (which is locked), use arbitrary data instead. - Use Q_OS_MAC Task-number: QTBUG-21402 Change-Id: I6ba1c7c764d4c847278eaff9a96c8cd312ac204d Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QFile-test: Do not fail when run with redirected stdout/stderr.Friedemann Kleint2011-12-091-5/+11
| | | | | | | Check whether stdout/stderr is sequential. Change-Id: Ia6311e265f0da03dce5b05d78a2058e0c2098bbf Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* QProcess-Test: Improve error handling.Friedemann Kleint2011-12-091-6/+23
| | | | | | | | In case a subprocess fails to start. Change-Id: I1372c07de8f3580a8e7aadd6874da15bf273ac53 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Re-enable 'check' target for tests/auto/gui on Mac OS XBradley T. Hughes2011-12-0910-1/+18
| | | | | | | | | | Failing tests are marked with CONFIG+=insignificant_test. tst_QTextLayout currently asserts, so it has been disabled to prevent destabilization of the CI system. Change-Id: I7bd836ee14085689c8a0f0ce8e3c80d81a55eb94 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Forward the contents of the parents argument through this proxy.Stephen Kelly2011-12-091-0/+53
| | | | | Change-Id: Ifabc2a7deec8ea045bf9a9f46fb3a97410dd33f2 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Notify about moves in the source model more efficiently.Stephen Kelly2011-12-092-3/+133
| | | | | Change-Id: I5ea2a2dddc1b39a3d2b405bda815f42df7c07c75 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix failing setSocketDescriptor test in QTcpSocketShane Kearns2011-12-091-0/+1
| | | | | | | | | | setSocketDescriptor fails because socket is in the wrong state. This is timing dependent, if qt-test-server is still in the DNS cache then the test failed. - clear the DNS cache to avoid the host lookup state being skipped. Change-Id: If159d514b1aa9b62a4834f6352d5e7b0a00a5724 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* testProcessSpacesArgs fixedJoerg Bornemann2011-12-092-2/+2
| | | | | | | Target names with spaces must be quoted. Change-Id: I913ef386353fc75991c8db4e3205ab511fc1f1a9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Improve/cleanup qtemporarydir (and qtemporaryfile) unit testsDavid Faure2011-12-082-75/+33
| | | | | | | To follow the comments in the review by João Abecasis. Change-Id: Ie566705d3b4071b8628d269246aadcde4866f34f Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Fix QTemporaryDir unittest on Mac OS XDavid Faure2011-12-081-7/+9
| | | | | | | | | mkdtemp(10*X) replaces all 10 chars on Mac, while on linux it only replaces the last 6. Adjusted the too-strict tests to allow for both possibilities. Change-Id: Ie6d57bd4947254ad7a39e75ac0e8881cebeaa428 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* QPixmap test: Make lenientCompare() more verbose.Friedemann Kleint2011-12-081-19/+15
| | | | | | | | - Output cause of failure - Streamline code Change-Id: I597e8cf0178c2417ea55c2319398a48d839b4474 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QTestlib/Selftest: Fix Windows.Friedemann Kleint2011-12-081-2/+20
| | | | | | | | | - Do not run with empty environment. At least PATH is required at least (Qt + MSVC/MinGW runtime) - Account for MSVC's different formatting of double numbers. Change-Id: Ic7b1cf4a16a88c5384347b2651b011ac13c92d70 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Create a class to contain accessibilty enums.Frederik Gladhorn2011-12-081-8/+8
| | | | | | | | This is needed in order to expose the enums to qml. Do not inherit QAccessible. Change-Id: I220a0ea3add2d790e4fa6e93ce3deda762859e1a Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Remove unused overload of QTest::qExec.Jason McDonald2011-12-086-111/+1
| | | | | | | | | | | | | The overload of QTest::qExec() that takes a QStringList is not used anywhere in Qt's autotests, despite having been in the qtestlib API since Qt 4.4. This lack of use most likely derives from the fact that none of the QTEST_MAIN macros use the overload, and more than 99% of Qt's tests use those macros to avoid explicitly calling QTest::qExec(). Change-Id: I264b21d7fe1a9f2d565f748cf8bbe32414a73bb0 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Port externaltests.cpp to QTemporaryDirDavid Faure2011-12-071-69/+23
| | | | | Change-Id: I6097ea92dd4b300cb562510e0ea27cee3c01b466 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* qtbase: Remove QSound.Friedemann Kleint2011-12-075-97/+0
| | | | | | | | | Which currently causes tests not to compile on Windows due to missing symbols in QtWidgets (QSound::QSound() ,etc). Change-Id: I87f0a403e61c3a67f9a758f114e33db1012e33e8 Reviewed-by: Michael Goddard <michael.goddard@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Check we're connected before startClientEncryption()Richard Moore2011-12-071-0/+13
| | | | | | | | | The docs say this is required, but we don't check it and instead segfault right now. Change-Id: I825b00a312a481c5383af127333c0c4698188348 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Use QTRY_VERIFY to test asynchronous behaviour.Jason McDonald2011-12-071-23/+2
| | | | | | | | | QTRY_VERIFY waits for a condition to become true while regularly processing events. There is no need for a custom solution to this problem. Change-Id: Ia65c90cbdb165b543f5c78f9bac3cfadd77dfb3f Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Use QTRY_VERIFY to test asynchronous behaviour.Jason McDonald2011-12-071-18/+1
| | | | | | | | | QTRY_VERIFY waits for a condition to become true while regularly processing events. There is no need for a custom solution to this problem. Change-Id: Ia23e2fb61cdc5c3a3a8a729cd4356ba930fe7cb7 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Use VERBATIM where needed in macros.Stephen Kelly2011-12-074-0/+172
| | | | | | | | | | Forward port of fix for http://cmake.org/Bug/view.php?id=12554 Test fails before and passes after. Change-Id: I7a3ab2369cb3095c63f9e2a3e604088ebdcc2465 Reviewed-by: Clinton Stimpson <clinton@elemtech.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Test that options to macros work.Stephen Kelly2011-12-069-0/+264
| | | | | | Change-Id: Id2f57cc2f64ae25f5f84d1206035b7a2c309d1c7 Reviewed-by: Clinton Stimpson <clinton@elemtech.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix tst_QSharedPointer invalidConstructs:forward-declaration failureBradley T. Hughes2011-12-061-0/+6
| | | | | | | | | | When using clang, the forward-declaration test fails to link, unlike with other compilers. The standard says that deleting a forward-declared pointer is undefined behavior, so the link failure is a valid result of trying to do so. Change-Id: I527b91c15b7d51d9522d95af0630e7dacd26bb30 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Test the qt5_add_resource macro.Stephen Kelly2011-12-064-1/+12
| | | | | | Change-Id: I94e4c9e525016405abba90bbdbe58e7786ce5bc4 Reviewed-by: Clinton Stimpson <clinton@elemtech.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Skip untestable interfaces in QTcpSocket::bind autotestShane Kearns2011-12-061-1/+5
| | | | | | | | | | | | | | | bind() test failed if there is an autoconfigured IPv4 address. e.g. bluetooth adaptor that is not attached to a network. Or WLAN adaptor in peer-peer mode. - solved by skipping the autoconfigured IPv4 addresses in the same way as IPv6 addresses are already skipped bind() test fails for proxy - skipped, QTBUG-22964 created Change-Id: I9a799ae8db421783f474e97cf876d6e265516397 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Use plural form for CMake variables.Stephen Kelly2011-12-063-3/+3
| | | | | Change-Id: Idc0cd360e09046a5746c9f7366c7fd4b982058fe Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Remove TESTED_CLASS/TESTED_FILES comments from tests.Jason McDonald2011-12-06283-850/+0
| | | | | | | | | These comments were mostly empty or inaccurate. Appropriate naming of tests and appropriate placement of tests within the directory tree provide more reliable indicators of what is being tested. Change-Id: Ib6bf373d9e79917e4ab1417ee5c1264a2c2d7027 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Don't mark selftest subtests as testcases.Jason McDonald2011-12-062-2/+0
| | | | | | | | | The subtests are intended to be executed by tst_selftests and therefore don't need to have "CONFIG += testcase", which causes 'make check" to treat them as stand-alone tests. Change-Id: I1b47e0186be99c591bb1e03bbec6386518f8a449 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Make tst_QVariant::canConvertMetaTypeToInt more verbose.Jędrzej Nowacki2011-12-051-13/+20
| | | | | Change-Id: If17cbd1154c4fd3c006648b28e91a009de5b373b Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Fixing naming of selftests.Jason McDonald2011-12-054-34/+34
| | | | | | | | Make the test object names correspond to the test program names, so that it is easier to see which test produced each block of test output. Change-Id: Ib19a955938b549f27cdcaac83bfa9150285b396d Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Don't set graphics system at start of test.Jason McDonald2011-12-051-8/+1
| | | | | | | | | | QApplication::setGraphicsSystem() is a no-op, and even if it wasn't it would be unwise to force a graphics system that isn't guaranteed to be included in the Qt build, without including any logic to skip the test if setting the graphics system failed. Change-Id: Id9a0a87586872088625de7840b5032d0c3cc48a1 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fixed tst_selftests findtestdata subtest for shadow builds.Rohan McGovern2011-12-052-0/+6
| | | | | | | | | | This test uses qt.conf to enforce a predictable tests install location. This was not working in the shadow build case, as qt.conf was only present in the source tree; embed it as a resource at :/qt/etc/qt.conf so it works in the shadow build case too. Change-Id: Iec708d9686c29a1fc5ff0020dc11a93a593d20c5 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* New class QTemporaryDir.David Faure2011-12-023-0/+479
| | | | | | | As discussed on qt5-feedback / development lists. Change-Id: If1733369d12daa29054776ec2cbd78e63679768e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix tst_qsql crashes on Mac OS XHonglei Zhang2011-12-022-13/+15
| | | | | | | | | | | | In tst_qsql, there are function calls to QApplication(argc, 0, false), where argc is zero. According to the documentation, argc must be greater than zero and argv must contain at least one valid character string. The misuse of this API has no problem on any platform other than Mac OS. This commit has fixed the crash by passing valid dummy parameters. Task-number: QTBUG-22811 Change-Id: I42b26d66f0becb7a942896e6ddcaea52ff720a48 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Remove QInternal callbacks and internal functionsBradley T. Hughes2011-12-021-73/+0
| | | | | | | | | | | | | | | | After commit 79f675a1e0f628bbc25345ebc1eb1f5809166c6b, the connect and disconnect callback API effectively becomes useless. Now that these callbacks cannot/do not, it makes little sense to keep the backdoors added for Qt Jambi support. Remove them for now. Should the Qt Jambi team want/need to port to Qt 5, we can re-add them, possibly designing a better API for doing so as well. Change-Id: I6209a1d647d683c979d5294b632b8c12c0f9f91c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Implement QDir::removeRecursivelyDavid Faure2011-12-021-0/+83
| | | | | | Task-number: QTBUG-4592 Change-Id: I363e2c24d1c0ada975b8b927d7c6e776b8aae579 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* QSqlRelationalTableModel doesn't follow relations on the first columnHonglei Zhang2011-12-021-0/+55
| | | | | | | | | | QSqlRelationalTableModel doesn't follow relations on the first column of a table. The DisplayRole and the EditRole for indexes on column 0 are always the same. The bug is found in QSqlRelationalTableModel::data. Task-number: QTBUG-20038 Change-Id: Ie1e98b5f46ffc171113f2d51b9b19ff5febb1c3c Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* Remove cast and assignment operators from QAtomicInt and QAtomicPointerBradley T. Hughes2011-12-023-153/+10
| | | | | | | | | | | | | | | | | | | This is a source incompatible change. There is concern that the convenience of the implicit cast and assignment operators can lead to misuse. Several commits have already been done that remove excess use of the implicit cast, which is a *volatile* read every time it's used. Users of the QAtomic* API should have to think about when they are loading the value, and if they do or don't need the acquire memory barrier on load. The code that people would write using this API is meant to be multi-threaded, concurrent, and correct. The API should not allow them to inadvertently, possibly unknowingly, shoot themselves in the foot. SC-break-rubber-stamped-by: Lars Knoll Change-Id: I88fbc26d9db7b5ec80a58ad6271ffa13bbfd191f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Windows: Stabilize qpauseanimation test.Friedemann Kleint2011-12-021-8/+65
| | | | | | Change-Id: I93b470d89009d4573cbe3ec5018cddc40f4a4623 Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Accessibility: table2 -> tableFrederik Gladhorn2011-12-021-22/+21
| | | | | | | | Rename the new interface after the old one has been removed. This interface is very close to the IAccessible2 Table2 interface. Change-Id: I8659232189fe0e8307151c743727de425c30ac9a Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Revert "Add QObject::objectNameChanged(const QString &objectName) signal"Martin Jones2011-12-022-14/+16
| | | | | | | | | | | This reverts commit ba635d7e74472f3a54c0c4686966af46d9035c6f. Breaks tests in declarative: tst_qdeclarativeecmascript::deleteLater tst_qquickvisualdatamodel::objectListModel Change-Id: I467b45109332e66fc62f3de00f376b1b88ab19ca Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Windows: Fix qabstractfilenengine-test.Friedemann Kleint2011-12-011-2/+16
| | | | | | | | | | | The test fails if the repository is checked out with Windows line endings. Try to work around. Basically, ensure that common developers can conveniently run the test. Change-Id: I91f31b830ba7ba305deea782737d4e07a89420eb Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* Make cell a proper QAccessible2Interface.Frederik Gladhorn2011-12-011-21/+24
| | | | | Change-Id: I9b245037e8448f39ed2cb80d1ef5fb0714173518 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Add QObject::objectNameChanged(const QString &objectName) signalBradley T. Hughes2011-12-012-16/+14
| | | | | | | | | | | | | | | | | | | This is sent when the object's name changes. tst_moc must be updated since the method count of QObject has changed. The test assumed that there were 4 invokable methods in QObject. The new signal is the 5th, which breaks the test's assumptions. Fix this as well. tst_QObject must be updated since the QObjectPrivate::isSignalConnected() method only supports the first 64 signals. With the addition of this new signal, sig61() in the test becomes the 65th signal, and will always appear connected now. Task-number: QTBUG-13999 (related) Change-Id: Ie87893c71a231fafa7ccf2f16102238a7be8327a Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>