Commit Graph

122 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Olivier Goffart
f3242864c3 Use C++11 static_assert
Change-Id: I75aa2bc209cdc8869e7daa9fd0dd865ccf65a68e
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@kde.org>
2011-11-02 13:24:36 +01:00
Jason McDonald
a7b1f30d57 Remove disabled test data from QUrl autotest
The removed test data was for obex URLs, which are not supported by
QUrl.

Change-Id: I166130ae936342d415165e46b7943d198de8986b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-02 05:43:49 +01:00
Casper van Donderen
51bee2babf Remove test that hasn't been enabled since 2007.
Task-number: QTBUG-22444

Change-Id: Id7569cf60cb314511a7d4f38833913c442f3fbba
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2011-11-01 17:39:32 +01:00
Jędrzej Nowacki
991d9cf928 Fix broken build.
Variadic macros are not supported by C++98 standard.

Change-Id: Ib520297e43b654b46925f3ee2735a975ebbe8e35
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-01 16:15:08 +01:00
Olivier Goffart
d2ed588419 tst_qvariant: add a test QVariant works with not movable types
Soon, QVariant will use more internal storage. It is important
that it still work with not movable types

Also, check with type that are movable but cannot be copyed
without their copy constructor to be called such as QSharedDataPointer

Change-Id: I6d67755476e4822468599bebfa8774ad96a15306
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2011-11-01 12:56:09 +01:00
Jason McDonald
a6e6296ce3 Remove disabled code from QString autotest.
The removed code was disabled before the tests were imported into the Qt
repository in 2006, so its meaning or usefulness is lost in the mists of
time.

Change-Id: I3108a1a1d86cd135886608f47dcd88bf49f2d3fd
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-31 06:59:36 +01:00
Jason McDonald
2e8b151049 Remove disabled code from QRegExp test
The removed code was disabled before the tests were imported into the Qt
repository in 2006, so its meaning or usefulness is lost in the mists of
time.

Change-Id: Iccdf5638106b054f02ed73790f7acda1b17b045b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-31 06:59:30 +01:00
Jason McDonald
665c9390d0 Remove tests for API that never made it into Qt.
Change-Id: If78d82abfb4ff3402eb8f36729bacc3c4d343d0c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-31 06:59:24 +01:00
Jason McDonald
7698cd3750 Remove obsolete code from QChar autotest.
QUnicodeTables::ligature() was removed from the API in 2006.  The
commit that disabled the test also changed the code to call
QChar::ligature(), which has never existed.

Change-Id: I056c17c178a527b076538fb007404ff0b735ba02
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-31 06:59:18 +01:00
Jason McDonald
e92f9fc49e Remove obsolete code from qstate autotest.
This was originaly the only test function in this test, and should have
been deleted when it was replaced by the other test functions.

Change-Id: Idc71a5462fd4d19955f9b14389b877be16c62ab5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-31 06:59:11 +01:00
Jason McDonald
a13b24eac0 Improve QBuffer autotest
The documentation of QIODevice::pos() states: "For sequential devices or
closed devices, where there is no concept of a "current position", 0 is
returned".  The test had a disabled check for a position of -1 before
the device is opened.  Make the test agree with the documentation.

Change-Id: Ide5729bfc825cdb84caf4851574a57d3ef42ccb2
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-31 06:58:15 +01:00
Jason McDonald
be16b833a5 Remove debugging code from QFileSystemWatcher test
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.

Change-Id: I201ba754df26ffc30997bead8b822f97913db2b6
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-31 05:27:56 +01:00
Jason McDonald
31e3f78336 Remove disabled tests from QUrl test.
Some tests were copied in from KDE's KURL sometime prior to Qt's tests
being added to the Qt repository in June 2006.  This was presumably
done with the intention of making the tests work for QUrl, but that
never happened and the copied tests have never been enabled.

This commit removes the copied material.

Change-Id: Ic35526f0018900bd60d7905646b24c62317b5e47
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-31 05:27:48 +01:00
Jason McDonald
9d606227c6 Remove obsolete code from qtconcurrentiteratekernel test.
The removed code refers to WhileIteration, which does not exist.

Change-Id: I4c44bc319ac776d16ce9ba7b5c2938ce1642a3f6
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-31 05:27:40 +01:00
Jason McDonald
5a71947ee4 Remove obsolete code from qtconcurrentrun test.
The removed code was left over from an unfinished MSVC6 compatibility
API (see commit e3e28e7a in the grafted history).  That compiler is
no longer supported, so this code can be retired.

Change-Id: I81bcfa771ae13579f2458eb2d3ebf41c6af8577c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-31 05:27:33 +01:00
Jo Asplin
b5ef53df45 Re-enabled tst_LargeFile
tst_LargeFile currently seems to pass in a stable way in CI

It does have an issue on 64-bit Linux (see QTBUG-21175), so
that test function is still disabled (QEXPECT_FAIL'ed) on that platform.

Change-Id: I818046f84f2db5eb2155ae1f51f69581029bfaee
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2011-10-29 19:56:37 +02:00
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
c9bc2a6fda Remove unnecessary QSKIP.
Change-Id: Icaa0687d5d0370ede6076cbee9d97d89e338ca17
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-27 11:14:12 +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
Jason McDonald
eeaf051558 Replace QSKIP with QFAIL in qputenv test
If qputenv fails, the test should fail rather than skip, particularly as
the test is supposed to be testing qputenv.

Change-Id: Iabe13d360cabaeffda46fab19f1dd0d4ed8e1eee
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-27 03:15:09 +02:00
Jason McDonald
66c3f8753c Remove inappropriate QSKIP in QTextCodec autotest.
There were only two ways the QSKIP could be called: (1) the C++ runtime
is broken, or (2) the earlier call to resize the string failed.

In both cases there should be a hard test failure. In the former case, a
broken C++ runtime calls all of the test results into question.  In the
latter case, the QByteArray::resize() method has suffered a regression.

Change-Id: I5adf942d2eb4d746d2ab31e98571c5d9bdd40890
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-27 03:14:59 +02:00
Jason McDonald
a97c0c3c99 Remove obsolete QSKIP call.
The bug referenced in the QSKIP has been marked as resolved, so this
QSKIP should no longer be needed.

Change-Id: I41dd964827a3df8fb5ebb9674cef9db59c03d432
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-27 01:38:39 +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
Jo Asplin
1b345e8655 Re-enabled tests
This commit re-enables tests that are assumed to be ok by now, since they:
- Have been passing in CI for a long time recently (more precisely, not failed once in pulse run range 730-829).
- Did not have any known issues associated with them.

Note that not all of these tests were disabled as a result of QTBUG-21402.

Task-number: QTBUG-21402
Change-Id: I80bbf8b351bd9165aa968e98f4dc17e8be6bc7c3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-26 02:58:36 +02:00