Commit Graph

3469 Commits

Author SHA1 Message Date
Jason McDonald
14e139f391 Prevent qDebug test bypassing the testlib message handler.
Several of the test functions in the QDebug autotest call
qInstallMsgHandler() to temporarily use a custom message handler.
Unfortunately, these test functions were then resetting the message
handler back to Qt's default handler at the end of the test.

QTestLib also calls qInstallMsgHandler() to set a message handler that
redirects debug/warning/fatal messages into the test log.  When the test
resets the message handler back to Qt's default handler, testlib's
message handler is bypassed for the rest of the test, preventing any
subsequent debug/warning/fatal messages from being visible in the test
log or subject to testlib's ignoreMessage() function.

This error also caused several of the test functions to fail if they
were run manually.  The "defaultMessagehandler" test would fail if it
was run before any other test function and the "assignment" test would
fail if it was run after any other test function.

This commit fixes these failures by using a helper class to ensure that
the previously active message handler is restored at the end of each
test function, even if the test function fails or throws an exception.

Change-Id: I51376724d164c8ad126e5b9be76890bf3e6a9fb0
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-30 04:14:53 +01:00
Jason McDonald
d8f1749a74 Use QVERIFY2 to output verbose failure messages.
Change-Id: I2ce96d9d9f582e99c1d9f6dd6e6e80ce42d6e61d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-30 02:07:50 +01:00
Jason McDonald
fb83806138 Correct misspelt function names in QFutureWatcher test.
Change-Id: I60965f3475f83a7c42d2efc6ed8adf9a1403e144
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-30 02:07:50 +01:00
Jason McDonald
0372d5bf0d Correct misspelt function name in qtconcurrentmap test.
Change-Id: I79b54b4e0de6319add89d220d3c3306556ab4ccc
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-30 02:07:50 +01:00
Jason McDonald
8b66c46c18 Correct misspelt function name in qtconcurrentfilter test.
Change-Id: Ie7ea2defac407d099d7bb27cccfb34911b832626
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-30 02:07:50 +01:00
Robin Burchell
18d2528b6c Change test to use new QTRY_COMPARE/QTRY_VERIFY macros.
When verifying nonzero results (i.e. that something expected *did* happen),
using these macros allows bailing out of the timer much earlier than the
potential 5 seconds.

My running this on Linux goes from ~147 seconds to ~91 seconds.

Change-Id: Ie1e41252eb4eb295b5c8e795ded02f00eb7f9387
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-30 00:18:24 +01:00
Jonas M. Gastal
231369eb04 Make qDecodeDataUrl return bool.
Change-Id: I23b9fed39af7bea6c171b35e10bd72c424bd903e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-29 16:20:45 +01:00
Jason McDonald
4c1469f7da Improve QTextCodec::codecForLocale() test.
Don't call QSKIP when omitting the optional part of the test, as doing
so hides the fact that the rest of the test passed.

Change-Id: I9c102e8daeaf9586b2e510c4c9ce697ead290795
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-29 13:27:17 +01:00
Sergio Ahumada
78c27380c6 Fix printerPaperSize and some tst_qprinter test failures
Removing QEXPECT_FAIL accordingly.

Task-number: QTBUG-22296
Task-number: QTBUG-22562
Change-Id: I128a78897722cc067168ee50dbcbfc7537abdfcd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-29 13:18:20 +01:00
Stephen Kelly
fb9b5d65d8 Enable variadic macros if building in c++0x mode.
Change-Id: I40d1f1f64ad31a299ccad9258f70e9bf3255c3cd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-29 03:20:53 +01:00
Jason McDonald
b4557829f4 Don't allow QThreadPool test to hang on failure.
Use QTRY_VERIFY() to fail after a reasonable timeout rather than putting
the test into an infinite loop.

Change-Id: Ie0917556e15999a94cc0587f3f4c11c0d743a228
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-29 01:39:04 +01:00
Jonas M. Gastal
7dffcf8a74 Clarifying the flow of signals on QNetworkAccessManager.
Task-number: QTBUG-22858

Change-Id: I07eaecebf17e73f9c3148465d8970ca7672a900c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-28 16:12:56 +01:00
Jason McDonald
b2f2258719 Avoid repeatedly registering the same meta-type
Register the meta-type in initTestCase(), which is run once, rather than
in init(), which is run before every test function is run.

Change-Id: Ic62a2469da6a2a85254ffc7c4d893395202c50d8
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 08:16:47 +01:00
Jason McDonald
36eb666391 Improve qtconcurrentthreadengine autotest.
The threadCount() test function is unstable and had been disabled by
making it not be a slot.  It is better to disable it with QSKIP so that
the test output shows that the test function exists and is in need of
repair.

Change-Id: Iccdc8da31e0d15d922f7e9606835d1ff1a3a4966
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 06:34:15 +01:00
Jason McDonald
79b64957b0 Cleanup itemmodel autotests.
Avoid using bug tracker identifiers in test function names.  These
identifiers lose their meaning when the bug tracker is replaced.

Change-Id: Ia867f7c2ec2ab9ed546588843d532ac615a34031
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 06:34:02 +01:00
Jason McDonald
4ae3fea163 Remove old debug code from itemmodel tests.
Change-Id: I7c6aeed2d3b593a4dac89e54ef22743d5f736d42
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 06:33:50 +01:00
Jason McDonald
6b6406d659 Reinstate commented test data in QItemSelectionModel test.
The restored test data was marked as failing, but appears to pass, and
the available history does not explain why it was commented out.

Change-Id: I7e9e3ba72fc8fef42c91ee882efa98d25b3d8317
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 06:33:42 +01:00
Jason McDonald
613d0e407e Cleanup itemmodel autotests.
Bring the code closer to compliance with Qt's coding style guidelines
and eliminate excessive vertical whitespace.

Change-Id: Iaa29f8edf326ddb80cbadb6c18cca4fea88fd9b2
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 06:33:32 +01:00
Jason McDonald
9f843918f2 Remove empty functions from itemmodels tests.
Change-Id: I23775a334812b096192c7f44c4a3cb06f4b08705
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 04:50:35 +01:00
Jason McDonald
ea415e2060 Cleanup corelib autotests.
When using QSignalSpy, always verify that the signal spy is valid.  This
will cause the test to give a meaningful failure when spying on a
non-existant signal.  Without this change, tests that spy on a signal to
ensure that it is not emitted (i.e. by comparing the spy count to zero)
could pass erroneously if something went wrong when creating the signal
spy, as an invalid QSignalSpy will always return a count of zero.

Change-Id: I41f4a63d9f0de9190a86de237662dc96be802446
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 04:48:11 +01:00
Jason McDonald
1e7296f3f2 Remove mention of Trolltech in qlibrary autotest.
Task-number: QTBUG-19653

Change-Id: I8cf21bac41b08187528ba7004a7a23b9baa64b17
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 04:48:06 +01:00
Jason McDonald
9e0479496e Remove mention of Trolltech from QGraphicsScene autotest.
Task-number: QTBUG-19653

Change-Id: Iabebf17f5b09c17a767e81a0ccadd03513238a75
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 04:48:01 +01:00
Jason McDonald
12392e222a Remove mentions of Trolltech from QRegExp autotest.
Task-number: QTBUG-19653

Change-Id: I55ae6bed6fb2177cdc842de34ef31ae98d0d3237
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 04:47:56 +01:00
Jason McDonald
087c4c6bc1 Remove mention of trolltech from QThreadStorage test.
Task-number: QTBUG-19653

Change-Id: I6c74a15b6c6db415a545328b73b6dd704d69bfee
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 02:56:08 +01:00
Jason McDonald
9fe76bf6a6 Remove mention of Trolltech in QHttp autotest.
The data file named "trolltech" has nothing specific to Trolltech in its
contents.  Rename it to "testhtml".  The lack of a file extension is
intentional.

Task-number: QTBUG-19653
Change-Id: Idc5c5f4ffa447151e47f66ff7364f0fa8753a699
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 02:56:02 +01:00
Robin Burchell
c559edd76b Remove non-const getters marked for elimination.
These all have consted overloads, so there's no need for them.

Change-Id: I3d4f63b8eb8f1b7df7fa772d6172e0a954184d24
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-27 23:38:26 +01:00
Robin Burchell
7f32f6d682 Merge QTextDocumentFragment::toHtml() overload per Qt 5 comment.
Change-Id: Ic8850684c2298b996354e27cc96ad6486d7a3679
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-27 18:37:10 +01:00
Stephen Kelly
38d640ae67 Fix typos parametter -> parameter.
Change-Id: I0ebb3658477a1afdc1af5f4f6f64f12dc20ace56
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-27 15:57:36 +01:00
Stephen Kelly
6bb0fe08d8 Increase the value of the UserRole for the ItemDataRole enum.
For future proofing. No need for it to be so small.

Change-Id: I8a0c734f87671881f114922ada7c5bc9524de19b
Reviewed-by: Marius Bugge Monsen <marius@cutehacks.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-27 15:57:36 +01:00
Stephen Kelly
636aebb823 Replace a pseudo-virtual slot with a virtual method.
Change-Id: I5d0e1e54e0d3d441b71b7594bc14e872512cc937
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-27 15:57:36 +01:00
Jonas M. Gastal
d17b56f42b QLocalSocket shouldn't emit disconnected if it isn't connected yet.
Task-number: QTBUG-22082
Change-Id: I2e1dae133f50a232d4be3ff63cafaf1b417b286c
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-27 14:17:35 +01:00
Konstantin Ritt
ebe43992f9 add tests and benchmarks for QString::toLower()/toUpper()/toCaseFolded()
Merge-request: 70
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>

Change-Id: I3929d4d8963c3cef6d2c6420d8ad1f7a45f7e042
Reviewed-by: Olivier
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-25 21:58:57 +01:00
Peter Hartmann
1ddecb0aa2 network auto tests: add QNetworkReply test for pipelining
Reviewed-by: Markus Goetz
Task-number: QTBUG-21369
(cherry picked from commit a32bfdef6d6b45c916f143dcf8495a2e102c3eec)

Change-Id: Iecde23c56f128008c5172675601928d83180358a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 21:58:57 +01:00
Sami Rosendahl
b9acd85b2f Fix crashes and non-portable functionality in QDBusDemarshaller QByteArray extraction
QDBusArgument QByteArray extraction operator and QDBusDemarshaller that
implements the extraction do not check the type of the extracted value.
When extracting a QByteArray when the value actually is e.g. a struct of
mixed types the byte array extraction will crash as it attempts to extract
the struct data as a fixed array.

The fix adds DBus type checks to QDBusArgument byte array extraction
operator implementations.
The checks invalidate extracting arrays of other types than bytes to a
QByteArray that worked with the unchecked implementation. The rationale
for this restriction is
1) extracting a QByteArray to a variant checks already that the array
   element type is byte
2) Results of extracting arrays of types wider than a byte to a QByteArray
   are architecture-dependent making such code inherently non-portable.

Task-number: QTBUG-22840
Change-Id: Ie20f2adc06c697a68055c803215fb408568fdd90
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 21:58:57 +01:00
Sami Rosendahl
b4398dc4e3 Fix crash in QDBusDemarshaller QStringList extraction
QDBusArgument QStringList extraction operator and QDBusDemarshaller that
implements the extraction do not check the type of the extracted value.
When extracting a QStringList and the value actually is e.g. an array of
bytes the string list extraction will crash as it interprets the bytes as
char pointers.

The fix adds DBus type checks to QDBusArgument QStringList extraction
operator implementations.
The checks are as permissive as possible provided crashes are avoided.

Task-number: QTBUG-22840
Change-Id: I4b67d75b59c5052d939f3a69f3e92dabdb3bdd6b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 21:58:57 +01:00
Sami Rosendahl
8f19f14274 Fix crash in QDBusDemarshaller basic string-like type extraction
QDBusArgument string extraction operators and QDBusDemarshaller that
implements the extraction do not check the type of the extracted value.
When extracting string-like basic DBus type that actually is e.g. an
integer the string extraction will crash as it blindly attempts to use the
integer as a pointer to char.

The fix adds DBus type checks to QDBusArgument string type extraction
operator implementations.
The checks are as permissive as possible provided crashes are avoided.
Previously supported functionality of extracting an object path or type
signature to a string type is retained.

Task-number: QTBUG-22840
Change-Id: I29be1ae592658ca268c65ed692e1d42619d52280
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 21:58:57 +01:00
Jason McDonald
bca775edaa Improve QSettings autotest
QTestLib-based autotests cannot perform verification steps in the test
class constructor.  This needs to be done in initTestCase() instead.

Change-Id: Ib1f7f838f052fa0fc5104603bdac01ffd8313aef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 20:19:46 +01:00
Jason McDonald
f4c7bbba13 Remove empty functions from QSet autotest.
Change-Id: Id6fac3a83e3f4385ee1978a19e6dc92605f4abdb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 20:19:05 +01:00
Jędrzej Nowacki
fe089823bc Build fix for tst_qprinter with c++11
GCC 4.6 fails to build the test because of narrowing conversion.

Change-Id: I927693789be7f3df7bd1a96c8924fc04716a03f0
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 20:16:55 +01:00
Holger Hans Peter Freyther
03b6cb9345 v8: Build V8 for FreeBSD
For FreeBSD the libexecinfo port needs to be installed and linked to, all
tests execute and pass.

%uname -a
FreeBSD qt-ppa 8.2-STABLE FreeBSD 8.2-STABLE #4: Sun Oct 30 20:43:37 UTC 2011     ich@freebsd:/usr/obj/usr/src/sys/GENERIC  amd64
%./tst_v8
********* Start testing of tst_v8 *********
Config: Using QTest library 5.0.0, Qt 5.0.0
PASS   : tst_v8::initTestCase()
PASS   : tst_v8::eval()
PASS   : tst_v8::evalwithinwith()
PASS   : tst_v8::userobjectcompare()
PASS   : tst_v8::externalteardown()
PASS   : tst_v8::globalcall()
PASS   : tst_v8::cleanupTestCase()
Totals: 7 passed, 0 failed, 0 skipped
********* Finished testing of tst_v8 *********

Change-Id: Ia8198128126c2931807c7fb872c15baad47022e1
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2011-12-23 23:21:03 +01:00
Holger Hans Peter Freyther
1cb96a6809 v8: Change the selection of Operating System
Instead of doing "I want Linux and do it by selecting Unix and
discarding everything not implementing the Linux ABI". Select the
other operating system first and have a catch all Linux/Unix anchor.

!symbian is left inside as it does not hurt right now but could probably
be removed before Qt 5.0.0.

Change-Id: I731d8349e4f9c0ac33d547523f0a0f422e994e54
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2011-12-23 23:20:49 +01:00
Giuseppe D'Angelo
c580be804f Remove unused -DQT_NO_PCRE from qmake makefiles
That define is not used anymore when building qmake.

Change-Id: I6a478cf4bb6cc8dfe87a3cc96f1d520b08e4ba6f
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-23 21:24:25 +01:00
Stephen Kelly
34ebd0397e Fix cmake files for static builds.
Change-Id: I3864017df6fc0daeb31b389c8883401d344730bf
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2011-12-23 17:35:33 +01:00
Jørgen Lind
57d2306f44 Link to X and Xrender libs in glxconvenience
Change-Id: I54b2704be678f2c3b9ab8d24d044977c9c01e98e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-23 15:21:27 +01:00
Jan-Arve Saether
a203debb0b Fix regression, make sure hit testing work on windows again.
The previous code did not make much sense

This regressed due to 74c9f9d83f

Change-Id: Ia4374623257863edca706a1c3d8b565d0c6bd4c1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2011-12-23 13:40:12 +01:00
Bradley T. Hughes
ae8c61db21 Finish removing Qt3 support
Remove the (-no)-qt3support options from configure, and remove the last
remaining references to Qt3Support, QT3_SUPPORT, and
QEvent::ChildInserted.

The compatibilityChildInsertEvents() tests in tst_QObject and
tst_QWidget have been renamed to childEvents(), which is a more
appropriate name.

Change-Id: Id0b45e9b177efcc8dceee8c9ed8afafedeeace2f
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-23 11:59:11 +01:00
Sune Vuorela
ef03396072 QCryptographicHash: allow to hash the content of a QIODevice
This adds a new function (and tests) to give the possibility of doing a
QCryptographicHash of a QIODevice, like a QFile or whatever people
needs.

It is a quite handy overload in many cases.

Change-Id: I22fd272f05571844641b3daefcc6746be4e5c7c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-22 19:47:47 +01:00
David Faure
eff09a2794 Fix for -Werror -Wshadow
qevent.h:792:49: error: declaration of 'device' shadows a member of 'this' [-Werror=shadow]

Change-Id: Iccb7e79dd97d55b17fbd4dfaf3503b9e251adcfc
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-22 18:07:34 +01:00
Jędrzej Nowacki
1dc86cbe85 Remove redundant template parameter from QMetaType's internal classes.
Filter doesn't have to be a parameter because we always use
DefinedTypesFilter.

Change-Id: I19b8eb47a4c50e290cf712f909aaead8fdc94cd9
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-22 16:29:14 +01:00
Shane Kearns
4954f71648 Fix http authentication to a different realm on the same server
This is a regression caused by the NTLMv2 authentication patch.
I have manually tested NTLMv2 authentication against MS IIS and reverting
these two lines does not break it.

Task-number: QT-5209
Change-Id: I64159cbe468e1a7f834f8726fd0c9d4ab4c54b38
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-22 16:10:33 +01:00