Commit Graph

20 Commits

Author SHA1 Message Date
Jason McDonald
1fdfc2abfe Update copyright year in license headers.
Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-05 06:36:56 +01:00
Bradley T. Hughes
6f0f9f6928 Remove QMetaObject guards and deprecate QPointer.
QWeakPointer is superior and preferred.

Remove QMetaObject::addGuard(), QMetaObject::changeGuard(),
QMetaObject::removeGuard(), and QObjectPrivate::clearGuards().

Implement QPointer using QWeakPointer<T> instead. This changes the
behavior of QPointer in 2 ways:

- During destruction of a QWidget. Previously, the destructor of QWidget
would reset all QPointers so that they would return zero when destroying
children. Update tst_QPointer to account for this change.

- When constructing a QSharedPointer to take ownership of an object
after a QPointer is already tracking the object. Previously, the shared
pointer construction would not be affected by the QPointer, but now
that QPointer is implemented using QWeakPoiner, constructing the
QSharedPointer will cause an abort(). Fix tst_QSharedPointer by
removing the use of QPointer in the objectCast() test.

These behavior changes are documented in the QPointer class
documentation and in the changes file.

Change-Id: I92d0276219c076ece7bcb60f6e1b9120ce4f5747
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-10 16:11:48 +01:00
David Faure
c44a67e6f3 Port externaltests.cpp to QTemporaryDir
Change-Id: I6097ea92dd4b300cb562510e0ea27cee3c01b466
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-12-07 18:58:43 +01:00
Bradley T. Hughes
b6e9ff22a3 Fix tst_QSharedPointer invalidConstructs:forward-declaration failure
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>
2011-12-06 18:37:54 +01:00
Bradley T. Hughes
409b3b42a2 Remove cast and assignment operators from QAtomicInt and QAtomicPointer
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>
2011-12-02 13:21:32 +01:00
Rohan McGovern
3385fb91e1 Fixed installation of corelib tests
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>
2011-12-01 09:12:52 +01:00
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
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
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
238c304613 Remove obsolete MSVC workarounds from autotests.
Qt5 doesn't support MSVC versions before 2008, so workarounds for
earlier versions are no longer required.

Change-Id: I429feff99fe61d286637b960d92fd58962f8aefa
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-27 06:12:09 +02: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
27f9f136f7 Remove SkipMode parameter from QSKIP calls.
The previous commit removed SkipMode from the testlib APi.  This commit
removes the parameter from all calls to QSKIP.

Task-number: QTBUG-21851, QTBUG-21652
Change-Id: I21c0ee6731c1bc6ac6d962590d9b31d7459dfbc5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-21 01:20:29 +02:00
Jason McDonald
bf7d30bf1f Fail test in preference to calling qFatal.
Calling qFatal may result in test output not being well-formed.

Change-Id: Ia16bade4d3311485c6ba4dd23d5624d18b192b71
Reviewed-on: http://codereview.qt-project.org/6190
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
7cfad460c5 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: 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>
2011-10-05 03:04:31 +02:00
Thiago Macieira
5bfeab8749 Make all uses of QBasicAtomicInt and Pointer use load() and store()
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>
2011-10-03 07:57:41 +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
Lars Knoll
98baa289cc Fix the test case
If the MKSPEC we get is an absolute path, we should
pass that one on to qmake. Otherwise it'll try to
find the mkspec in the install location. This fails
as 'make check' is being run before installation.

Task-number: QTBUG-21402
Change-Id: Ie872546f2ee7c5d737e50a1779637e393538ccc2
Reviewed-on: http://codereview.qt-project.org/4999
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-09-17 07:36:26 +02:00
Jo Asplin
831a160e00 Disabled tests for refactor->master integration
This change disables failing tests to increase the
likelihood that 'make check' terminates with a zero
exit status. This is done to prevent the CI system
from blocking further commits once qtbase#refactor
is merged into qtbase#master.

Failing tests are marked as insignificant (by putting
'CONFIG += insignificant_test' in the .pro file).

Note: This is a temporary measure that needs to be cleaned up
once the refactor->master integration is complete.
Ideally all disabled tests need to be enabled and passing.
All changes will be marked by the string QTBUG-21402 in a comment
for easy location.

Task-number: QTBUG-21402
Change-Id: Ic4400671671f6d9b75b106a6aa4755b20e74378d
Reviewed-on: http://codereview.qt-project.org/4678
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2011-09-13 08:25:05 +02:00
Holger Ihrig
5c27f0a2fb Moving relevant tests to corelib/tools
Task-number: QTBUG-21066

Change-Id: I650f8f7826b9feea7c1484f06e03e10c68ec2b65
Reviewed-on: http://codereview.qt.nokia.com/3712
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2011-09-01 13:07:23 +02:00