Commit Graph

6096 Commits

Author SHA1 Message Date
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
Thiago Macieira
8d3cb11261 Make QUrl handle ambiguous delimiters correctly
Refactor the way that QUrl stores and returns the components of the
URL so that ambiguous delimiters (gen-delims that could change the
meaning of the parsing) are interpreted correctly. Previously, QUrl
called "unambiguous" the form found in a full URL, even though each
item in isolation could have more characters decoded.

Now, instead, store only the fully decoded form. To recreate the
compound forms (the full URL, as well as the user info and the
authority), we need to do more processing.

This commit applies to the user name, password, path and fragment
only. The scheme, host and port do not need this work because they are
special; the query is handled separately.

Change-Id: I5907ba9b8fe048fff23c128be95668c22820663a
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-11 23:31:41 +02:00
Shane Kearns
dc325aab18 Fix error reporting in QNetworkReplyHttpImplPrivate
When errors are detected synchronously in _q_startOperation,
they were not reported. This is because unlike the generic
QNetworkReplyImpl the function is called directly rather than
using a queued connection.
In order to report errors, use the _q_error and _q_finished slots
so that signals are emitted after returning to the event loop
i.e. after the application had a chance to connect the QNetworkReply

Change-Id: I8a7bbe79a934f4634fb4e0572ebb5479dfc5f489
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-04-11 22:20:10 +02:00
Shane Kearns
680f35ec1e Add unit test for usagePolicies
Change-Id: I749268d81521d84ffc709014963a0f34fbf6d74c
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-11 22:20:03 +02:00
Shane Kearns
1a6b338e10 Add autotest interface to get session from QNAM
Change-Id: I7d8ea41299408377042a9f0d0a672e1a6fb57e7d
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-04-11 22:19:41 +02:00
Shane Kearns
b0c7f34c90 Check background requests are allowed before starting
If background requests are not allowed, don't even attempt to start
the network session, just fail the request immediately.

After this change, a QNAM with mixed requests queued should behave
as follows when background requests are disabled:
 - background requests at head of the queue fail
 - first foreground request starts the session and succeeds
 - remaining background requests fail
 - remaining foreground requests succeed

If policy is changed on the fly, then running background requests
are not aborted. However queued background requests won't be started.

Change-Id: Ic9aba1eb59ca41b166a08d2ed09418e1b6af6b60
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-04-11 22:19:35 +02:00
Shane Kearns
6957b8d1ed Define usagePolicies API in QNetworkSession
This allows the system to publish usage restrictions to applications
related to the network in use.
Currently there is only one restriction defined:
NoBackgroundTrafficPolicy, which means that non user initiated traffic
should be avoided (e.g. background downloads).
For example this policy could be applied to save battery or data transfer
charges.

Change-Id: I49e26c0f3650d2b92f4ec51981aae9435b717b49
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-11 22:19:21 +02:00
Shane Kearns
ad73c3505a Use NetworkSessionFailedError in QNetworkReply
Switched the error code.
Republish the error string from the bearer plugin if possible.

Change-Id: I9e4ac7a9914fbf2e87fe8fd3a5175deda6d933d2
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-04-11 22:18:48 +02:00
Shane Kearns
5017b2ee54 Define QNetworkReply::BackgroundRequestNotAllowedError
This error will be used when background network requests are not allowed
according to the current policy of the bearer plugin.
For example, to save power when battery is low on a portable device.

Change-Id: I866e115f8fdd046134da99ea895b7c1df0375f26
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-04-11 22:18:43 +02:00
Shane Kearns
fd98a8bd3c Define QNetworkReply::NetworkSessionFailed error
This is to replace the UnknownNetworkError which occurs when the
internal QNetworkSession fails to start (e.g. no usable WLAN available)

Change-Id: I2b14577c22e0acf8ff07be7e932f0dfe9ac89c33
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-04-11 22:18:37 +02:00
Shane Kearns
ade5adaab8 Set ConnectInBackground based on request
Set the QNetworkSession attribute to match the QNetworkRequest that
triggered it.
Currently if there are a mix of normal and background requests queued
and background connections are not allowed by policy:
 - background requests at the head of the queue should fail
 - first foreground request should successfully start a connection
 - remaining requests succeed regardless of background attribute

Change-Id: If0e3ec0b8a5096e3d7cd6df85884c6f53172d233
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-04-11 22:18:29 +02:00
Shane Kearns
2eccb18889 Define BackgroundRequestAttribute
This is so that the ConnectInBackground flag can be set on the
QNetworkSession internal to QNAM according to pending requests.

Change-Id: If0cc62f5117ed8febbbda7b7f6de62b11b274258
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-04-11 22:18:19 +02:00
Robin Burchell
7e74236477 Move QVectorPath::polygonFlags to its own class.
Who can say why it was put in QPaintEngineEx's header, but it certainly doesn't
belong there.

Change-Id: Ieb3b977affcf4b240f621d13b72bdc0e8f8138b9
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-11 14:33:33 +02:00
Robin Burchell
517240096b Move QRectVectorPath into the .cpp of the only file actually using it.
Change-Id: I2778b5142ee574f44a9f9489a2752265c6a6c170
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-11 14:33:18 +02:00
Konstantin Ritt
f97db2555e unite QString::normalized() overloads
Change-Id: I27545e599a1831728e491a9fad1e52fa255535fc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-04-11 10:46:19 +02:00
Robin Burchell
7be255156f Deprecate qMemCopy/qMemSet in favour of their stdlib equivilents.
Just like qMalloc/qRealloc/qFree, there is absolutely no reason to wrap these
functions just to avoid an include, except to pay for it with worse runtime
performance.

On OS X, on byte sizes from 50 up to 1000, calling memset directly is 28-15%
faster(!) than adding an additional call to qMemSet. The advantage on sizes
above that is unmeasurable.

For qMemCopy, the benefits are a little more modest: 16-7%.

Change-Id: I98aa92bb765aea0448e3f20af42a039b369af0b3
Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com>
Reviewed-by: John Brooks <john.brooks@dereferenced.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-11 10:46:19 +02:00
Olivier Goffart
5dc506ad84 Mark QObject::disconnect overload const
Consistency with the non-static connect overload

Task-number: QTBUG-23622
Task-number: QTBUG-1772
Change-Id: Ic09df9cca1feaabb6b5cf335f04a0d6d4bbf011f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-11 08:46:48 +02:00
João Abecasis
6abfc992b9 Make reallocData() take (unsigned) size, including null
The parameter represents an allocation size and unsigned matches the
Q*Data::alloc member it ultimately represents (even if they currently
differ in accounting for the null).

There's still work up for grabs to ensure we avoid integer overflows
when growing.

Change-Id: Ib092fec37ec2ceed37bebfdc52e2de27b336328f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-11 02:26:41 +02:00
Thiago Macieira
d4f3052a1b Adjust a double leading slash in the path for FTP to /%2F
Some FTP implementations (currently not including QNAM) strip the first
slash off the path in an FTP URL so that the path in the URL is relative
to the login path (the user's home directory). To reach the root
directory, another slash is necessary, hence the double slash.

In anticipation of future URL normalisation, which Qt 4 could do, "//"
could be rendered to "/", so this extra slash should be "%2F".

This operation is done only in QUrl::fromUserInput.

Change-Id: If9619ef6b546a3f4026cb26b74a7a5a865123609
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-10 22:54:37 +02:00
Thiago Macieira
81d1f79a7f Add early-clobbers to the output variables in CPUID
Without those early-clobbers, the compiler might decide to schedule a
register that is also used as output. The existing early clobber in
the tmp variable was there so the compiler wouldn't use a register
scheduled as input (especially EAX).

To be honest, I'm not convinced that the compiler should be allowed to
do this. That means that two output variables are scheduled to the
same register... still, this fixes a problem found with GCC 4.2 (at
least the Mac one).

Change-Id: I6cd4676284e9a83d6aac4b439c6e58e347c40106
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-04-10 22:54:20 +02:00
Thiago Macieira
e6a1675da5 Make plugin linking fail if some references aren't present
It's better to fail at linking time than to try and figure out later why
QPluginLoader refuses to load the plugin.

Change-Id: I439bad9dcdbfff9f76efe40381fd7ccfffe738bc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Donald Carr <donald.carr@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-04-10 18:22:51 +02:00
Oswald Buddenhagen
143c4d3e13 Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
	configure
	src/widgets/styles/qwindowsxpstyle.cpp
	tests/auto/gui/kernel/qwindow/qwindow.pro
	tests/auto/gui/kernel/qwindow/tst_qwindow.cpp

Change-Id: I624b6d26abce9874c610c04954c1c45bc074bef3
2012-04-10 15:31:45 +02:00
Marcel Krems
a7ed81b557 Removed QApplication overloads used solely for documentation.
Also removed a define which was used only for this purpose.

This change brings the constructors in line with Q{Core,Gui}Application.

Change-Id: I1134ca5611453e8445c1a4f3226846621fa8872c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-04-09 12:54:29 +02:00
Giuseppe D'Angelo
4893a5422e New qHash algorithm for uchar/ushort arrays (QString, QByteArray, etc.)
Port of Robin's work from I0a53aa4581e25b351b9cb5033415b5163d05fe71
on top of the new qHash patches (the original commit just introduced
lots of conflicts, so I redid it from scratch).

This is based on the work done in the QHash benchmark over the past
few months experimenting with the performance of the string hashing
algorithm used by Java.

The Java algorithm, in turn, appears to have been based off a
variant of djb's work at http://cr.yp.to/cdb/cdb.txt.

This commit provides a performance boost of ~12-33% on the
QHash benchmark.

Unfortunately, the rcc test depends on QHash ordering.
Randomizing QHash or changing qHash will cause the test to fail
(see QTBUG-25078), so for now the testdata is changed as well.

Done-with: Robin Burchell
Change-Id: Ie05d8e21588d1b2d4bd555ef254e1eb101864b75
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-09 10:16:09 +02:00
Giuseppe D'Angelo
ddb70bee2f Stop relying on qHash always giving the same results
The implementation of the various qHash overloads offered by
Qt can change at any time for any reason
(speed, quality, security, ...).

Therefore, relying on the fact that qHash will always give
an identical result across Qt versions (... across different
processes, etc.), given identical input, is wrong.
Note that this also implies that one cannot rely on QHash
having a stable ordering (even without the random qHash seed).

For such use cases, one must use f.i. a private hash function
that will never change outside his own control.

This patch adds a private hash function for QStrings,
which is identical to the Qt(4) qHash(QString) implementation.
A couple of spots in Qt where the results of a qHash call were
actually saved on disk are ported to use the new function,
and a bit of documentation is added to QHash docs.

Change-Id: Ia3731ea26ac68649b535b95e9f36fbec3df693c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-08 21:44:26 +02:00
Giuseppe D'Angelo
ea17c21fd8 QHostAddress: improve qHash implementation
Avoid the conversion to a temporary QString -- just hash the address
as a byte array.

Change-Id: Ic35cdbbc3ee66c32a28d911bd27de0092395979f
Done-with: Shane Kearns
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-08 18:25:10 +02:00
Giuseppe D'Angelo
9166163f10 QUrl: added two-arguments qHash support
An unnecessary #include <QHash> was also removed, and other
includes refactored.

Change-Id: Ifcd3e37d75029c142a2e55ab492b88624505670a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-08 18:25:04 +02:00
Giuseppe D'Angelo
c3b9a67cf0 More qHash(T, uint) overloads for Qt types
The more we get in 5.0, the better.

Change-Id: If00084477709db4fc3f6b2e15024d046491be2ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-07 22:20:19 +02:00
Giuseppe D'Angelo
e6e4456de0 QFileSystemModel: fix sorting
When sorting a model recursively, the children of a QFileSystemNode
are extracted from their parent in a QHash order; then filtered,
then sorted (using a stable sort) depending on the sorting column.

This means that the order of the children comparing to equal for
the chosen sort are shown in the order they were picked from the
iteration on the QHash, which isn't reliable at all.

Moreover, the criteria used in QFileSystemModelSorter for sorting
are too loose: when sorting by any column but the name, if the result
is "equality", then the file names should be used to determine
the sort order.

This patch removes the stable sort in favour of a full sort,
and fixes the criteria of soring inside QFileSystemModelSorter.

Change-Id: Idd9aece22f2ebbe77ec40d372b43cde4c200ff38
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-04-07 19:45:39 +02:00
Thiago Macieira
7ae76153cb Remove -DQT_NO_STL from the bootstrapped builds
Change-Id: I37ea06426b66e617a49ec46952abdaad8814eadf
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-04-07 05:19:56 +02:00
Thiago Macieira
9dde45722b Remove references to QT_NO_STL from QtConcurrent
Same as with QtCore, remove the #ifdef and #ifndef and select the side
with STL.

Change-Id: If1440080328c7c51afe35f5944a19dafc4761ee5
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-04-07 05:19:50 +02:00
Thiago Macieira
6f51fee995 Remove references to QT_NO_STL from QtCore
QT_NO_STL is now no longer defined, so remove the conditionals and
select the STL side.

Change-Id: Ieedd248ae16e5a128b4ac287f850b3ebc8fb6181
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-04-07 05:19:42 +02:00
Giuseppe D'Angelo
1241a02a01 qHash: always use the seed in the catch-all template
This pertubates the results of the calls to the one-argument
version of qHash through the catch-all template.

Change-Id: I7037b25d545e6f1360384a83ff895f4bb62ed195
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-04-06 22:51:24 +02:00
Giuseppe D'Angelo
9ddb822a86 Add test for qHash(QByteArray)
Two equal QByteArrays must return the same hash.

Change-Id: Iddd45b0c420213ca2b82bbcb164367acb6104ec8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-06 15:16:40 +02:00
Giuseppe D'Angelo
10747da77d Add test for qHash(QString) / qHash(QStringRef)
Two equal strings / stringrefs must return the same hash.

Change-Id: I2af9a11ab721ca25f4039048a7e5f260e6ff0148
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-06 15:16:23 +02:00
Marcel Krems
4bdb7a0780 Fix compilation with MinGW.
Change-Id: I494c84e8e6889a7d7bb3b29669337483732d02c2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-05 23:54:37 +02:00
Giuseppe D'Angelo
538386f36f QLatin1String: add qHash overload
It was never introduced in Qt 4, probably because of the implicit
conversion to QString (that is, adding the qHash overload for
QLatin1String in Qt 4 would have been a BIC).

Change-Id: I2ebc8e73a85be497866820e0ca416dd11167bb53
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-05 20:48:53 +02:00
Shane Kearns
e5337ad1b1 Find libssl on linux using paths of loaded libraries
The installed path of libssl may include an element describing the
architecture, e.g. x86_64-linux-gnu or i386-linux-gnu.
In most cases, the libraries already loaded (static dependencies of
Qt, such as libc) will include the path where libssl is installed.

Use dl_iterate_phdr to find the paths. This is a linux specific
function, but it does provide "/lib/<arch>" and "/usr/lib/<arch>"
at the point ssl symbols are being resolved when running the
qsslsocket autotest (which has less dependencies than a typical
Qt app).

Task-number: QTBUG-24694
Change-Id: I9af8081f41bb85c2fcff450a2acda5672a7f7518
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
2012-04-05 15:37:53 +02:00
João Abecasis
2d89850b23 Enable variadic macros for MSVC >= 2005
Change-Id: I8793ea0f6e3a640276b073321d29373b2ed18d63
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-04-05 15:23:30 +02:00
Friedemann Kleint
76ae64abb5 Windows: Use native font engine by default.
Turn around the meaning of the command line parameter.
The FreeType engine can now be activated by passing freetype.

Change-Id: I9da6cd4a127603f9cfb91f0ce8450088c0883faa
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-04-05 12:46:31 +02:00
Pekka Vuorela
95c71cef20 Include with qt module to avoid configure warning
Change-Id: I8d338f22c4b0dabcca33878b33c6a203828d84c5
Reviewed-by: David Faure <faure@kde.org>
2012-04-05 10:18:41 +02:00
David Faure
4a11611c8a Fix unittest for QStandardPaths::enableTestMode
It was confusing DataLocation and GenericDataLocation, and the same
for CacheLocation and GenericCacheLocation. The test was passing in
the api_changes branch because these were giving the same result
(empty app name), but the QCoreApplication::applicationName fix in master
makes these different, so the bug in the test showed up after merging.

Change-Id: I80ef6883c96cfd02b8c277d9d686717028d396bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-05 10:15:21 +02:00
João Abecasis
b143a65728 Add zero-termination checks to QString and QByteArray tests
This uses an alternative approach to the testing formerly introduced
in 4ef5a626. Zero-termination tests are injected into all QCOMPARE/QTEST
invocations. This makes such testing more thorough and widespread, and
gets seamlessly extended by future tests.

It also fixes an issue uncovered by the test where using a past-the-end
position with QString::insert(pos, char), could move uninitialized data
and clobber the null-terminator.

Change-Id: I7392580245b419ee65c3ae6f261b6e851d66dd4f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-04-05 08:19:14 +02:00
João Abecasis
e1626bf038 Revert "Add tests to verify QByteArray's zero termination"
The approach used to verify for zero-termination is too intrusive and
requires additional maintenance work to ensure new zero-termination
tests are added with new functionality.

Zero-termination testing will be re-established in a subsequent commit.

This reverts commit 4ef5a6269c.

Change-Id: I862434a072f447f7f0c4bbf8f757ba216212db3c
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-04-05 08:19:03 +02:00