Commit Graph

678 Commits

Author SHA1 Message Date
Jason McDonald
928ebac567 Make QTimeLine test significant.
Known failures in this test are now handled by QEXPECT_FAIL.

Task-number: QTBUG-24796
Change-Id: I12ba57370cf3df1a85a108fbbcdc9db2222491c1
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-04-26 09:27:25 +02:00
Thiago Macieira
f6aef23ff1 Ensure that QUrl::{to,from}LocalPath encode/decode properly
Unlike path(), toLocalFile() isn't reporting a URL component, so it
should decode the percent-encoded characters fully. This extra
decoding pass is meant to catch %00 to %1F, %7F and %25 (the percent
sign itself).

It also catches %80 to %FF, which aren't decoded because they don't
form UTF-8 sequences. That means QUrl::toLocalFile() has undefined
behaviour if the path contained non-UTF8 sequences.

Task-number: QTBUG-25459
Change-Id: Iab5a0ba6afcfc4510e297984f2ffc208cedd752b
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-26 03:15:22 +02:00
Olivier Goffart
67f58040ea Remove QMetaObjectExtraData and put everything into QMetaObject
QMetaObjectExtraData was added when support for QMetaObject::newInstance
was added. One needed a place to put the pointer to static_metacall in
the QMetaObject.

But as we break binary compatibility, one can change the size of
QMetaObject, and put everything back inside QMetaObject's own structure.
Meaning it is not required anymore to have one QMetaObjectExtraData
instance per QMetaObject anymore.

Change-Id: If0b8f586cbaf633eed10045adee3ba3366826c86
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-04-25 20:19:29 +02:00
Kent Hansen
28c79d8c0b Add comparison operators == and != for QMetaMethod
This is done in preparation of introducing the
QObject::connectNotify(QMetaMethod) function. Together with the
forthcoming QMetaMethod::fromSignal() function, which returns the
QMetaMethod corresponding to a Qt/C++ signal (member function), the
comparison operators provide an effective way of checking which
signal was connected to.

Change-Id: I2de48628c4884a7174fb8574895f272cb3fe5634
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-04-25 20:16:56 +02:00
Thiago Macieira
6159870348 Revert QUrl::isRelative to its Qt 4 behaviour
Instead of trying to return whether the URL is relative to something
undefined, let's instead follow what the documentation was saying all
along and what the RFC says about "Relative References".

Change-Id: I32722321a6b36c6e3480669ad769390e4c6f7d1c
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-25 14:58:36 +02:00
Jason McDonald
3de77c3daa Mark known test failures in Windows developer build.
Previously, the CI system has not been testing on Windows with the
-developer-build configure flag. Mark known failures for this
configuration so that tests can be run in enforcing mode.

Change-Id: I5fbbbe09a7b400d626107c66dcbd5c5469a45b20
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-04-25 10:29:56 +02:00
Jędrzej Nowacki
7c36d4b0d3 Use macro for QByteArrayData initialization.
Change-Id: Ib3f906dc5f313c7f9669efda26a93a76af7d7f80
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-04-25 10:29:56 +02:00
Debao Zhang
6fb0110f97 Using QLatin1String instead of QLatin1Literal
QLatin1Literal is just a typedef of QLatin1String.

Change-Id: If20ca225e57a7fb45a7775f0fc81aedb6da88c96
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-04-25 01:56:56 +02:00
Thiago Macieira
77a816c00d Ensure that QUrl::toLocalFile returns decoded paths
QUrl::path() already decodes almost everything, but let's pass the
formatting flag to be sure.

Note: decoding of control characters from U+0001 to U+001F is not
implemented. Non-UTF8 sequences are also not representable.

Change-Id: I9a0ae2282ec3d48cc0e70e5b2d3824fb120709ed
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-24 19:36:55 +02:00
Thiago Macieira
fd7e1cef9c Don't strip the leading slash of letter+colon paths on Unix
It's perfectly valid to have a path of /c:/a.txt on Unix, so don't
strip the leading slash unless we're on Windows.

Task-number: QTBUG-20322
Change-Id: I721bd0a65b41048bc735d4eaa0d536174164fe64
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-24 19:36:55 +02:00
Jason McDonald
1eebbacb86 Remove insignification from qabstractitemmodel test on Mac OS X.
Since this test began to run again on Mac, it has been passing
consistently.

Task-number: QTBUG-22748
Change-Id: Ia81cf60b11d45fb331b5eca5d13df00556c18e07
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-04-24 19:36:55 +02:00
Jason McDonald
d7a102ac65 Start running some disabled tests again on Mac OS.
These tests were disabled when trying to get CI working on Mac OS
because they asserted or crashed.  Now that CI is working well on Mac
OS, start running these tests again, initially as insignificant tests.
CI results will then be used to determine whether the tests can be made
significant.

Change-Id: Ife411e6b8c84ade45c865ef35f3ae0071d6f8d2b
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-04-23 09:46:22 +02:00
Thiago Macieira
ad83a7ad6f Silence two warnings in QVariant's unit test.
These warnings are expected and correct, so ignore them.

Change-Id: I43931950e46bd3c931db869902574ee7219efa1d
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-04-20 22:23:23 +02:00
Thiago Macieira
369863efef Don't push unnecessary data to a data stream for QVariant()
Adjust the test because we don't read past the end anymore.

Task-number: QTBUG-25108
Change-Id: I8243f1d5ae79d1256aab2cb1132598a716a7eeeb
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-04-20 22:23:23 +02:00
Rohan McGovern
1464081dfb Really marked tst_QProcess as insignificant on Windows.
This test hangs ~2.6% of the time in CI.

The previous commit which attempted to mark this test as insignificant
did not work due to this .pro file doing a load(testcase) prior to the
line which set CONFIG += insignificant_test.  testcase.prf must be
loaded _after_ insignificant_test is set.

Task-number: QTBUG-25342
Change-Id: I20470337fda8235e2fd0b6e8d5f564c8c57d167e
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-04-19 01:57:58 +02:00
Jędrzej Nowacki
b3e55fbf4e Do not assert when QVariant is constructed from an invalid type id
That change also fix moduleForType() which was wrongly recognizing
negative ids as belonging to Core.

New tests were added.

Change-Id: I40a5819effb32489a45937011980457387c9f8be
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-04-19 01:57:58 +02:00
Konstantin Ritt
95bd974163 fix QChar::decompositionTag() returns wrong result for Hangul syllables
Change-Id: I28e7b14b6a90aa539f8a50107737a66b3484fc00
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-17 18:44:13 +02:00
Konstantin Ritt
087cda285f fix QChar::isPrint() returns an incorrect result.
results are now equals to results of ICU's u_isprint() for the entire set
of the Unicode code points

Change-Id: I763f4b37cccd285eb01543d486f25bd7ea011241
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-17 18:44:13 +02:00
Jason McDonald
e01ecc6d6f Remove insignification from QPluginLoader and QFactoryLoader tests.
Archived build logs on http://testresults.qt-project.org/ci/ show that
the QPluginLoader test has failed in CI only once in the last 1000
builds (in build 1786), and on that occasion the test was legitimately
blocking a regression.

The QFactoryLoader test was derived from the QPluginLoader test and has
not failed since its first run on March 29, 2012.

Task-number: QTBUG-22765
Change-Id: I866b4b8e30e393e0c7e7292119c072b27008ab43
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-04-17 16:28:46 +02:00
Lars Knoll
576a8e152e Merge "Merge remote-tracking branch 'origin/api_changes'" into refs/staging/master 2012-04-17 13:09:29 +02:00
Bradley T. Hughes
1a1c2b4075 Add tests/auto/gui/kernel/qguitimer
This test is like qguieventdispatcher, it duplicates a corelib test in
the gui test suite, since the QtGui library often gets a different event
dispatcher implementation from the platform plugin.

Change-Id: Ifd724066950bc3b98a804bc2e5d40ce7b0429af4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-04-17 13:09:29 +02:00
Lars Knoll
64255ef650 Merge remote-tracking branch 'origin/api_changes'
Change-Id: I964b0a6f5c38351fdfafb8a2a128a349ff8c89d1
2012-04-17 12:58:52 +02:00
Sergio Ahumada
16b53b2f0e Merge "Merge remote-tracking branch 'origin/master' into api_changes" into refs/staging/api_changes 2012-04-17 10:38:24 +02:00
Jason McDonald
1bbd9d8ee5 Make failures in QTimeLine autotest more stable.
QTimeLine appears to have very poor timing characteristics. Historical
CI logs show roughly one failure in every twenty-five test runs on
Windows, and less frequent failures on Mac and Linux.

The root of the problem seems to be that QTimeLine's currentTime
counter appears to run at a variable speed and the only guarantee is
that it is slower than wall time.  The frameChanged() test
function waited for double the expected duration of the timeline and
still found that the timeline had failed to finish in about one in every
thirty test runs.  The interpolation() test function also failed for the
same reason, though less often.

This commit makes the frameChanged test more strict so that the poor
timing will be demonstrated more often, waiting only 1.5 times the
duration instead of double the duration.  It also makes the test fail
gracefully so that this known issue won't disrupt CI when the test is
made significant in a later commit.

Task-number: QTBUG-24796
Change-Id: If469d43abb662e24445a9da619052eea9cf7c581
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-04-17 10:15:44 +02:00
Jason McDonald
5192b06ccb Fix bug in tst_QTimeLine::duration().
QTimeLine::currentTime() is an integer in the range [0..duration], not a
float in the range [0.0..1.0].  The aim of the test appears to be to
verify that currentTime() is at least 90% of the way to duration() when
the timeline is almost due to finish, so verify that and give the
corresponding 10% tolerance on reaching the end state.

Change-Id: I38646947c3b9189a4e8e91a450c6071430ddc66a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-04-17 08:06:47 +02:00
Rohan McGovern
4e282e3ea2 Marked tst_QProcess as insignificant on Windows.
This test hangs ~2.6% of the time in CI.

Task-number: QTBUG-25342
Change-Id: I2c3531140e15edfe2dc2524e101b84e3206a4e61
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-04-17 07:36:35 +02:00
Stephen Kelly
da7880b0f0 Update parent indexes first with changePersistentIndex.
Otherwise, the order of updating of the indexes will cause
inconsistent results because it will rely on ordering within a
QHash (which is indeterminate).

Task-number: QTBUG-25325

Change-Id: I7d99578c8ee2954b8562dc5aff7dc32e74d41fb5
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-17 00:47:49 +02:00
Jason McDonald
cdfdc0b4a6 Remove insignification from QLocale test for Mac OS X.
This test has not failed in the last 500 Continuous Integration runs.

Task-number: QTBUG-22769
Change-Id: Ib2e95bb2291757941baa0ea46d568816eef20b09
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-04-16 21:50:18 +02:00
Lars Knoll
9bd0323551 Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
	configure
	src/corelib/io/qurl.cpp
	src/gui/kernel/qwindow.cpp
	src/tools/moc/generator.cpp
	src/widgets/kernel/qwidget_qpa.cpp
	src/widgets/styles/qstyle.h
	src/widgets/widgets/qtabbar.cpp
	tests/auto/corelib/codecs/utf8/tst_utf8.cpp

Change-Id: Ia457228d6f684ec8184e13e8fcc9d25857b1751e
2012-04-16 12:04:34 +02:00
Stephen Kelly
77fd8fd997 Show the type and address of QObjects in debug output.
Change-Id: I9f44ab80a6fb763adc9cbaf47de8e1b97212332d
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-04-16 11:35:44 +02:00
Giuseppe D'Angelo
51fecf80b7 Mark tst_qabstractitemmodel as insignificant after QHash randomization
The testChildrenLayoutsChanged fails randomly. This happens rarely,
f.i. wasn't spotted by CI when QHash randomization itself was merged;
but is indeed reproducible by running the test a few times in a row.

This is now blocking api_merges integration, and I have no idea
how to fix it.

This patch marks the test as insignificant for now (the bug
tracking this test failure is QTBUG-25325), and switches the failing
tests from QVERIFY(a == b) to a proper QCOMPARE (so that the
expected values do show up in the build logs).

Change-Id: I16f0e28bcbb06dbac2e7169f4676a19ccf626a92
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-04-15 21:00:52 +02:00
Konstantin Ritt
73b24486ed UCD-5.0: apply Corrigendum #6
http://unicode.org/versions/corrigendum6.html:
> in Unicode 5.0, the list of characters with the Bidi_Mirrored property
> was made consistent for brackets and quotation marks, in preparation for
> new constraints on bidi mirroring. However, after publication of
> Unicode 5.0.0 it was discovered that this change adversely affected
> several quotation mark characters in deployed data.

Task-number: QTBUG-25169
Change-Id: Id49caf401af2d5a1e6dbcc32b2f350aa20b7f901
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-15 03:53:07 +02:00
Giuseppe D'Angelo
5e24d22af0 QHash: fix key() test
The key returned by QHash::key is an arbitrary one that maps to the
given value. The test instead relied on it being a specific one.

Change-Id: I090351797e8b52036d78160fd810518a11e8107d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-14 13:51:49 +02:00
Giuseppe D'Angelo
8427ff09ab QSharedPointer: hash autotest fix
The hash autotest is wrong: it assumed that the iterator on the hash
would reach the end after iterating on two elements with identical key.
But three elements were added to that hash, and the third one
can appear after the other two.

That code path is left for the map test only.

Change-Id: I51de7987e2b132b6caff7bb4bac6a57fb7fcb530
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-13 17:05:11 +02:00
Giuseppe D'Angelo
80c28fe3bd QRegularExpression: add more test data
Change-Id: I44d19f976ced7b073f66d0ea943fafea37940c48
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-04-13 15:25:19 +02:00
Olivier Goffart
d1329e43cb moc: fix compilation of signals returning pointers.
That was a regression introduced in 1c5db1aff

Example:
  signals: int *someSignal();
would produce this code:
   int* _t0 = int*();
which does not compile

So have special handling for pointer to change it to '= 0'

Change-Id: Ie695e15e309d15c3cfd5c5a69ac8bf6d61ae9915
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-04-13 08:33:34 +02:00
Rohan McGovern
b7486591cd test: marked tst_qlocale as insignificant on Windows
This test hangs 2-3% of the time.

Task-number: QTBUG-25284
Change-Id: I32e01696262be2de7e015b8f811d1666551426cc
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-04-13 07:18:24 +02:00
Thiago Macieira
4d79312f1c Ensure proper handling of empty-but-present URL components
The new QUrl is able to distinguish a URL component that is empty from
one that is absent. The previous one already had that capability for
the port, fragment and query, and the new one extends that to the username,
password and path. The path did not need this handling because its
delimiter from the authority it part of the path.

For example, a URL with no username is one where it's set to QString()
(null). A URL like "http://:kde@kde.org" is understood as an
empty-but-present username, for which toString(RemovePassword) will
return "http://@kde.org", keeping the empty-but-present username.

Change-Id: I2d97a7656f3f1099e3cf400b199e68e4c480d924
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-12 23:01:37 +02:00
Bradley T. Hughes
a387fd8ee3 Do not ignore tests/auto/corelib/io/qtextstream on Mac OS X
This test no longer fails, so we can remove CONFIG+=insignificant_test

Task-number: QTBUG-22767
Change-Id: If3ca194fc982ad8fdc3e9a7f62fc346190ff01ea
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-04-12 21:26:42 +02:00
Bradley T. Hughes
20a36364eb Do not ignore tests/auto/corelib/io/qiodevice on Mac OS X
This test no longer fails, so we can remove CONFIG+=insignificant_test

Task-number: QTBUG-22766
Change-Id: I379873d5c483157e414201e5f8a13c3f4407f9fd
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-04-12 21:26:42 +02:00
Bradley T. Hughes
4b668da750 Do not ignore tests/auto/corelib/io/qfile on Mac OS X
This does not fail anymore, remove CONFIG+=insignificant_test

Change-Id: I4f98cfad563adfa460910976317c91e852db6872
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-04-12 21:26:42 +02:00
Konstantin Ritt
1035c93245 make QStringList::sort() to take a Qt::CaseSensitivity param
Task-number: QTBUG-12892

Change-Id: I402e6fb12ff24ac26c5a8103bf81547946f9cc58
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-12 10:39:22 +02:00
João Abecasis
a0a1595185 Prefer QCOMPARE to QVERIFY, as it gives better output
Done-by: Jędrzej Nowacki
Change-Id: Ic1c8fd5b8acede52b45e5ea16b14fb5bae78f171
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-12 01:56:57 +02:00
Thiago Macieira
bb03f8e812 Readd a bunch of tests that had got removed in the QUrl porting
Most of the tests were removed while QUrl::toEncoded or fromEncoded
were deprecated in the development process. Since they aren't
deprecated in the end, bring them back.

Change-Id: Ibdb6cd3c4b83869150724a8e327a03a2cd22580d
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-11 23:32:32 +02:00
Thiago Macieira
1b7e9dba75 Change the component formatting enum values so the default is zero
By having the default value equal to zero, we follow the principle of
least surprise. For example, if we had
      url.path()
and we refactored to
      url.path(QUrl::DecodeSpaces)

Then instead of ensuring spaces are decoded, we make spaces the only
thing encoded (unicode, delimiters and reserved characters are
encoded).

Besides, modifying the default can only be used to encode something
that wasn't encoded previously, so having the enums as Encode makes
more sense.

As a side-effect, toEncoded() does not support any extra encoding
options.

Change-Id: I2624ec446e65c2d979e9ca2f81bd3db22b00bb13
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-11 23:32:26 +02:00
Thiago Macieira
997ac954ab Allow {} to remain decoded in URLs in the path and query
This allows things like http://example.com/{1234-5678}?id={abcd-ef01}.
But do not allow it in other parts of the URL. I could allow it in the
fragment, but in the username and password it would be too ugly.

In order to do that, make DecodeReserved use two bits and have
PrettyDecoded set only one of them. That way, toString(PrettyDecoded)
can be distinguished from toString(PrettyDecoded | DecodeReserved),
just as path(PrettyDecoded) can be distinguished from
path(PrettyDecoded & ~DecodeDelimiters).

Also, take the opportunity to avoid decoding the reserved characters
in the query. Keep them encoded as they should be.

Change-Id: I1604a0c8015c6b03dc2fbf49ea9d1dbed96fc186
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-11 23:32:18 +02:00
Thiago Macieira
a01c662d37 Introduce QUrl::DecodeReserved and reorder the enums
DecodeReserved applies to all characters between 0x21 and 0x7E that
aren't unreserved, a delimiter, or the percent sign itself.

Change-Id: Ie64bddb6b814dfa3bb8380e3aa24de1bb3645a65
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-11 23:32:04 +02:00
Thiago Macieira
0441b2d4c3 Merge QUrl::DecodeAllDelimiters and QUrl::DecodeUnambiguousDelimiters
There's little value in having the DecodeUnambiguousDelimiters option
since neither QUrl nor QUrlQuery can return values that are ambiguous
in that particular context, ever.

This option could be used to encode a character if, when placed
in a URL, it would need to be encoded. Such cases are hash (#) or
question marks (?) in the path component, or slashes (/) and at signs
(@) in the userinfo.

However, we don't need two enums for that, since there are no
other characters that can appear in either form. Still, leave two bits
for this enum. In the future, if we want to split the gen-delims from
the sub-delims, we are able to.

Change-Id: If5416b524680eb67dd4abbe7d072ca0ef7218506
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-11 23:31:59 +02:00
Thiago Macieira
9af551f7ab Add a big test for QUrl encoding principles
This tests how QUrl encodes and decodes certain characters and leaves
some other ones alone. It also tests that the output of toString() (in
whichever encoding was being tested) is also parsed again to be
exactly the same as the previously decoded form.

Change-Id: Ie358d001f8b903409db61db48bde1ea679241a60
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-11 23:31:52 +02:00
Thiago Macieira
ef288340da Fix the handling of ambiguous delimiters in the query part of a URL
This is the same fix as the previous commit did for the other
components of the URL. But we're also changing how we handle the "[]"
characters in a query: previously the handling was like for other
sub-delims; now, they're always decoded, assuming that the RFC had a
mistake and they were meant to be decoded.

Change-Id: If4b1c3df8f341cb114f2cc4860de22f8bf0be743
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-11 23:31:46 +02:00