Commit Graph

27 Commits

Author SHA1 Message Date
Steven Ceuppens
fca432c1c0 Add QDataStream operators to QMargins, so it can be streamed
* QDataStream format documented
 * Added Unit test for QDataStream operators

 * Updated Unit test

Change-Id: Idbcfcb0b927e6369e8d31b57693c7aa0d1a154e7
Reviewed-by: Olivier Goffart <ogoffart@kde.org>
2011-10-27 13:32:01 +02: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
Sergio Ahumada
c3313fdd1c Doc: Fixing typo
Fix typos I was able to find in `tests/auto' directory.

Change-Id: Id0bfcc18301381ac8b1ca8d5af17bd926e5913d4
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2011-10-26 13:50:12 +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
Sergio Ahumada
ccf27301e0 test: Split `qcontiguouscache' unit and benchmark tests
Moving three benchmark tests from 'tests/auto' to 'tests/benchmarks'.
Also removing 'qttest_p4' usage while we are at it.

- void asScrollingList();
- void cacheBenchmark();
- void contiguousCacheBenchmark();

were moved to 'tests/benchmarks/corelib/tools/qcontiguouscache'

Task-number: QTQAINFRA-353
Change-Id: Icbdd852f9c14c3df042d2e19abd42af6c645a3cb
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-24 11:04:04 +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
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
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
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
13251dcaea Remove obsolete test functions.
Commit 2cbeb6c08cb7c79d6126f75c2cbc470679d671e1 made these test
functions obsolete.

Change-Id: I89a379d7228584a83e9d7674060081f4201f561c
Reviewed-on: http://codereview.qt-project.org/6113
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
Konstantin Ritt
2bf2bb3daf fix QChar::isSpace() to handle codepoint U+0085
according to the Unicode specs, code point U+0085 should be treated
like a white space character (an exceptional Cc one)

Change-Id: Ib17ae0c4d3cdafe667cafa38b645138ef24c238c
Merge-request: 32
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Reviewed-on: http://codereview.qt-project.org/6158
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
2011-10-06 19:24:26 +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
Bradley T. Hughes
992a37234c Don't crash by modifying read-only shared_null
Functions that modify the d-pointer must detach or otherwise take
measures to not modify the const, read-only shared_null.

The setSharable(bool) function takes care to detach when setting
sharable to false, but should avoid setting the sharable data member
unless d is not the shared null.

Similarly, QMap<Key, T>::setInsertInOrder() needs to detach if it is
shared with the shared_null (the logic has been updated to be the same
as setSharable()).

Change-Id: Ida5cb9818b86695f1b9f0264418b955c56424898
Reviewed-on: http://codereview.qt-project.org/5929
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2011-10-04 11:21:25 +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
Friedemann Kleint
f18b690cca Tests: Fix compilation on Windows.
Replace Q_WS_... by Q_OS_... in corelib tests.

Change-Id: I14c41dca1ec490b3c49ba2c24e60def14c6de9da
Reviewed-on: http://codereview.qt-project.org/5778
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-03 07:57:41 +02:00
David Faure
b863df7de9 Rename Qt::escape to QString::toHtmlEscaped, add compat method
Merge-request: 56
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>

Change-Id: I46bbb2df10968e88b5eb5ef8dae182a651b622b8
Reviewed-on: http://codereview.qt-project.org/5793
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2011-09-29 15:22:07 +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
Bradley T. Hughes
a219b8f382 Fix QString and QByteArray reserve() and squeeze()
These functions should not take care not to unconditionally set the
capacityReserved private member, since the d may be referencing the
const shared_null or shared_empty which live in read-only memory.

The squeeze() methods check for ref > 1 instead of ref != 1 to prevent
detaching from the shared_null/shared_empty unnecessarily; the
shared_null/shared_empty ref count is -1, meaning squeeze() will never
detach from it.

Change-Id: Id3f1725a6f08b3a462343640a47bbe78f08ca7e7
Rubberstamped-by: Lars Knoll
Reviewed-on: http://codereview.qt-project.org/5454
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-09-23 13:42:22 +02:00
Kent Hansen
b8d656d878 Fix autotest gui/widgets dependencies
This is in preparation of removing testlib's
dependency on QtGui and QtWidgets.

Autotests that need QtWidgets api must
explicitly include it (since the types are no
longer provided by the QtGui master header).

Autotests that don't need QtGui or QtWidgets
api shouldn't link against those libraries.

Change-Id: I2808289068514fcac582808828ad4634e2631733
Reviewed-on: http://codereview.qt-project.org/5093
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-09-19 10:24:25 +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
Kent Hansen
8e67ef4794 Boost performance of QChar::isSpace
Make it inline; add fast checks for typical spaces;
add fallback function that uses the fastcall calling
convention.

On ia32, this change makes isSpace ~340x faster for
ascii spaces, ~170x faster for non-space ascii
characters, and ~1.3x faster for non-ascii characters.

Note that this change is NOT binary compatible.

Also add an autotest with expected results from
before the optimization, to ensure that the behavior
is the same.

Change-Id: I9438d0ad3c9ba2e80560c4bee7eed05115265798
Reviewed-on: http://codereview.qt-project.org/4905
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-09-15 20:39:28 +02:00
Kent Hansen
08d1ca1053 Boost performance of QChar::isLetterOrNumber
Make it inline; add fast checks for ascii letters
and digits; add fallback function that uses the
fastcall calling convention.

On ia32, this change makes isLetterOrNumber ~120x
faster for ascii letters and digits, ~150x faster
for non-letter/digit ascii characters, and ~1.3x
faster for non-ascii characters.

Note that this change is NOT binary compatible.

Also add an autotest with expected results from
before the optimization, to ensure that the
behavior is the same.

Change-Id: Ia4e13692f4dd79f6aa0b96da29449e0487971b0e
Reviewed-on: http://codereview.qt-project.org/4904
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-09-15 20:39:28 +02:00
Kent Hansen
a48e9af146 Boost performance of QChar::isLetter
Make it inline; add fast checks for ascii letters;
add fallback function that uses the fastcall calling
convention.

On ia32, this change makes isLetter ~370x faster for
ascii letters, ~250x faster for non-letter ascii
characters, and ~1.5x faster for non-ascii characters.

Note that this change is NOT binary compatible.

Also add an autotest with expected results from
before the optimization, to ensure that the
behavior is the same.

Change-Id: I06f8d3d43114537cee5567e670898cef6494c20a
Reviewed-on: http://codereview.qt-project.org/4903
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-09-15 20:39:28 +02:00
Kent Hansen
5639423ea7 Boost performance of QChar::isDigit
Make it inline; add fast checks for ascii digits;
add fallback function that uses the fastcall calling
convention.

On ia32, this change makes isDigit ~370x faster for
ascii digit characters, ~250x faster for non-digit
ascii characters, and ~1.5x faster for non-ascii
characters.

Note that this change is NOT binary compatible.

Also add an autotest with expected results from
before the optimization, to ensure that the
behavior is the same.

Change-Id: I718fadecda3f591d6f4c22374d8e476f4724fd83
Reviewed-on: http://codereview.qt-project.org/4902
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-09-15 20:39:28 +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
Samuel Rødal
a6b6e760ac Merge remote branch 'gerrit/master' into HEAD
Conflicts:
	configure.exe
	src/corelib/global/qglobal.h
	src/gui/kernel/qplatformnativeinterface_qpa.h
	src/gui/widgets/qlinecontrol.cpp
	src/gui/widgets/qmenu_mac.mm
	src/gui/widgets/qmenu_p.h
	src/gui/widgets/qmenubar.cpp
	src/gui/widgets/qmenubar_p.h
	src/gui/widgets/widgets.pri
	src/plugins/platforms/wayland/qwaylandnativeinterface.cpp
	src/plugins/platforms/wayland/qwaylandnativeinterface.h
	src/src.pro
	tests/auto/qdir/tst_qdir.cpp
	tests/auto/qfileinfo/tst_qfileinfo.cpp
	tests/auto/qsslsocket/tst_qsslsocket.cpp
	tests/auto/qstring/tst_qstring.cpp

Change-Id: I64cf2cefa532ba87a92f632e3595ce6914183e9b
2011-09-06 10:55:40 +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