summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/thread
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate duplicate data row names from corelib autotests.Jason McDonald2012-02-141-11/+11
| | | | | Change-Id: I57a37f19746b76c6c9c3534f5c66c5a5478dae24 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Improved stability of tst_qsemaphore (especially on mac)Rohan McGovern2012-02-082-18/+25
| | | | | | | | | | | | | | | | | Timers are not entirely precise; if we ask for a timeout of 10000 milliseconds, we might time out in 9999 instead. Also, we know the expected elapsed time in each case, so do a fuzzy comparison against that time. Previously the test was verifying that the elapsed time was greater than or equal to the timeout in the case where a timeout was expected, which means the test would not detect bugs which incorrectly caused the timeout to occur later than it should. (cherry picked from qt4 commit 9a2573dc13b3e8df6cd15bef64370ea407480fc7) Change-Id: I91d0c81f989ab43a3c48f6abbb4c5b28e2b35402 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Move QtConcurrent into its own moduleLars Knoll2012-02-054-0/+855
| | | | | | | Task-number: QTBUG-20892 Change-Id: I614500aafb6428915509983608bbb0ade4e4f016 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-3015-15/+15
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-251-1/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-2315-15/+15
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Changed unittests in corelib to use specific headers instead of super-headers.Kurt Korbatits2012-01-161-1/+2
| | | | | | | | | | | | Modified unittests to use specific class headers instead of using super-headers like QtCore that pull in all the headers for the module. - Decreasing build time. Change-Id: I9c3fd0767be15205893bb406f609c8283a2a3a5a Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-0515-15/+15
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Make sure tst_QThreadStorage finds its subprocessBradley T. Hughes2012-01-031-0/+4
| | | | | | | | | On Mac, the application's dir is in the bundle, so we need to "escape" the bundle when looking for the an executable relative to the application's dir path. Change-Id: I5c01f7d816ec8cc30f5277202f4eefb0c49a2bc3 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Use true and false in preference to TRUE and FALSE in tests.Jason McDonald2012-01-031-8/+8
| | | | | | | | | Use the C++ boolean constants true and false instead of the C macros TRUE and FALSE (which are actually integers), and use QVERIFY instead of QCOMPARE for verifying simple boolean expressions. Change-Id: Ie76dfcab6722df6b93b3fa62b0f3437901482932 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add Qt::TimerType argument to QAbstractEventDispatcher::registerTimer()Bradley T. Hughes2012-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | ... and deprecate the old registerTimer() functions. The new pure- virtual registerTimer() breaks source-compatibility. Subclasses cannot be instantiated anymore, since the pure virtual function signature has changed. QAbstractEventDispatcher::TimerInfo is no longer a QPair. It is now a struct with timerId, interval, and timerType members. This is a source incompatibility that should only affect subclasses of QAbstractEventDispatcher, which will need to pass 3 arguments to the TimerInfo constructor instead of 2. If the subclass used QPair<int,int> instead of the TimerInfo typedef, the QPair<int,int> declarations will need to be replaced with TimerInfo. Call the new registerTimer() function with the type from QObject::startTimer(). Change all subclasses of QAbstractEventDispatcher to reimplement the new virtual function. The type argument is unused at the momemnt, except to ensure that registeredTimers() returns the type each timer was registered with. Implementations for the various dispatchers will be done in separate commits. Author: Thiago Macieira <thiago.macieira@nokia.com> Change-Id: Ia22697e0ab0847810c5d162ef473e0e5a17a904b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove mention of trolltech from QThreadStorage test.Jason McDonald2011-12-281-1/+1
| | | | | | | Task-number: QTBUG-19653 Change-Id: I6c74a15b6c6db415a545328b73b6dd704d69bfee Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QThread-test: Fix test on Windows (timer inaccuracy).Friedemann Kleint2011-12-141-9/+4
| | | | | | | | | | - Tolerate WaitTime - 1 (799ms when expecting 800ms). - Remove commented-out code. Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Change-Id: Ibe246d47ab7667692386b0f9333150c195948282 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove TESTED_CLASS/TESTED_FILES comments from tests.Jason McDonald2011-12-0612-36/+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>
* Remove cast and assignment operators from QAtomicInt and QAtomicPointerBradley T. Hughes2011-12-022-151/+8
| | | | | | | | | | | | | | | | | | | 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>
* Fixed installation of corelib testsRohan McGovern2011-12-012-9/+7
| | | | | | | | | | | | | | | | | 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 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>
* 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-253-46/+49
| | | | | | | | | | 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>
* qtbase tests: Fix some warningsFriedemann Kleint2011-11-211-9/+9
| | | | | | | | - 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>
* Don't depend on moc to disable test functions.Jason McDonald2011-11-181-6/+3
| | | | | | | | | | | | | | | | | | | | | The moc tool is not aware of all defines (particularly those that are compiler builtins) and does not correctly evaluate others that depend on compiler builtins, such as Q_OS_FOO. This commit reverts parts of the following commits, but is not a complete fix as there were many instances of this problem in the tests prior to those commits: 924d810dbdcd5b5b0fa860922b2487ea9062d002 8aaff6751038b88d17e23be6fcee945771297c5b 338d3f11973412047c2c9cd41cbd0c961d738ef3 a55034062ba2bf73a9f1ed3d9cf31745b38149e3 253497b7446c7d723aa3bdd7152e25d6852f2604 7cfad460c56319ba89c4a3a0bbcb2e54ab1cdbc6 9d2ff58f3642828e494e7e9b2df7dbb8e2cd408f 0cf6baa2d61ebaad2a2a0530c37f27e719b68f4b Change-Id: I947d797fe3ec76139ba1b55561cea569895662c5 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fixed compile of autotests with -qtnamespace.Rohan McGovern2011-11-181-1/+4
| | | | | | | Make sure to use the Qt namespace for qGlobalPostedEventsCount. Change-Id: I558a0b0fba1e22a2edd96f9499a2bab82046c4a4 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Remove warnings from deprecated atomic operators in autotestsBradley T. Hughes2011-11-164-120/+123
| | | | | | | | | | | | | Use QAtomic*::load() and ::store() instead of the deprecated cast, assignment, and comparison operators. These will be removed in the near future. The tests for these particular operators have not been changed, though, as the change to remove the operators will also remove the respective tests. Change-Id: I2f24d18992af0c6e0f487d707218e4e84f4bdd12 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Allow to create a custom event dispatcher for specific QThreads.Sven Anderson2011-11-151-0/+74
| | | | | | | | | | | | | | QAbstractEventDispatcher() does no longer install itself into the current thread. Instead the new methods QThread::setEventDispatcher() and QCoreApplication::setEventDispatcher() allow to install a custom event dispatcher into any QThread as long as there is no default event dispatcher created yet. That is, before the thread has been started with QThread::start() or, in case of the main thread, before QCoreApplication has been instantiated. Change-Id: I7367e13d8d8aebed5a5651260bb69b8818eb1b90 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Cleanup corelib autotestsJason McDonald2011-11-141-1/+1
| | | | | | | | | | | | | Remove various disabled and/or non-helpful debugging code. Any test diagnostics that are useful should be part of the regular test output, as the CI system cannot switch on commented-out code when there is a test failure. Diagnostics should also be informative -- simply printing the value of a variable with no other information about what is being printed (or why it is being printed) is not informative. Change-Id: I21a6c2121be86001bb57e80f426507b6e619ee9e Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Cleanup corelib autotestsJason McDonald2011-11-111-2/+5
| | | | | | | Use QVERIFY2 to provide better test diagnostics. Change-Id: I128004f4ee133ceed4d8f373bbbe4a0eee431ebf Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Cleanup corelib autotestsJason McDonald2011-11-1112-38/+23
| | | | | | | | | | | | | Tidy the autotest .pro files. Most autotest .pro files should look like this: CONFIG += testcase TARGET = tst_something QT = core testlib SOURCES = tst_something.cpp Change-Id: I877c2194e9fa9dd13478d117895e1e255a948ad7 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Cleanup corelib autotestsJason McDonald2011-11-102-72/+72
| | | | | | | Remove literal tabs. Change-Id: I210a0259773cceb20d35ebc80b889e3ebb88b540 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Cleanup corelib autotestsJason McDonald2011-11-0711-160/+21
| | | | | | | Remove redundant empty constructors, destructors and test functions. Change-Id: Idb51368895e67ec3fc0345a9a5d33d77730c051b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QThread::isFinished should return true from finished()Olivier Goffart2011-11-031-0/+34
| | | | | | | | | | | | | | | | | | | and isRunning() should return false. This restore the Qt 4.7 behaviour In Qt 4.7, the finished() was called with the thread's intenal mutex locked. Which mean that: - Call to isRunning or isFinished called from a slot connected to finish within the thread would deadlock. (Hence no compatibility to keep here) - Call to isRunning or isFinished from a slot connected with QueuedConnection in another thread would lock the mutex until the destructors are finished. and then return as if the thread have finished. Change-Id: I963eccae8f7634aff90cc4bbab6ca886a78e35eb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* corelib: eliminated usage of qttest_p4.prfRohan McGovern2011-10-2512-24/+36
| | | | | | | | | qttest_p4.prf was added as a convenience for Qt's own autotests in Qt4. It enables various crufty undocumented magic, of dubious value. Stop using it, and explicitly enable the things from it which we want. Change-Id: I7c1ffe9c8c294dbdc988e1582e580b1ed3f4593e Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Remove DEPENDS_ON from qtestlib API.Jason McDonald2011-10-192-36/+0
| | | | | | | | | | The DEPENDS_ON macro didn't do anything and has misled many users to think that they can write test functions that depend on other test functions. Task-number: QTBUG-21851 Change-Id: Ibe65b2d5d88bb81b6a0ebbe0b220f7d409a1446c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Avoid using QSKIP in lieu of compile-time checksJason McDonald2011-10-071-3/+6
| | | | | | | | | | | | | | | | QSKIP is intended to be used to skip test functions that are found at run-time to be inapplicable or unsafe. If a test function can be determined to be inapplicable at compile-time, the entire test function should be omitted instead of replacing the body of the test function with a QSKIP, which only serves to slow down test runs and to inflate test run-rates with empty, inapplicable tests. Task-number: QTQAINFRA-278 Change-Id: I95feba3edbfa092c0ef4d85bb8c6877bd6be698e Reviewed-on: http://codereview.qt-project.org/6128 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Avoid using QSKIP in lieu of compile-time checksJason McDonald2011-10-051-4/+4
| | | | | | | | | | | | | | | | QSKIP is intended to be used to skip test functions that are found at run-time to be inapplicable or unsafe. If a test function can be determined to be inapplicable at compile-time, the entire test function should be omitted instead of replacing the body of the test function with a QSKIP, which only serves to slow down test runs and to inflate test run-rates with empty, inapplicable tests. Task-number: QTQAINFRA-278 Change-Id: Ib2025339422749cf216e87ac414a3056250bf8f9 Reviewed-on: http://codereview.qt-project.org/5942 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Make all uses of QBasicAtomicInt and Pointer use load() and store()Thiago Macieira2011-10-035-13/+13
| | | | | | | | | | | | | | Most of these changes are search-and-replace of d->ref ==, d->ref != and d->ref =. The QBasicAtomicPointer in QObjectPrivate::Connection didn't need to be basic, so I made it QAtomicPointer. Change-Id: Ie3271abd1728af599f9ab17c6f4868e475f17bb6 Reviewed-on: http://codereview.qt-project.org/5030 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove Symbian-specific code from tests.Jason McDonald2011-09-295-37/+4
| | | | | | | | | Symbian is not a supported platform for Qt5, so this code is no longer required. Change-Id: I1172e6a42d518490e63e9599bf10579df08259aa Reviewed-on: http://codereview.qt-project.org/5657 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Re-enabled test that was marked insignificant and passesHolger Ihrig2011-09-261-1/+0
| | | | | | | | | | | Added comment why QVariant Autotest is marked insignificant Task-number: QTBUG-21424 Change-Id: I5b911bd36e376ad529342055180ff9c5de19de67 Reviewed-on: http://codereview.qt-project.org/5399 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Moving relevant tests to corelib/threadHolger Ihrig2011-09-0142-0/+7622
Task-number: QTBUG-21066 Change-Id: Ia16fa8961f1a73f4da6709197b5dd9929c16583f Reviewed-on: http://codereview.qt.nokia.com/3663 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>