summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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>
* 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>
* 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-282-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Correct usage of network-settings.h.Jason McDonald2011-11-283-0/+8
| | | | | | | | | Four of the modified files only use functions from network-settings.h on Windows, and the other three files don't use anything from that header. Change-Id: Ifa4b0319d14367735b859e538921fa0eeeccce1a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Test QAtomicPointer<const T>Olivier Goffart2011-11-261-0/+52
| | | | | | | | Commit f4b6628083bf98ffa9169d8a8b890d84b6046867 fixed it on windows. Now test it work within QAtomicPtr Change-Id: Ibf5c31a133d6d544a78ce626fac9085b73c97fd5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Cleanup corelib autotestsJason McDonald2011-11-2518-151/+168
| | | | | | | | | | Bug trackers come and go, so using bug identifiers in function and test case names will ensure that those names eventually become meaningless. It is better to choose a meaningful name and provide explanatory comments where appropriate. Change-Id: I67c27782ef21b5d4eaab4854079a043c8ef6957b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* More tests for the new connection syntax.Olivier Goffart2011-11-251-0/+226
| | | | | | | | | | Those tests are the one from Thiago's C++0X implementation The rvalue references ones are commented out because moc do not understand them yet But supporting them may come later. Change-Id: I6b0720e7f2992be9f7e34770960fa58fa456a54b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add support for QueuedConnection when connecting using the new syntaxOlivier Goffart2011-11-251-0/+27
| | | | | | | QMetaCallEvent now can handle a pointer to QSlotObjectBase Change-Id: I94da1e68ce9bb1fd96a9ae013a389552eb625faa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* New QObject connection syntaxOlivier Goffart2011-11-251-0/+409
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In addition to the old connection syntax, you can now connect using function pointers. connect(sender, &Sender::valueChanged, receiver, &Receiver::updateValue ); You can connect also to functor or C++11 lambdas The connections are now type safe (no more problems with namespaces or typedefs). Implicit type conversion is also supported. The new syntax forces us to change the meaning of signal form protected to public, in order to be able to access the signal's address everywhere The way it works is by introducing new overload of QObject::connect that take function pointer as parametter. Those new overload are template function, that are implemented inline. The actual implementation is in QObject::connectImpl which take a QObject::QSlotObject* as parametter for the slot. That slot object contains a virtual function which call the slot which has to be implemented in the header as it depends on the template parametter. So the internals of QObjectPrivate::Connection will store this QObjectSlot* in order to be able to make the call. You can read a full description here: http://developer.qt.nokia.com/wiki/New_Signal_Slot_Syntax History of commits before it was imported on gerrit: https://qt.gitorious.org/~ogoffart/qt/ogoffarts-qtbase/commits/qobject_connect_ptr Thread on the mailing list: http://lists.qt.nokia.com/pipermail/qt5-feedback/2011-August/000796.html http://lists.qt.nokia.com/pipermail/qt5-feedback/2011-September/001248.html (The discussions on the mailing list were about trying to find a solution that do not need making signals public, but no user friendly solution was found) Note: support for QueuedConnection, and the symetric QObject::disconnect is added in another commit. Qt::UniqueConnection is not supported yet in the new overload. Change-Id: I67d08436b0720e7f2992be9f7e34770960fa58fa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change the return value of QObject::connectOlivier Goffart2011-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | From a bool to a handle to to connection. Also added a new overload of disconnect that disconnect a handle This is required because with the new syntax taking lambda or functors, it is the only way to disconnect a connection (as it is impossible to compare functors) The new return value is QMetaObject::Connection, it is a wrapper around the internal QObjectPrivate::Connection. QObjectPrivate::Connection is now reference counted. tst_qglobal.cpp: This test set up an internal callback, and the callback do not set any proper connection handle (and tbh, it would be hard for it to do so). So the returned QMetaObject::Connection is invalid, and ok is false (Internal callbacks are only used for jambi and should probably be removed) Change-Id: I111626fb4f47efc4db5e2ea5bff9da15f08fea7b Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add a parents parameter to layoutChange signals.Stephen Kelly2011-11-241-0/+172
| | | | | | | | | | This allows for more focussed notification of what part of the model has changed layout. The slots in the proxy models can be more optimized later. Change-Id: I1bd17465b4be6f8efdc107036db897c557fcb519 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Improve QVector autotestJason McDonald2011-11-241-1/+1
| | | | | | | Ensure that data row names are unique. Change-Id: Ia6cf6e440d631928ae3352d7305c6cf2ee5b2a0c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Only use QVERIFY in test functions.Jason McDonald2011-11-241-16/+16
| | | | | | | | | | The modified test was using QVERIFY in the destructor of a local class, but QVERIFY should only be used directly in a test function. This commit changes the local class to record the result of the test and verifies that result in the test function. Change-Id: Ie68ac6aa880368c961ebfa67cd452f0fbf26db89 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add missing indentation to QFuture test.Jason McDonald2011-11-241-70/+68
| | | | | Change-Id: Iaceaa79237d5ef6e81d1d16dc5e3fd3d97631f3a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove misleading comment.Jason McDonald2011-11-231-1/+0
| | | | | | | | In the QProcess test, QHostInfo is used as a quick and easy way to create a background thread, and so is not (entirely) unnecessary. Change-Id: I7204f113e7bc8a4b312d5a20f0a6ee076c56b35d Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* uclibc: fenv.h does not define the necessary things.Holger Hans Peter Freyther2011-11-221-3/+7
| | | | | | | | | | libstdc++ provides the fenv.h found and for uclibc default toolchains the bits/c++config.h has _GLIBCXX_HAVE_FENV_H undefined leading to no import of the uclibc fenv.h Change-Id: I53173b099f3d8791f527f1ccb60991de57cd19db Filed: https://bugs.busybox.net/show_bug.cgi?id=4484 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
* Revert 3a0f5d04fce00812cddd44e54ef25f7ab7d9240dToby Tomkins2011-11-221-3/+3
| | | | | | | | | | | | The removal of plugin cache in qt5 (8ed47d961dc7e6f161030654d11cd330a542eadf) means that only the original loading error (from QElfParser) is reported. In Qt4 this was previously two different strings depending on if the library had been previously cached. Task-number: QTBUG-22834 Change-Id: I15a4adc7d0f8f23f16bb2aa8ba8b968db770f074 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove reset test from QTimeLine.Jason McDonald2011-11-221-40/+2
| | | | | | | | | | | | QTimeLine::reset() never made it into the public API. Instead QTimeLine::start() always starts from the beginning. Remove the commented-out test for reset() and related remnants in other tests. Restarting a timeline using QTimeLine::start() is already tested by the restart() test function. Change-Id: Ia5c767ddae0781d645a407fbea76e80672895aab Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add test for QTimeLine::toggleDirection()Jason McDonald2011-11-221-9/+10
| | | | | | | | | | Before QTimeLine made it into the public API, the toggle() function became toggleDirection() and isReversed() became the more generic direction(). This commit uncomments the old toggle() test and uses the final function names. Change-Id: Ie3379f32ff0c78436f33c2733232d795ca88152b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Restore commented-out data in QString test.Jason McDonald2011-11-221-2/+2
| | | | | | | | | The restored test data was commented-out before the tests were imported into the Qt repository in 2006, but appears to be valid and passes on Linux. Change-Id: I75795bf2b0b45fc2331bca6ac8d89f57cf12ed3d Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove obsolete data from QStringRef test.Jason McDonald2011-11-221-9/+0
| | | | | | | | The removed data was copied from the QString test (from which it has since been removed) and wasn't valid, as comments indicated. Change-Id: I44f066e41d28333326ad97f652c0a6813a173f15 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove obsolete code from QRegExp test.Jason McDonald2011-11-221-67/+0
| | | | | | | | The removed test functions were all empty and have been commented-out since the tests were imported into the Qt repository in 2006. Change-Id: I4ce86440aed355352a26ebefeafc95eeda1efbdd Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Removed commented test data from QUrl test.Jason McDonald2011-11-211-7/+5
| | | | | | | | | | | The removed test data is invalid for the toString() test function -- QUrl::toString() won't eliminate relative paths from URL's, you need to call QUrl::resolved() to do that. Add this test data to the test for QUrl::resolved(), as the existing tests don't seem to cover the case of a complete URL containing a relative path. Change-Id: Idb0f4eac9cc75258a8e17f10fa95ddb75f01d470 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add a roles argument to the dataChanged signal.Stephen Kelly2011-11-211-0/+61
| | | | | | | | | This allows more granular reporting of what has changed. This change is binary incompatible and source compatible. Change-Id: I7c5beaee651a24780cc94e41383f7a80210bc603 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Re-enable the corelib autotests on Mac OS XBradley T. Hughes2011-11-219-0/+18
| | | | | | | | | | | | | | | | | | | This is the first change to re-enable the autotests for the individual qtbase modules. This means adding subdir.CONFIG=no_check_target for each module (except corelib) in tests/auto/auto.pro instead of in tests/tests.pro QFileSystemWatcher, QIODeice, QSettings, QTextStream, QSocketNotifier, QVariant, QPluginLoader, QLocale: These tests currently fail, which will block any changes that attempt to re-enable the autotests. Ignore the failures for now by marking them as insignificant. QAbstractItemModel: This test currently crashes, which can destabilize the CI system when attempting to re-enable the autotests. Skip this test for now by disabling the check target for it. Change-Id: Ie5147d5c5cfae5e7d0a495d5c4788ce92fe2e6d8 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* qtbase tests: Fix some warningsFriedemann Kleint2011-11-2110-32/+26
| | | | | | | | - Fix warnings about QAtomicPointer/Int usage - Fix some gcc 4.6 warnings about assigned/unused variables Change-Id: Ib4dbf9110f0dad93ad48e97278310f05fad3a82a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove obsolete code from QRect test.Jason McDonald2011-11-211-126/+0
| | | | | | | | The removed code has been commented-out since Qt 4.0 and relates to QCOORD, which was part of Qt3Support and has thus been removed from Qt5. Change-Id: I4651738d505234abe9b79ef5045c55cbf132a88e Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove empty functions from QLocale test.Jason McDonald2011-11-211-10/+0
| | | | | | | | These functions have been commented-out and empty for more than five years. Change-Id: I52d6dc0366cd8eae8701b05e4c66e9911bf7e8f7 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Restore commented-out code in QHash test.Jason McDonald2011-11-211-1/+1
| | | | | | | | | | | | | | The restored code verifies the following statement in the documentation of QHash::find(): "If the hash contains no item with the key, the function returns end()." It is not clear why the code was commented-out in the first place, as this occurred before the tests were imported into the Qt repository in 2006. Change-Id: I745393a8e3e728fc60009da07abd038a3d56e99c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Restore commented-out code in QByteArray test.Jason McDonald2011-11-211-3/+3
| | | | | | | | | The restored code was inexplicably commented-out by commit d57aec33 (non-public history), which was only supposed to be changing upper-case booleans to lower-case. Change-Id: I1581fc89511f600c614871e1aec6bc030cddf40e Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove obsolete code from QStateMachine test.Jason McDonald2011-11-211-366/+0
| | | | | | | | | The removed code was already disabled because it tested API that never made it into an official Qt release -- see commit f7d69d75 in the Qt 4.x history. Change-Id: I4f7eb20f937bdabfcac92842c5804233dca26a23 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove obsolete code from QStateMachine test.Jason McDonald2011-11-211-245/+0
| | | | | | | | | The removed code was already disabled because it tested API that never made into an official Qt release -- see commit ad1441fc in the Qt 4.x history. Change-Id: I7dbfb83c82bdb79e8d3f7f6c7043d76913dea589 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Improve diagnostics of QPluginLoader test.Jason McDonald2011-11-181-4/+4
| | | | | | | | Use QVERIFY2 so that the test output shows the full error string when it does not contain the expected sub-string. Change-Id: I31f91bd5c47c082aacabd2333bc12137bc4d24a6 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix indentation of QPluginLoader test.Jason McDonald2011-11-181-21/+21
| | | | | Change-Id: I4c6957d2a67ac387232226098b4490e3d5a86d51 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Improve QPluginLoader autotest diagnostics.Jason McDonald2011-11-181-53/+16
| | | | | | | | | | | Previously, the user had to recompile the test with an additional define to see the plugin loader error string. By re-ordering the verification statements, we can ensure that the error string is visible in the test results whenever its value is not the expected value, thus eliminating the need for conditional diagnostics. Change-Id: Iae9ef0b7cbad551fd56f0e0439eaad034f2420e3 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove disabled code from QLibrary autotestJason McDonald2011-11-181-5/+0
| | | | | | | | | | The removed code was already commented-out when it was first added in 2007, and would not form a useful test as it was not followed by any verification steps. QLibrary::setLoadHints() is tested elsewhere, so this code can vanish. Change-Id: I1c4dcaacaf31b0f38136336414cfbe3de1a406f3 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove disabled test data from QVariant test.Jason McDonald2011-11-181-4/+0
| | | | | | | | The removed data duplicated the first row of test data in the same function. Change-Id: I5d55b970d072d58c170b3ed3004c1661c6d0d13c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove obsolete code from QVariant test.Jason McDonald2011-11-181-2/+0
| | | | | Change-Id: If609ddbef7002cb48f4459efd8f2c6edb02c8677 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove obsolete code from QTimer test.Jason McDonald2011-11-181-5/+2
| | | | | | | | The removed code was for Windows versions <= 2000, which are not supported by Qt5. Change-Id: I779ffb8427035b7eb97d8d0af403d03065bc779c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Change confusing test function name.Jason McDonald2011-11-181-2/+2
| | | | | | | | | | | Naming a test function "_data" is potentially confusing as that string is a suffix reserved for functions that create data tables for data-driven tests. Presumably this function was accidentally caught in a search and replace at some point before the tests were imported into the Qt repository in 2006. Change-Id: I451c0400a1580233ee90b75dd5ad489ee3d3788e Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix typo in QUrl autotest.Jason McDonald2011-11-181-3/+3
| | | | | Change-Id: Id85ad5c16e3a5b7a1614affa041d19f5062073fd Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove obsolete test data from QFile test.Jason McDonald2011-11-181-1/+0
| | | | | | | | | | | The removed data relied on the test's own source file having no write permissions, but that is not a valid assumption -- in a source package the file wouldn't have had write permissions, in Perforce it would have depended on whether the file had been checked-out for editing and in git the file would always have write permission. Change-Id: I3b6100429120137095a210189961c8b97f06e50a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove obsolete test data from QFileInfo test.Jason McDonald2011-11-181-1/+0
| | | | | | | | | | | The removed data relied on the test's own source file having no write permissions, but that is not a valid assumption -- in a source package the file wouldn't have had write permissions, in Perforce it would have depended on whether the file had been checked-out for editing and in git the file would always have write permission. Change-Id: I000596f122f2765f97a09a08074938c90e2e9f95 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove obsolete comment from QDataStream test.Jason McDonald2011-11-181-6/+0
| | | | | | | | | The removed comment was introduced before the tests were imported into the Qt repository in 2006 and seems to relate to a test failure that no longer occurs. Change-Id: I01f372f6a4f48110711f4f2a86e73acfb7134e24 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>