summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Pass the tests when run in visual studio.Stephen Kelly2011-12-012-0/+4
| | | | | | | | Make sure the name of the project corresponds to the project name passed to try_compile so that the .sln files are created. Change-Id: Ifee24ac4ab6a16a538bdf7fb32ea252eb1ba436a Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Fix QTcpServer::serverAddress() for dual stack socketsShane Kearns2011-12-012-1/+39
| | | | | | | | | | When listening on QHostAddress::Any, serverAddress() should return QHostAddress::Any too, assuming that setting the socket options was successful. Task-number: QTBUG-22899 Change-Id: I50a9ff1b4ad0c1c1905e2952c595d7068df2627d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Tests: Temporarily remove qsound.Friedemann Kleint2011-12-011-0/+2
| | | | | | | As the test does not link Windows. Change-Id: I07ce2381146e43aef4353ddb2625ac472e6a0555 Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* Windows: Fix compilation of qdir test.Friedemann Kleint2011-12-011-1/+1
| | | | | | | Introduced by 3385fb91e1e55e1bfa1f78dfb8ce2e9f3fdaedef. Change-Id: If47a9874cccb7b64840e77b1f654ba8e1cf372e0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Improve Q_CONSTRUCTOR_FUNCTION and Q_DESTRUCTOR_FUNCTION macros.Jędrzej Nowacki2011-12-011-0/+13
| | | | | | | | | | | | | By adding anonymous namespace and static linkage we are reducing visibility of implementation of these macros. This patch also fixes warning about a declared but unused variable which was issued by gcc 4.6 for Q_CONSTRUCTOR_FUNCTION. Change-Id: I2cb70ad4c93f6f77e5518420abcce6fd4cadccfa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Mark tst_qfilesystementry as private test on Windows.Rohan McGovern2011-12-011-0/+3
| | | | | | | On Windows (only), this test depends on some Q_AUTOTEST_EXPORT symbols. Change-Id: I3b2ef8dcd56b8860f02fc28f45823b889e794909 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* testlib: add QFINDTESTDATA macro for finding testdata filesRohan McGovern2011-12-0110-1/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Automated tests often need to load some data from external files. Currently, a wide variety of approaches for this have been used in Qt autotests, including: - embed the source directory into the test binary at compile time, and find the testdata relative to that; this fails when the source tree is no longer available (e.g. when the tests are deployed to a device). - use a path relative to the current working directory, and trust that the caller always sets the current working directory such that the testdata can be found; this fails when the caller uses a different working directory than expected. - use a path relative to QCoreApplication::applicationDirPath(); this fails when source tree != build tree (since testdata is not automatically copied into the build tree). - compile the files into the binary using the Qt resource system; this should work, but does not allow for testing of code which genuinely needs external files. It seems that there is not a simple method for determining the testdata path which can be reliably used in all circumstances, so various tests have reinvented the testdata location method in different ways. Therefore, this is a good candidate for an addition to the testlib API. The current implementation of QFINDTESTDATA is able to find testdata in all three of (build tree, install tree, source tree), in that order. Change-Id: Ib2fed860723ccf437240da3b00db22dfe1a6b56c Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Fixed installation of corelib testsRohan McGovern2011-12-0184-762/+497
| | | | | | | | | | | | | | | | | In .pro files, removed wince/symbian-specific DEPLOYMENT cases and replaced them with TESTDATA where appropriate. In .cpp files, removed SRCDIR and relative paths to testdata and replaced them with the QFINDTESTDATA macro where appropriate. Modified test helper apps/libs to install themselves under the test they relate to. This change allows corelib tests to be correctly installed, along with their testdata, via `make install'. Change-Id: I5e202e2f3b577af7e39072d5c9fe13e0ca125304 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Fix compilation of Benchmark tests on Windows.Friedemann Kleint2011-12-014-5/+6
| | | | | | Change-Id: I92186f916792d110f22b23525b673ef006e19046 Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Improve QString autotest.Jason McDonald2011-12-011-8/+7
| | | | | | | | | | | | | | | The QString autotest shares test data between the remove() and replace() tests because those functions are very similar. Unfortunately, when an integer overflow bug was found in remove() the regression test was not shared with replace(), which prevented the same integer overflow bug from being discovered in replace(). This commit improves the test by sharing the overflow test data between both functions, thus demonstrating the remaining bug. Task-number: QTBUG-22967 Change-Id: I2778249800f74799d890eefa9227ca8ddd8fbaa3 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Minor improvement to QByteArray autotestJason McDonald2011-12-011-28/+23
| | | | | | | | | | | | | | | | Rename the qUncompress test to make clear that the test only deals with uncompressing corrupted data and add a message making it clear that this test will produce some warning messages. Don't skip creating the test data, as that prevents the test output reporting exactly what is skipped. The expected output is the same for every row (an empty QByteArray), so don't bother storing that in the data table. Change-Id: I59f1cc91a941bcaadacb2a613dd5eca2564961c1 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Make QWinEventNotifier part of the public APIDebao Zhang2011-12-011-1/+1
| | | | | | | | | | | | QWinEventNotifier is an essential class if you're using native Windows Overlapped IO and need to convert it to Qt signals. However the header is marked private. Task-number: QTBUG-68 Change-Id: I22e9a84da97f969ddb82e9ba15e604a01abd80d0 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Fix QHostAddress::operator==(QHostAddress::SpecialAddress)Shane Kearns2011-11-301-0/+4
| | | | | | | | | QHostAddress(QHostAddress::Any) was not equal to QHostAddress::Any because only one of the operator== overloads was handling this. Task-number: QTBUG-22898 Change-Id: Ifd36947a50e8c36362b4e850fd8d5105ee0925ff Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Support for up to 6 arguments in the new connection syntaxOlivier Goffart2011-11-301-2/+0
| | | | | | | For compilations without variadic template support Change-Id: I78af4f6022ad7a0923e5c5788a34eb7d834f50f3 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Fix sqlite driver memory eating due to close failureHonglei Zhang2011-11-301-0/+49
| | | | | | | | | | | | | | If an ongoing query is not finalized before close function is called, sqlite driver still tries to close the connection to sqlite. In this case, sqlite reports an error to sqlite driver which is not reported to the client. The failure in close causes connection to sqlite unclosed and memory is not freed. This fix tries to finalize all queries before close function is called. The close function should succeed. Task-number: QTBUG-16967 Change-Id: I2f10a2a9017446a9d44b693b00464a89625e3602 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* Moved integrationtests/* into other/Jo Asplin2011-11-30182-41/+38
| | | | | | | | | | | | | | | Currently there seems to be no precise definition of what an integrationtest is in the context of Qt testing. To avoid confusion, the tests under integrationtests/ are moved into other/ (which is effectively where we keep tests that don't clearly fit into any other category). Tests can be moved back into an integrationtests/ directory at a later point, should an unambiguous definition be established. Change-Id: I3bb289be2dc2aca11b51a8ce8fcc5942f06d6c5c Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Cleanup corelib autotestsJason McDonald2011-11-3021-130/+84
| | | | | | | | Remove references to the old bug tracker. The data from the old bug tracker is no longer accessible, so these markers are meaningless. Change-Id: Ib9d029d52b70fd0a512b9532d65f03763eabfe57 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Benchmark the new signal slot connection syntax.Olivier Goffart2011-11-301-18/+74
| | | | | | | | | | | | | - Added emition of a slot connected using the new syntax, as well as a functor - Replaced the old connect_disconnect_benchmark by a new one. The old one was of little interest as it tried to connect to every signal, producing a lot of similar results. The new test tests different ways of connecting and disconnecting Change-Id: I3c04c24027252308f8942bcd9562110104cdb4e9 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Fix Qt::QueuedConnection when signal has a return valueOlivier Goffart2011-11-301-0/+57
| | | | | | | | | | For queued connections, the args[0] is set to null as it make no sens to forward the return value to the signal. So we need to check in the operator, that the pointer is not null. (container.data is args[0]) Change-Id: I80bde66f1ec19de0f4962c80e5b2797d2819075c Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Support Qt::UniqueConnection in the new connection syntaxOlivier Goffart2011-11-291-0/+65
| | | | | | | | | | This commit also improves the related documentation a bit. The test is copied from the test with the old syntax, but all the connection statement are changed to use the new syntax Change-Id: Ia5630ca4335b9f8ca6d724ae3c8750d6f0804d8e Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Initialize the return value of signalsOlivier Goffart2011-11-291-0/+236
| | | | | | | | | | Before, the constructor was called for complex objects, but POD were left unitinialized. Now, they are zero-initialized. Also add test for return values Change-Id: Iff9bf6687589d7b7395a71fb6f650ab8aa2b6bd1 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* QObject::disconnect with new syntaxOlivier Goffart2011-11-291-0/+105
| | | | | | | | | | | | | | | | | | | | | This add an overload to disconnect which is symetrical to the new syntax of connect. It is possible to diconnect connection like this: QObject::connect( sender, &Sender::valueChanged, receiver, &Receiver::updateValue ); QObject::disconnect( sender, &Sender::valueChanged, receiver, &Receiver::updateValue ); This overload only work with pointer to member function, and not static functions or functors. The test is copied from tst_QObject::disconnect(), just changed the syntax of the connection and disconnection Change-Id: Ia8f819100cb12098e32877522b97b732b1e676a8 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Install CMake config files from Qt.Stephen Kelly2011-11-2911-0/+468
| | | | | | | | | This includes a BSD licenced file Qt5CoreMacros.cmake which is adapted from Qt4Macros.cmake in the CMake source tree. Change-Id: I54326b808795535490a0489659b351a8da72cdbb Reviewed-by: Clinton Stimpson <clinton@elemtech.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Make the default ssloptions testable.Richard Moore2011-11-291-0/+5
| | | | | | | | | Centralise the specification of the default ssloptions to make the code clearer and more testable. Change-Id: I4f4bae72736dd063ee4cd64c6375e82d0600a105 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fix linking of autotests on Windows.Friedemann Kleint2011-11-299-9/+9
| | | | | | | | | Partial revert of 94fc8750797ffd3ef867d0cdc7849492cfee2c23. All dependent modules need to be specified in the QT variable, except core and gui, which are there by default. Change-Id: Ie8ffed56de03a37da191772fa321ed162e44a50d Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Fix compilation of qeasingcurve autotest on Windows.Friedemann Kleint2011-11-291-1/+1
| | | | | | | MSVC cannot decide on an overload for pow(). Change-Id: Ied3fbc0de403774d9f85738852cf671ce42cd1c1 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Temporarily disable Windows-specific QPrinter autotest.Friedemann Kleint2011-11-291-3/+3
| | | | | | | See QTBUG-22927. Change-Id: I6022d795bf893797c2ab1a91ffffa7b482109137 Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
* Fix compilation of some benchmark tests on Windows.Friedemann Kleint2011-11-293-1/+4
| | | | | Change-Id: Iab6b83f3d4693a3b5deaaf88043dde75a84866fd Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Cleanup corelib autotestsJason McDonald2011-11-298-33/+33
| | | | | | | | Don't name test functions using task identifiers from obsolete bug trackers. Change-Id: Iba6ae8ad3b39e365c5510ed5c86749a167572829 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fixed Qtbase OSX specific namespace compilation.Toby Tomkins2011-11-291-0/+2
| | | | | | Change-Id: Idacfa679df7aa6417f8017f80928907830d15df2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix crash in tst_qatomicpointer testOlivier Goffart2011-11-291-12/+13
| | | | | | | | | | | | | if given char*, QCOMPARE will try to compare the strings pointed by the char* In this case, the char* just point to garbage, we just want to compare the addresses. (Was changed in commit 6fcfae99d3615c7a850e4933691763097078c8e4) Change-Id: I9edb2b676aedf67a252aea6a41d56cd1eef7befc Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Improved failure messages from tst_qlibraryRohan McGovern2011-11-281-6/+5
| | | | | | | Use QVERIFY2 to include errorString() in the failure message. Change-Id: Iecb4e7694c3d71bfb786908a6a6c26b187d60c8f Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Fix sanity check of network test serverJason McDonald2011-11-2826-11/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of Qt's autotests depend on access to a test server. For each test that used the test server, tests/auto/network-settings.h created a global object to verify at startup that host lookups to the test server will succeed (and abort the test otherwise). There are two problems with that approach: First, the sanity check happens before main(), and thus before the test framework has started logging test results. This means that if the sanity check aborts the test, the failure message will not be visible in the test output if logging to a file or will cause the output to be malformed if logging to the console in XML format. Second, since Qt 4.7, the host lookup uses a class that connects to the QCoreApplication instance, which doesn't exist before main(), and this caused all tests that included network-settings.h to output an error message from QObject::connect() at the beginning of the test. Both of these problems are solved by removing the global object from network-settings.h and instead performing the sanity check in the initTestCase() function of each test. Task-number: QTBUG-22876 Change-Id: Id49c1826906327bf571686cc11527f0265e5af44 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>