Commit Graph

939 Commits

Author SHA1 Message Date
Rohan McGovern
1825c9aefc tst_qsslsocket: improve failure message
Cast enum to int so that we get the actual and expected values in the
failure message, rather than merely "Compared values are not the same".

Change-Id: Idc20e050c2e8a07d70f839c0a45044b070c0900e
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-21 04:55:02 +01:00
Jason McDonald
25ff7e41dd Remove obsolete code from QStateMachine test.
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>
2011-11-21 04:55:02 +01:00
Jason McDonald
e153d0da3d Remove obsolete code from QStateMachine test.
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>
2011-11-21 04:55:02 +01:00
Rohan McGovern
ea882ee11f tst_qsslsocket: don't run SSLv2 tests when SSLv2 has been disabled
SSLv2 may be disabled in openssl at compile time.
If so, do not attempt to test it.

Change-Id: I189c8fde5b5dc8e739d54cc1adde1d3e3e217391
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-21 03:29:01 +01:00
Jason McDonald
572ca43637 Improve diagnostics of QPluginLoader test.
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>
2011-11-18 08:58:56 +01:00
Jason McDonald
d1e2e2ffbe Fix indentation of QPluginLoader test.
Change-Id: I4c6957d2a67ac387232226098b4490e3d5a86d51
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-18 08:58:50 +01:00
Jason McDonald
105ca907fd Improve QPluginLoader autotest diagnostics.
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>
2011-11-18 08:58:45 +01:00
Jason McDonald
7a65dd3108 Remove disabled code from QLibrary autotest
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>
2011-11-18 08:58:34 +01:00
Jason McDonald
1ce050cd5d Remove disabled test data from QVariant test.
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>
2011-11-18 08:58:30 +01:00
Jason McDonald
4d73b7bbcd Remove obsolete code from QVariant test.
Change-Id: If609ddbef7002cb48f4459efd8f2c6edb02c8677
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-18 08:58:25 +01:00
Jason McDonald
30266d8015 Remove obsolete code from QTimer test.
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>
2011-11-18 08:58:18 +01:00
Jason McDonald
b28a690c8f Change confusing test function name.
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>
2011-11-18 08:58:13 +01:00
Jason McDonald
397fd4735a Fix typo in QUrl autotest.
Change-Id: Id85ad5c16e3a5b7a1614affa041d19f5062073fd
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-18 08:58:09 +01:00
Jason McDonald
1a6f2a3d3b Remove obsolete test data from QFile test.
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>
2011-11-18 07:27:53 +01:00
Jason McDonald
d125e84d6a Remove obsolete test data from QFileInfo test.
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>
2011-11-18 07:27:48 +01:00
Jason McDonald
97cd812d65 Remove obsolete comment from QDataStream test.
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>
2011-11-18 04:51:09 +01:00
Jason McDonald
40b5b34d0b Remove obsolete comment from QDataStream test.
The removed comment was introduced before the tests were imported into
the Qt repository in 2006 and seems to relate to code that no longer
exists.

Change-Id: Ic21e46fe0157adf5be9dc62de098517b7b27c310
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-18 04:51:09 +01:00
Jason McDonald
93d2519d99 Improve QBuffer autotest.
This commit fixes several issues found in the readLineBoundaries() test
function.

First, the test performed some test actions but did not perform any
verification steps to check that the outcome of those actions was
acceptable.

Second, the test didn't need to write the buffered data to a file to
verify line-by-line reading.

Third, the get/unget action was unrelated to the readLineBoundaries()
test and has been moved to a separate test function.  That test function
now tests that get/unget works at every position in a buffer, not just
at position 0.

Change-Id: Icad52ed598e94b6e05a194b9ab301d099bfc094c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-18 04:51:09 +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
Kent Hansen
44b6bb3560 Call invalidateResource() on QOpenGLMultiGroupSharedResource-owned resources
Commit 202127f860 ensured that
QOpenGLMultiGroupSharedResource-owned resources are deleted,
but it was missing a call to invalidateResource().

Change-Id: I166ce8a7298772408081331fe1a91bd2cd88aebb
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-11-17 17:40:06 +01:00
Richard Moore
bf7364f0aa Improve the testability of QSslOptions.
The handling of QSslOptions is complicated not only by the subject, but
also by the fact that some of the openssl directives are negatives. This
commit tries to separate the inherent complexity from the complexity of
the api by allowing us to test them independently.

Change-Id: Ieb9386c69dd9b0b49dc42e26b2878a301f26ded1
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-11-17 13:22:56 +01:00
Jason McDonald
6382d27abd Remove commented code from QBuffer autotest.
The removed code was commented-out before the tests were imported into
the Qt repository in June 2006.  This code is no longer valid as the
warning messages it relates to are not produced by any code in qtbase.

Change-Id: Iac63b27387b51a71c567386ca61faf5fb00c3364
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-17 07:21:11 +01:00
Jason McDonald
2b883dc9bb Improve Q_FUNC_INFO autotest.
The availableWithoutDebug() test was trying to force QT_NO_DEBUG to be
defined, but was actually doing the opposite.  While I'm not satisfied
with the way this test works (it would be better to test with
QT_NO_DEBUG already defined when Q_FUNC_INFO is included). at least this
test now does what it says it does.

Additionally, the test has been improved by checking that Q_FUNC_INFO
returns a non-empty string, as opposed to just compiling.

Change-Id: I9175e3a7406152b6250b507a61b5062e3cfabeb8
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-17 07:21:03 +01:00
Peter Hartmann
4dc390e66f SSL namespace: rename TlsV1 to TlsV1_0
This is a source-incompatible change.

TlsV1 is ambiguous; what is actually meant is TLS version 1.0. There are
also TLS versions 1.1 and 1.2; we might want to add options for these
once OpenSSL supports them (apparently they will be with OpenSSL version
1.0.1).

Change-Id: I940d020b181b5fa528788ef0c3c47e8ef873796a
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-11-16 10:32:10 +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
Jiang Jiang
3d063ecc5f Provide defaultFont with fontconfig db
So that it won't just return "Helvetica" that may not exist in
target system. Providing it seems to fix QTBUG-21833 as well,
thus we can remove the QEXPECT_FAIL statement in qlistview test.
'_' appears to reach the minimum right bearing in some fonts.

Task-number: QTBUG-21833
Change-Id: I2340af6ee736083ec4f6575e469840ebec4e545e
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2011-11-15 18:33:58 +01:00
Kent Hansen
202127f860 Ensure that QOpenGLMultiGroupSharedResources are cleaned up
When a GL context group is destroyed, all multi-group shared
resources associated with the group should be cleaned up.
Otherwise we could get a double deletion in the resource's
destructor, because it still retained a pointer to the
deleted group.

The missing cleanup resulted in a crash when the global
static qt_gl_functions_resource was destroyed, first seen
in the tst_examples autotest in qtdeclarative. It possibly
didn't manifest before because it's event loop-dependent
(the contexts are deleted via deleteLater()).

Change-Id: I6b1e0bfdfbbb2bff8e795f545e680fcdfa094768
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-11-15 17:09:35 +01:00
Olivier Goffart
9924a637cc moc: fix Q_INVOKABLE returning references
The moc generated code would not compile otherwise

Keep Moc::parseFunction and Moc::parseMaybeFunction in sync
(the first is used for signals and slots, and the second for normal
 functions such as Q_INVOKABLE)
Last patch that introduced function pointer updated parseFunction
but not parseMaybeFunction

When a slot return a reference, moc generate code that make the
MetaObject system think it is a void, so qt_metacall and invokeMethod
do not mess with the return value.
But when we want to take the function signature, in the IndexOfMethod
call, we need to have the exact return type.

Change-Id: I4661218d7ce367ad3934e73929e7d04f0a6dbc09
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-11-15 11:53:44 +01:00
Richard Moore
6f115edd74 Always use the hex format for certificate serial numbers.
In Qt 4.x the serial number is reported by a mixture of the hex value
and the number, The hex is what is used by other tools, and we should do
the same.

Change-Id: Ia0361d43fb5b920d053c95e932e0c8a012436e5e
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-11-15 10:16:12 +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
51b7d3c8b6 Remove obsolete QSKIP parameter.
Change-Id: I269337d802ec6b383a496fe8dc62a6b11e4d61c5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-15 08:51:43 +01:00
Bradley T. Hughes
62af6c3567 Compile on Mac OS X
privateqt_mac_p.h lives in QtWidgets/private/qt_mac_p.h now instead of
QtGui/private/...

Change-Id: I77e57de5581829e78919b13b10f7a896879670a7
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-15 07:22:48 +01:00
Jason McDonald
c1c51dd4f7 Avoid crash in QColumnView autotest.
When combined with http://codereview.qt-project.org/8644, the test
crashes.  This appears to be due to a column of the view being deleted
in response to calling setCurrentIndex(), as documented in QTBUG-22707.

This commit must be merged at the same time as
http://codereview.qt-project.org/8644.

Task-number: QTBUG-22707
Change-Id: I075be7df5d9196e37e2286e61d317086a76a167d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-15 04:31:55 +01:00
Mikko Knuutila
ddb512fb37 Fix for QMessageBox's autotest.
Mnemonic shortcut caused string comparison to fail.

Task-number: QTBUG-22119

Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
(cherry picked from commit 11a6d868b5613dd7fdbef02198aaf9566fcd1f17)
Change-Id: I11a6d868b5613dd7fdbef02198aaf9566fcd1f17
2011-11-14 23:42:17 +01:00
Bradley T. Hughes
a2ece6e626 Disable qmacstyle test on Mac OS X
The QMacStyle is not built as part of QtWidgets at the moment (see the
TODO in src/widgets/styles/styles.pri), so disable the test for now.

I've included a comment in styles.pri to re-enable the test once the
style is done.

Change-Id: Ia6ea130135586f107ba257bf2c6c2c7187a830b6
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-11-14 23:42:17 +01:00
Bradley T. Hughes
c5b528084e Autotests need to link to QtTestLib
Otherwise the symbols used by the test aren't found when linking.

Change-Id: Ibc78ac76763d0558824b797582e16f97786c5840
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-11-14 23:42:17 +01:00
Olivier Goffart
49bd825a96 moc: support mapping pointers to member functions to indexes
This change adds QMetaObject::IndexOfMethod as a parameter to
the qt_static_metacall function.
It lets the moc generated code return the index of a signal or slot
given its pointer to member function

This is required to support the new connection syntax

Change-Id: I39198c6699b5aa3599d3d282f7ac79b1e3684d33
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-14 15:52:26 +01:00
Richard Moore
e66d3d9899 Deprecate QSslCertificate::isValid() replace with isBlacklisted()
Currently isValid wrongly gives the impression it checks a certificate
for validity - it doesn't. It merely checks if the certificate dates
are valid and if the certificate is blacklisted. Since it's already
easy for users to check the dates, let's just give them access to the
ability to check for blacklisting.

Change-Id: I25be3bde6a01063034702a9574b28469bf4882cd
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-11-14 10:39:47 +01:00
Mikko Knuutila
2b8c3ff0f0 Added base 10 to be used with QIntValidator.
Fixes an error in QIntValidator, which occurred because
locale.toInt() was missing a parameter for base value and this
led it to presume wrongly that a base 8 is in use.

Task-number: QTBUG-21602

Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
(cherry picked from commit ee3f763f3642d1a098e6293fbc586b34a3e6e8be)
Change-Id: Iee3f763f3642d1a098e6293fbc586b34a3e6e8be
2011-11-14 10:34:41 +01:00
Markku Heikkila
d7695e82ac Fixed wrong QGroupBox check state
Handle mouserelease only if mouse is pressed in QGroupBox.

Task-number: QTBUG-19170

Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
(cherry picked from commit df819cfe17f6dfd089096063524932fc4975804f)
Change-Id: Idf819cfe17f6dfd089096063524932fc4975804f
2011-11-14 10:34:24 +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
3e0dece151 Remove commented code from qfuture test.
The removed code was already commented out when first added in November
2007 and is nowhere near compiling.  If there was anything of value
here, anyone who is able to find it is free to re-add a version that
actually works.

Change-Id: I4a7127a272254224f6a1e65fbd2a01000a4d2be9
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-14 05:15:04 +01:00
Jo Asplin
9563367af2 Re-enabled tst_qpluginloader
This test is passing in CI.

Task-number: QTBUG-21402
Change-Id: I356476e458cac1cd434959fdf801011a607c9233
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2011-11-11 18:28:49 +01:00
Olivier Goffart
fd9ebabe14 Fix warning in tst_qobject
signal4 is not used in that function

Change-Id: I69f39a4639bfae067c411fd1166fc36ca3febbc5
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-11-11 16:47:23 +01:00
Stephen Kelly
999196e336 Add API to clear the current index. Symmetric with clearing selection.
Change-Id: I08070f4fdf26898d5b6edd5259f011f9b3c75512
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-11-11 12:24:48 +01:00
Stephen Kelly
0b293e4afc Make this API virtual to make selection proxying possible.
Change-Id: Ie93c8b38c59d347026a68eae03687d9017b3d048
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-11-11 12:24:48 +01:00
Oliver Wolff
12ebdd9f9e QByteArray autotest: Check for defines inside of slot
Instead of creating slots depending on certain defines,
these defines should be checked inside the slots.
Moc may not be aware of all defines (e.g. compiler
specific ones) and thus (not) create slots according
to the condition given.

Change-Id: I50495444b8f468ec131e6a0937e18803a8077758
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2011-11-11 10:58:10 +01:00
Jo Asplin
51ae37d8c4 Added QTBUG-22296 to QEXPECT_FAILs
Change-Id: I6c619cea64a14d957077813256c7d4f7ff6a4220
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2011-11-11 10:58:10 +01:00
Tero Ahola
1505508742 Repaint QProgressBar when minimum or maximum changed
The implementation of QProgressBar::setMinimum and setMaximum did not
repaint the widget. This caused the widget to be shown incorrectly in
case you call setMinimum or setMaximum but not setValue.

Task-number: QTBUG-22121
(cherry picked from commit b1998f4f59c3b10700963b2d13a17a0cc77ef665)

Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>

Change-Id: I331d37ab4451d9e096cdf91a9e0a0286bc3cdffb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-11-11 10:58:10 +01:00
Thomas Hartmann
ebfe3a4217 Adding test for custom bezier easing curves
I added unit tests _fast_cbrt() taken from qeasingcurve.cpp

Change-Id: Id3afd26efac92f594d6358dc2e11f94e8c524da2
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2011-11-11 09:16:47 +01:00
Jason McDonald
64c8691548 Cleanup corelib autotests
Use QVERIFY2 to provide better test diagnostics.

Change-Id: I128004f4ee133ceed4d8f373bbbe4a0eee431ebf
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-11 04:28:14 +01:00
Jason McDonald
a28817fd78 Use qWarning() to output warnings.
Change-Id: I366f70f27de0329749e5dcbdcbec8d56bffb4255
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-11 04:28:03 +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
Olivier Goffart
96611a677f Fix parsing of #if defined expression
We only need to match the closing parentheses if there was an opening one

This has caused mis-parsing of tst_qbytearray.cpp

Change-Id: I9d52916e3ed8549c5ddd968092451fef7389a952
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-11-11 02:45:05 +01:00
Aaron Kennedy
bcd16f9453 Update V8
Change-Id: Ic239ef1e55bed06260e4a04cc2199f64c2d30059
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2011-11-10 13:22:13 +01:00
Pekka Vuorela
dc2a1aff9b QWidget text editors to commit text on their own on losing focus
Change-Id: I3b907661e8a24a6dbdaabf607c5c528b1b471c98
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-11-10 13:07:38 +01:00
Pekka Vuorela
1dbfbf4c66 Implement partial tentativeCommit support in QTextEdit
Available on plain text for now, html support still pending.

Change-Id: I0818b97874e80c8c1b33a9127aa7bb3330a8761d
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-11-10 13:07:20 +01:00
Jo Asplin
582bb9e467 Re-enabled passing tests in tst_qabstractprintdialog
To increase the effective test coverage, this patch
re-enables the tst_qabstractprintdialog test case as such, and
instead disables only the test functions that are currently
failing in CI.

Task-number: QTBUG-22453
Change-Id: Ic09a03ed405bf6f85917410a7a86e17f2fe22cba
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-10 09:32:30 +01:00
Jo Asplin
ef9b2b6aef Re-enabled passing tests in tst_exceptionsafety_objects
To increase the effective test coverage, this patch
re-enables the tst_exceptionsafety_objects test case as such, and
instead disables only the test functions that are currently
failing in CI.

Task-number: QTBUG-22453
Change-Id: If1fbf59c9d941453b9fd7feb43c59e27e087ce50
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-10 09:32:17 +01:00
Jason McDonald
8e11f7c93a Cleanup corelib autotests
Remove literal tabs.

Change-Id: I210a0259773cceb20d35ebc80b889e3ebb88b540
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-10 04:42:45 +01:00
Jason McDonald
2cd4710715 Remove redundant #define
Change-Id: I27a47653d2c41741f39ee1fea6a1fed063279994
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-10 04:42:23 +01:00
Jo Asplin
df9405b8d3 Removed obsolete host.pro from qtbase
Note that the uiloader test has been moved
from qtbase to qttools (see QTBUG-19453).

Change-Id: I326fa0da435701eeaad7026160e3203a27cb3666
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-09 14:05:19 +01:00
Jo Asplin
540e368e04 Deleted qtipc autotest from qtbase
The qtipc autotest needs to live in qtscript due to dependencies
to that module. This commit is the first of two steps to move qtipc.
The second step is a commit in qtscript that adds qtipc there
(with a proper reference to the first commit, i.e. this one).

Change-Id: I233ee459be76fd1938868c05232ce732cfc913a8
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-09 14:05:19 +01:00
Jo Asplin
f7d5d07ace Re-enabled passing tests in tst_qopengl
To increase the effective test coverage, this patch
re-enables the tst_qopengl test case as such, and
instead disables only the test functions that are currently
failing in CI.

Task-number: QTBUG-22453
Change-Id: Ifa9ccab81efb1577767465c150fc64a9d9e3f8e0
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2011-11-09 14:05:19 +01:00
Jędrzej Nowacki
5bd377274e Add QPolygonF to metatype system.
That was strange that QPolygon was know to QMetaType class but QPolygonF
not.

Change-Id: I67bb99644b8b1d0fe1aec730619d8048cb78219b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-11-09 10:12:18 +01:00
Jędrzej Nowacki
8fd64d22ac Make usage of internal QVariant space.
Each QVariant instance has internal storage which may be
used for well-know basic types. This patch changes the
behavior by delegating type dependent operation to QMetaType
class which knows more types than QVariant itself.

The patch significantly reduce amount of code in QVariant
implementation.

There are few side effects of this patch:
- better performance:
* for Core types when using Gui (QGuiVariant is able to
construct Core types)
* for small custom types (QVariant::Private::Data is used for all
types that has size small enough)
- comparing two QVariants can give different result for small custom
types (binary comparison instead of pointer comparison)

Change-Id: Ic17fa500d6a882110bfba896fd456c8e6c7a63a9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-11-09 10:11:34 +01:00
Jędrzej Nowacki
7f35d5849e Refactor QMetaType types.
QMetaType::Type enum is the main source of type ids. Currently
there are many tasks that can be replaced by a smart macro that
can iterate over all types. The patch introduces series of FOR_EACH_
macros that may be used for code generation.

As the first step the macro was used for Q_DECLARE_BUILTIN_METATYPE
to make sure that no type was forgotten.

Second step was to use created macros in autotest to improve tests
coverage.

Change-Id: I34e9ad7bacf02b44b028bc1aad20b1241aacebd3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-11-09 10:11:02 +01:00
Jason McDonald
9de6257657 Remove redundant copies of QTRY_COMPARE.
QTRY_COMPARE is now part of qtestlib, so there's no need for copies of
it.

Change-Id: Ied4e7d3b30c1cf16ddcbf8655e4d976e74c2bd8a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-09 01:09:27 +01:00
Aurindam Jana
124044613d QGlobal: Define a default message handler
Currently, qInstallMsgHandler() does not return the
handle to the default message handler. This patch defines
a default message handler. This is returned by
qInstallMsgHandler() when called for the first time. A call
to qInstallMsgHandler(0) will restore the default message
handler as was the case previously.

Change-Id: I42f06654d45fb0e633f3c6d912fc8f05c23249aa
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-08 17:20:39 +01:00
Olivier Goffart
a4f446704e QNAM: Fix authentication cache when the password is in the URL
Two problems:
 - The signal cacheCredidentials was not connected in the synchronous
   case while it must be connected. (Regression when the threaded http
   was merged)
 - We cannot cache the credidentials when we proceed the url because
   at that point, we do not know the realm (this basically reverts
   9bc5a32b875b812c3a706034c8c27614f86bd138)

Task-number: QTBUG-18411

Change-Id: I8ea11fa23db4314c3f17ed06d2d7f9ee934ccdba
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-11-08 17:20:39 +01:00
David Faure
5e26608ae2 Add Q_DECLARE_PRIVATE equivalent for QDir, to be able to subclass it
Apply the same solution to QFileInfo (no public detach(), but a
non-inline d_func instead).

Change-Id: I31c4c759f44a0649b97f7884b078b174c9c00f22
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-08 12:09:06 +01:00
Jo Asplin
97ea2f0f6e Completed change to eliminate v8.pro
The initial change to eliminate v8.pro was
incomplete - see 803b7d651c.

Change-Id: Ia2c996d247f8b19380363f3e0409d38d3b839fdb
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-08 09:23:27 +01:00
Jo Asplin
b481e0d885 Moved utf8/ and deleted corelib.pro
This change moves utf8/ into corelib, thus
allowing corelib.pro to be deleted.

Change-Id: Ib1b4e0930ac0e116d9bbc242a6dfb63ae5785d19
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-08 09:22:50 +01:00
Jo Asplin
dad925a1ce Re-enabled tst_qdialog
Commit 0fd8514a57 ensured that
the showAsTool test function is now properly QSKIP'ed for
platforms where it is always known to fail.

This change re-enables the test case as a whole so that
the passing test function may actually catch real Qt bugs again
(without being ignored by CI).

Task-number: QTBUG-22453
Change-Id: Icfe56558f8c0f4b50dbbc21d9748df6d81fea4fe
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-08 09:22:00 +01:00
Jo Asplin
6ce2cf3456 Deleted QWS tests
QWS is not supported for Qt 5, so the QWS tests are deleted.

Change-Id: I08837fbd879915bbca9f821fad3551450eb3a1c6
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-08 09:21:43 +01:00
Charles Yin
78542c6275 QPainterPath: Fix copy constructor again.
The previous fix a05270f435 is not correct,
QPainterPathPrivate(other) should be QPainterPathPrivate(), as there
is only a default ctor for QPainterPathPrivate and ref is initialized there,
 use copy ctor just copies the ref value which makes all detach() calls broken.

Add an unit test for this as well.

Change-Id: I658f0a977664d5ec523af3f8a48c1a866eda6ab0
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2011-11-08 07:43:00 +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
Jo Asplin
9ceb3b4f6f Moved qobjectperformance into other/
The qobjectperformance test is a kind
of performance test that asserts that the
time it takes to emit a signal to a certain
number of receivers does not exceed a certain
time.

other/ currently seems to be a sensible place for
such a test. Alternatively, it could have been put
next to corelib/kernel/qobject/.

Change-Id: I5c9461b62984f5806d1f6940123d30ef9f9f5a37
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-07 13:26:41 +01:00
Jo Asplin
803b7d651c Refer to v8 directly as a subdirectory.
v8 may be specified directly as a subdirectory in
tests/auto/auto.pro instead of indirecly referring to v8.pro.

Change-Id: I95d8c788fa67958372795519036cd8aec835b324
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-07 13:26:41 +01:00
Jo Asplin
e0dfa4547e Re-enabled passing tests in tst_qmenu
To increase the effective test coverage, this patch
re-enables the tst_qmenu test case as such, and
instead disables only the test functions that are currently
failing in CI.

Task-number: QTBUG-22453
Change-Id: I62cc1a2a9b0206595808deafb5fc137888ec97b3
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-07 13:26:41 +01:00
Jo Asplin
50890c0da8 Re-enabled passing tests in tst_qinputcontext
To increase the effective test coverage, this patch
re-enables the tst_qinputcontext test case as such, and
instead disables only the test functions that are currently
failing in CI.

Task-number: QTBUG-22453
Change-Id: Ib1d4946ab29e67e0e72f4f9c6a7bf39b65d0f6be
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-07 09:28:33 +01:00
Jo Asplin
7ba57e2630 Re-enabled passing tests in tst_qprinter
To increase the effective test coverage, this patch
re-enables the tst_qprinter test case as such, and
instead disables only the test functions that are currently
failing in CI.

Task-number: QTBUG-22453
Change-Id: I74cc30dc26b8b83852b3516f8def995eab19cf0f
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-07 09:27:07 +01:00
Richard Moore
9602887db1 SSL certificate extensions: add unit tests
Added tests for each of the supported extensions, and also for the
handling of unknown ones.

Change-Id: I29e0a5c1a411f41c2a554293662a33b56f205c00
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-06 21:01:03 +01:00
Pekka Vuorela
8bd40fef07 Support tentative commit string with input method.
Tentative commit string allows input method to notify editor
what is expected to be committed in the place of preedit.
This commit adds such support in QLineEdit.

Change-Id: If855619bc6843652db0d6254f7e7063bb8ad0936
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-11-05 23:47:02 +01:00
Jo Asplin
15d25dc676 Moved qmetaobjectbuilder test into corelib/kernel/
This commit moves the qmetaobjectbuilder test from test/auto/
into corelib/kernel/ since that matches the location in the Qt source.

Change-Id: I0342e8185ce775b0ef71849f365bf54c8fb56da4
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-05 02:31:14 +01:00
Jason McDonald
59309fa404 Remove unused PlatformQuirks functions.
These functions are no longer used anywhere in qtbase and are highly
unlikely to be used elsewhere.

Change-Id: I8e7c433c3b3e799ce0e5bc465182a5046275eb00
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-05 02:31:07 +01:00
Jo Asplin
79c99466aa Moved qobjectrace into integrationtests/
The qobjectrace test seems to belong to
integrationtests/ since it tests the interaction
between QObject and QThread (much in the same way
integrationtests/qsharedpointer_and_qwidget/ tests the
interaction between QSharedPointer and QWidget).

Change-Id: I89f1dab7300c2ef23755d52a86479677ef021ef1
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-05 02:30:58 +01:00
Jo Asplin
087fcc6182 Moved tests into gui/kernel/ and gui/qopengl/
This commit moves tests from test/auto/ into more appropriate
locations (i.e. matching the locations in the Qt source):

- qscreen and qwindow are moved into gui/kernel/
- qopengl is moved into gui/qopengl/

Note: qscreen is disabled for now since it is broken
on Linux (see QTBUG-22554).

Change-Id: Idcc7a51e78d6d0955bddb9cb4091866659193cc8
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-11-04 20:48:19 +01:00
Laszlo Agocs
0008428f90 Prevent timestamps in widgets' touch events from disappearing
Change-Id: I096914eb2b02ad9c4a5c0462a1f4b76ef17c3957
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-11-04 20:48:19 +01:00
Jo Asplin
52df233a33 Added ref to bug report in qglthreads.pro
Change-Id: Iecbda846eada49634b473959c642b8ee4c46c5c1
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2011-11-04 19:24:05 +01:00
Jo Asplin
b68bae1132 Added -datatags option to QTestLib
(Note: This feature is ported from Qt 4.8.
 See the following commits:
  01575deafb7d26ca2431374e92c6d71de96547c7
  4866d1ba8afbab61e102942d1ea93b81fea053d6
)

Passing the -datatags option to a QTestLib program prints the
available data tags to standard output.

For completeness, the test case name is also printed
at the start of each output line. (Although the file name
is supposed to match the lower-case version of the test case
name, this is currently not true in all cases (particularly not
under tests/benchmarks/). Even if there was a script to enforce this
convention, the -datatags option provides this information in a
reliable way.)

Data tags for each test function (f() in this case) are printed in
four different ways depending on the presence of local and global
data tags:

Case 1: No tags:
    tst_MyTestCasetst_MyTestCase f

Case 2: Local tags only:
    tst_MyTestCase f local tag 1
    tst_MyTestCase f local tag 2
    ...

Case 3: Global tags only:
    tst_MyTestCase f __global__ global tag 1
    tst_MyTestCase f __global__ global tag 2
    ...

Case 4: Local and global tags:
    tst_MyTestCase f local tag 1 __global__ global tag 1
    tst_MyTestCase f local tag 2 __global__ global tag 1
    ...
    tst_MyTestCase f local tag 1 __global__ global tag 2
    tst_MyTestCase f local tag 2 __global__ global tag 2
    ...
    ...

Note that the string __global__ is assumed to be highly unlikely to occur
in a data tag (if it does, an ambiguity results).

Change-Id: Ib51aa0c3c32ad52e52ce519729292cf8f0ec5d50
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2011-11-04 19:23:33 +01:00
Jo Asplin
e142a64a33 Re-enabled passing tests in tst_qvariant
To increase the effective test coverage, this patch
re-enables the tst_qvariant test case as such, and
instead disables only the test functions that are currently
failing in CI.

Task-number: QTBUG-22453
Change-Id: Ibf0dc3caf50d34084fa50cf76d199e77a42f6e16
Reviewed-by: Olivier Goffart <ogoffart@kde.org>
2011-11-04 14:35:54 +01:00
Sergio Ahumada
780a03191f test: Use QWidget::grab() instead of QPixmap::grabWidget()
Removing warnings from the test function as QPixmap::grabWidget()
is being deprecated.

Change-Id: I26ad1e9def0bebe8e4ee997068ba593245d0cd05
Reviewed-by: Jo Asplin <jo.asplin@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-11-04 12:37:27 +01:00
David Faure
272d20ce27 QStandardPaths: add DownloadLocation.
Only properly implemented on unix (XDG), falls back to Document location
on Mac and Windows, because not easily available with the current API
being used by either one.

Change-Id: Id269f0e3c4e3a68e19205de96c0b39980fde80ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-04 10:54:54 +01:00
David Faure
ae6e7e3d59 Fix tst_qstandardpaths: Mac OSX is a unix, but doesn't use XDG.
Change-Id: I2b4552a162dc9f993e0587ace6e7e3fb4f96571e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-04 10:53:41 +01:00
Sergio Ahumada
141dbaf496 Re-enabled passing test in tst_qdbuspendingcall
tst_QDBusPendingCall::watcher_waitForFinished_threaded()
autotest was fixed by faa6113c41

Task-number: QTBUG-20859
Change-Id: I05aaebfde45862836b10700aa7d9c64e4287466f
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-11-04 08:36:13 +01:00
Jason McDonald
9dc4907074 Don't rely on PlatformQuirks in qimagereader test
The PlatformQuirks header is, by its author's own admission, based on
"very bad assumptions", those being that only Meego has quirks.

The assumption that only Meego has versions of libjpeg and libpng with
rounding errors is not a good assumption.  Change the test to be a
little tolerant of rounding error regardless of the platform, at least
until there's a reliable way to tell which libjpeg/libpng versions have
rounding errors.

Change-Id: Id2be5cc54739249b615bf3307ee1850c0a5c06b3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-04 07:11:07 +01:00
Jiang Jiang
c30ebdeac0 Do not put cursor at non-stop character positions
When moving cursors, non-stop positions are skipped, however certain
input sequences can still lead us there. In such cases we should
simply ignore those positions in cursorToX.

Task-number: QTBUG-7076
Change-Id: Ia0a25931f4043359f72a6c0c14a74b905e40b93e
Reviewed-by: Eskil
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2011-11-04 01:54:33 +01:00
Jo Asplin
24971fbef0 Re-enabled passing tests in tst_qlistview
To increase the effective test coverage, this patch
re-enables the tst_qlistview test case as such, and
instead disables only the test functions that are currently
failing in CI.

Task-number: QTBUG-22453
Change-Id: I029be60c16cdff5ee3e38889d2780f1ee7d01b51
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-04 01:53:55 +01:00