Commit Graph

14 Commits

Author SHA1 Message Date
Jason McDonald
e08410ab8d Cleanup corelib autotests
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>
2011-11-25 07:56:16 +01:00
Jason McDonald
a8fd0c3654 Don't depend on moc to disable test functions.
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:
    924d810dbd
    8aaff67510
    338d3f1197
    a55034062b
    253497b744
    7cfad460c5
    9d2ff58f36
    0cf6baa2d6

Change-Id: I947d797fe3ec76139ba1b55561cea569895662c5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-18 01:51:57 +01:00
Rohan McGovern
70d91b5c46 Fixed compile of autotests with -qtnamespace.
Make sure to use the Qt namespace for qGlobalPostedEventsCount.

Change-Id: I558a0b0fba1e22a2edd96f9499a2bab82046c4a4
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2011-11-18 00:07:51 +01:00
Bradley T. Hughes
6fcfae99d3 Remove warnings from deprecated atomic operators in autotests
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>
2011-11-16 10:32:10 +01:00
Sven Anderson
2b7d98ef8f Allow to create a custom event dispatcher for specific QThreads.
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>
2011-11-15 10:16:12 +01:00
Jason McDonald
578e6d6834 Cleanup corelib autotests
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>
2011-11-14 07:33:57 +01:00
Jason McDonald
94fc875079 Cleanup corelib autotests
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>
2011-11-11 02:45:05 +01:00
Jason McDonald
e8f7fccf22 Cleanup corelib autotests
Remove redundant empty constructors, destructors and test functions.

Change-Id: Idb51368895e67ec3fc0345a9a5d33d77730c051b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-07 13:26:41 +01:00
Olivier Goffart
ec5e59b73c QThread::isFinished should return true from finished()
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>
2011-11-03 18:43:52 +01:00
Rohan McGovern
07102cebde corelib: eliminated usage of qttest_p4.prf
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>
2011-10-25 05:03:08 +02:00
Jason McDonald
8f02339e76 Remove DEPENDS_ON from qtestlib API.
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>
2011-10-19 07:24:13 +02:00
Jason McDonald
924d810dbd Avoid using QSKIP in lieu of compile-time checks
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>
2011-10-07 04:30:30 +02:00
Jason McDonald
95cebd34eb Remove Symbian-specific code from tests.
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>
2011-09-29 06:41:42 +02:00
Holger Ihrig
82e715b277 Moving relevant tests to corelib/thread
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>
2011-09-01 12:54:58 +02:00