Commit Graph

4372 Commits

Author SHA1 Message Date
Friedemann Kleint
22ec4ed866 QPrintDialog manual test: Break endless loop for invalid DPI.
Change-Id: I8684f144e27392f834f91adef17826b77de60b93
Reviewed-by: John Layt <jlayt@kde.org>
2014-01-28 13:41:10 +01:00
Friedemann Kleint
0841a5e367 tst_qcolumnview: Set layout direction on widgets instead of application.
Most of the test is executed in RTL mode since it is never restored.

Task-number: QTBUG-36395
Change-Id: I110966085a5a265f093fc4479eebc1f1bf0614c1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-01-28 08:27:53 +01:00
Friedemann Kleint
b7de9e7353 Use a fake directory model instead of QDirModel in item view tests.
The tests then have a predictable, stable environment and do not depend
on file system operations.

Task-number: QTBUG-23697
Change-Id: Ibbd356f8bd7419ec4a3a88d2c0b5cd0830049790
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-27 15:40:17 +01:00
Bastiaan Veelo
9ac20dc44c tst_qmdisubwindow: WindowCloseButtonHint is a standard window flag, too
Implemented that way in src/widgets/widgets/qmdisubwindow.cpp:2081.

Change-Id: I82fdf0c04f1655a130c5e6a6f1e23d325d546ab3
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-01-27 15:40:17 +01:00
Kai Koehne
7d782d4cf9 Fix QArrayData check
The support for QArrayData variadic arguments without C++11 for GCC
has been removed in commit 69478da0f0 . Change the autotest to reflect
that, too.

Change-Id: I40468f5d67cb2db553fd7a7d5b604f46403ac538
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-26 20:03:34 +01:00
Friedemann Kleint
cff2b83b10 Fix MSVC 64bit warnings about int64 truncation in tests.
Change-Id: Ic98090dbc7e320df652a60fc67a5291c60f7796a
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-01-24 22:06:15 +01:00
Friedemann Kleint
1fb42377a2 Fix MSVC-warnings about double to float truncation.
Change-Id: I4aef12bd8fe37dffb06fc7d0b6a330bfc42fa270
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-01-24 20:26:39 +01:00
Friedemann Kleint
0d95f7c0be Fix crash of tst_qaccessibilitylinux when DBus is not available.
Change-Id: I32291e4c6a5b228b42a7ec15f1dbfe4302bd31fa
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-24 11:30:58 +01:00
Allan Sandfeld Jensen
c695543f76 Ref qualified version of QImage::convertToFormat
Add ref qualified versions of QImage::convertToFormat, so that a
temporary QImage can be converted in-place to a format of equal depth.

[ChangeLog][QtGui][QImage]Added rvalue qualified convertToFormat method
for in-place conversion

Change-Id: I2eed5ffd63f5aea4ffa1147bf7607b02a49d9c5d
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-01-23 18:20:49 +01:00
Thiago Macieira
ea8e48a679 Update the qHash function for strings to use the CRC32 instruction
According to my profiling of Qt Creator, qHash and the SHA-1 calculation
are the hottest spots remaining in QtCore. The current qHash function is
not really vectorizable. We could come up with a different algorithm
that is more SIMD-friendly, but since we have the CRC32 instruction that
can read 32- and 64-bit entities, we're set.

This commit also updates the benchmark for QHash and benchmarks both
the hashing function itself and the QHash class. The updated
benchmarks for the CRC32 on my machine shows that the hashing function
is *always* improved, but the hashing isn't always. In particular, the
current algorithm is better for the "numbers" case, for which the data
sample differs in very few bits. The new code is 33% slower for that
particular case.

On average, the improvement (including the "numbers" case) is:

 compared to          qHash only          QHash
Qt 5.0 function          2.54x            1.06x
Qt 4.x function          4.34x            1.34x
Java function            2.71x            1.11x

Test machine: Sandybridge Core i7-2620M @ 2.66 GHz with turbo disabled
for the benchmarks

Change-Id: Ia80b98c0e20d785816f7a7f6ddf40b4b302c7297
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-23 01:06:34 +01:00
Tor Arne Vestbø
b2f8a70890 iOS: Enable building of basic tests
Allows us to sanity check the iOS build in the CI.

Change-Id: I16f9bfafef3988dcab6efd3155503ca0d0b4d1d8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-01-22 12:35:17 +01:00
Jędrzej Nowacki
9a9e7a8215 Fix lack of deterministic behavior in moc.
Moc should check full scope of any related objects or
gadget when it constructs extra data.

Change-Id: Ibd1b607a389cd4e788c0916984464cd9103d9c59
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-01-22 08:27:50 +01:00
Frederik Gladhorn
46791c08e1 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-01-21 17:57:54 +01:00
Kai Koehne
b8a38a6737 Allow printf style for qCDebug, qCWarning, qCCritical macros
Add support for using qCDebug and friends in the 'printf style' way.
This allows an almost mechanical conversion of existing qDebug, qWarning,
qCritical macros, and allows avoiding the size overhead the streaming
style incurs (mostly due to inlined QDebug code).

To handle this gracefully we require variadic macros (part of
C++11/C99). For compilers not supporting variadic macros we fall back
to checking the category in QMessageLogger.

[ChangeLog][QtCore][Logging] Allow qCDebug macros to be used in a printf
style.

Change-Id: I5a8fb135dca504e1d621bb67bf4b2a50c73d41b9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-21 14:58:03 +01:00
Friedemann Kleint
afe3902a30 Testlib: Use QString for messages in QAbstractTestLogger::addMessage()
Task-number: QTBUG-35743

[ChangeLog][QtTest][Windows] Use correct UTF-8 encoding for XML test results on platforms with different console encoding.
Change-Id: Ice9d03192098f931e5dac358928e0c4421ab715e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-21 06:28:23 +01:00
Richard J. Moore
5c19fad8c1 Ensure weak ciphers are not part of the default SSL configuration.
Any cipher that is < 128 bits is excluded from the default SSL
configuration. These ciphers are still included in the list
of availableCiphers() and can be used by applications if required.
Calling QSslSocket::setDefaultCiphers(QSslSocket::availableCiphers())
will restore the old behavior.

Note that in doing so I spotted that calling defaultCiphers() before
doing other actions with SSL had an existing bug that I've addressed
as part of the change.

[ChangeLog][Important Behavior Changes] The default set of
ciphers used by QSslSocket has been changed to exclude ciphers that are
using key lengths smaller than 128 bits. These ciphers are still available
and can be enabled by applications if required.

Change-Id: If2241dda67b624e5febf788efa1369f38c6b1dba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-21 03:41:34 +01:00
Frederik Gladhorn
9033977d39 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/corelib/global/qglobal.h
	src/corelib/tools/qstring.cpp
	src/gui/image/image.pri
	src/gui/image/qimage.cpp
	src/plugins/platforms/cocoa/qcocoawindow.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
	tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp

Change-Id: I3b9ba029c8f2263b011f204fdf68c3231c6d4ce5
2014-01-20 18:18:59 +01:00
Jędrzej Nowacki
260b0b4ed6 Rename a test class to a bit more verbose name.
That way we can avoid name conflict with a namespace defined in
a different moc test

Change-Id: Id631d7c5556c9d6940e16dc53eb438dbcd0095eb
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-01-20 17:08:28 +01:00
Jędrzej Nowacki
71d265f592 Add missing header guards
Change-Id: I515313289c0a4af0f675131760ad4ccd0c6e6149
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-01-20 17:08:24 +01:00
Christian Kandeler
bbee8ca485 Fix warning in QVariant test.
Values from different enums were compared.

Change-Id: I2faf73976e4b24abbdc915e8445256fe7a5be5bd
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-01-20 14:58:48 +01:00
Bartosz Brachaczek
7ffce3fb0b Fix cd(), cdUp() QDir member functions docs regarding nonreadable dirs
The documentation implies that cd() and cdUp() functions return false if
the new directory is not readable, but that is not the case. It is an
obvious mistake in the documentation, because cd'ing into a nonreadable
directory is perfectly valid.

Provided also with a test to verify that cd() actually returns true with
nonreadable directories.

Change-Id: I4aa3e859b35c64266df510a203574e3701aea77c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-20 12:20:45 +01:00
Volker Krause
ec77f93b38 Fix crash when constructing a QVector with an empty initializer list.
Data::allocate(0) returns a pointer to read-only memory, updating d->size
will segfault. The safety check for this exists in all other QVector ctors
already.

Change-Id: Ida0fe4182de56ee62c7f91e8652cfafbfd7b8410
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-18 11:16:40 +01:00
Friedemann Kleint
ab2c90cc52 Introduce function for standard button texts to QPlatformTheme.
Change-Id: I91eec04a95b5047d893490a70152237b2991f662
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-01-18 09:23:38 +01:00
Friedemann Kleint
d5912b2a47 Testlib/generate_expected_output.py: Fix encoding.
Do not apply additional encoding when reading process output.
Fixes errors when encountering UTF-8:

Traceback (most recent call last):
  File "./generate_expected_output.py", line 117, in <module>
    generateTestData(path)
  File "./generate_expected_output.py", line 106, in generateTestData
    out.write(data.decode('utf-8'))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xdc' in position 5485: ordinal not in range(128)

Change-Id: Ib827787a59a18b4d3d0601645856517f43c01fc3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-18 09:20:24 +01:00
Friedemann Kleint
f504287e80 Testlib/generate_expected_output.py: Pass tests as command line arguments.
Evaluate command line arguments and use directories only when empty.

Change-Id: I818ec13c686018a3f607e91174e57d8f8bbf15f7
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-18 09:19:38 +01:00
Andrew Knight
603eac2dfb d3dcompiler_qt: Place compiler options in the shader file name
The compiler service needs to know what options to pass to the compiler,
and these options can affect the outcome of the shader blob. Runtime
compiled shader output must match this file name in the binary directory.
Pre-compiled shader blobs (e.g. those placed in a resource file) are
permitted to drop options from the file name if the implementor can
ensure the blob is compatible with the target.

Defines are not written out as options, but written into the shader
source, and therefore affect the cache key.

Change-Id: I11e4a43fcf6818ddb29aca5eba3d8647ba4021a1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-01-18 04:39:19 +01:00
Frederik Gladhorn
a69525243f Update test result generator script to set duration to 0
The actual code in testlib now indents the duration tag when it is for a
function.

Change-Id: Iee62db9c81f11dc54e57f166bf9fb2b7012b7e03
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-01-18 04:39:17 +01:00
Kai Koehne
278152fffd Replace win32-g++ with mingw scope
Commit 773dd01 introduced a general mingw platform scope, which
is cleaner and more flexible than matching the spec name.

Change-Id: Ie3a9cb791a83f7c8a51bc4e23069190c452ab521
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-17 12:08:24 +01:00
Olivier Goffart
e59b28e08e QObject: fix connection to function pointer with non-copyable references argument
For example, QObject is non copyable (its copy constructor is deleted or
private via Q_DISABLE_COPY). It should still be allowed to pass a reference
to a QObject as an argument to as signal (or slot).
This fixes a compilation failure.

Task-number: QTBUG-36119
Change-Id: I9bcf477e347d69fdae2543c99781b6421883be78
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-17 11:25:31 +01:00
Tor Arne Vestbø
04b8af2739 iOS: Fix compilation of some basic tests
The tests themselves may not actually pass, but it's a start, and allows
us to sanity-build a few things in the CI that actually produces a final
binary.

Change-Id: I02643b6ffa1522de1a7d17d737c8ab45ffac6a93
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-01-17 11:04:43 +01:00
Olivier Goffart
55659fb5a4 moc: Fix parsing of complex defines defined via command line
Since now in Qt5 the moc does full macro substitution, it needs to handle
the defines passed is command argument, even if they span over multiple
tokens, or if they do not have any token.

Example:
 moc '-DCOMPLEX=QVector<int>' '-DEMPTY=' foo.h

[ChangeLog][moc] Fixed passing -D of a macro defined to something more
complex than a single identifier.

Task-number: QTBUG-33668
Change-Id: Ie8131de215f1659a24af4778d52ee40cda19759f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-01-17 01:36:37 +01:00
Richard J. Moore
7c8131763d Prevent spurious SSL errors from local certificates.
Qt since approximately 4.4 has set the verify callback on both the SSL
store and the SSL context. Only the latter is actually needed. This is
normally not a problem, but openssl prior to 1.0.2 uses the verify
code to find the intermediate certificates for any local certificate
that has been set which can lead to verification errors for the local
certificate to be emitted.

Task-number: QTBUG-33228
Task-number: QTBUG-7200
Task-number: QTBUG-24234
Change-Id: Ie4115e7f7faa1267ea9b807c01b1ed6604c4a16c
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-16 21:57:06 +01:00
Matt Broadstone
d6d7624796 Added constructor to QJsonValue for const char *
For convenience, it reads more easily (and is somewhat expected) to
be able to add a string to a QJsonArray like you might with a
QVariantList: QJsonArray() << "string". Previously, QJsonValue provided
a private void* ctor to explicitly deny this case because it would
implicitly convert to a boolean. This ctor provides a const char* ctor
(much like QVariant) that interprets the incoming text as utf8 and
creates a String type QJsonValue.

[ChangeLog][QtCore][QJsonValue] Added constructor to QJsonValue for const char *

Change-Id: Icafa954d3da1fb264f9d0fd7cd1a1d2fbbe15095
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-01-16 21:49:26 +01:00
Matt Broadstone
13806e6787 Added convenience methods to QJsonArray for appending QJsonValues
operators for +, +=, and << were added to QJsonArray to make
it easier to work with, and more closely resemble the Qt
container classes

[ChangeLog][QtCore][QJsonArray] Added convenience methods to QJsonArray for appending QJsonValues

Change-Id: I96e0a43015f7c0f980cbbef7f20bd2085ee04795
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-01-16 21:49:18 +01:00
Sergio Ahumada
73b5a5cdd5 test: Don't build qmimedatabase-cache for QNX
update-mime-database does not exist, so there is no point in
trying to build this test.

Change-Id: Id60f2f8fc3af33d3f7ae2fb4f1042356b60f6596
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Wolfgang Bremer <wbremer@blackberry.com>
2014-01-16 16:11:04 +01:00
Christian Strømme
aa7ec3cdf5 Android: QStandardPaths implementation
Adds standard paths implementation for Android.

[ChangeLog][QtCore][QStandardPaths] Added
QStandardPaths implementation for Android.

Task-number: QTBUG-34631

Change-Id: I38673204a521a990438470c4e165105a2b02b7ad
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-01-16 02:38:11 +01:00
Peter Hartmann
e746aa6e93 network tests: add manual test for uploading images to Facebook
... to have a real world test case for uploading via SSL,
QHttpMultiPart (+ resetting) etc.

Change-Id: I004dd6f2507776b2fb8ebe1f02625b40abff6261
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-01-15 21:32:41 +01:00
Joerg Bornemann
5ca6039b77 remove qt_windows.h from qwinoverlappedionotifier_p.h
Preparation for making QWinOverlappedIoNotifier public.

Change-Id: Id443514a134b5c13e64d4d89450a7912ab38d40f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-01-15 18:43:20 +01:00
Sergio Ahumada
fa907401e9 test: tst_qhttpsocketengine requires `private_tests' set
Otherwise you get:

  undefined reference to `vtable for QAbstractSocketEngine'

when -developer-build is not used.

Change-Id: I444140736a6bf736894dc12a20f6a4d48af2678e
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-01-15 16:18:47 +01:00
Sergio Ahumada
f15d730589 test: tst_qhostinfo requires `private_tests' set
Otherwise you get:

  undefined reference to `qt_qhostinfo_clear_cache()'

Change-Id: I32313f290b9e4236440ae01afe12285d4539be60
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-01-15 16:18:44 +01:00
Friedemann Kleint
122ae7142b Stabilize tst_scrollbar.
- Use a separate widget for each test.
- Replace hard-coded timeouts by qWaitForWindowExposed.
- Center windows on screen.

Change-Id: I45ae306fd23348ee5dec3849e64ec98843e8bf32
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-14 22:33:19 +01:00
Konstantin Ritt
edfce46a6c Update the Unicode Data and Algorithms up to Unicode 6.3.0
* Mongolian and Phags-pa characters have been given a Joining_Type
  classification for contextual shaping. As a part of these additions,
  one Phags-pa character has the Joining_Type value of L (Left Joining),
  which no character had been assigned before.
* The unassigned code points in the Currency Symbols block have been
  given the Bidi_Class property value ET and the Line_Break property
  value PR, to help implementations support new currency symbols,
  when they are encoded.
* Hebrew letters and basic punctuation marks have been assigned
  the newly introduced Word_Break property values Hebrew_Letter,
  Single_Quote, and Double_Quote.
* The Bidi_Class property has been extended with four new values
  for directional isolates.
For more details, see http://www.unicode.org/versions/Unicode6.3.0/

Change-Id: Iad62d02edc58a8497898dcd6d6c70d5aece317ea
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-01-14 15:38:57 +01:00
Konstantin Ritt
a6046be428 Update UCD source files up to Unicode 6.3.0
Change-Id: I9ab58a659af1e758b172a24aa95bce1fea89c33d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-01-14 15:38:43 +01:00
Oswald Buddenhagen
882bf3475c expand tabs and related whitespace fixes in *.{cpp,h,qdoc}
the diff -w for this commit is empty.

Started-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-13 22:46:50 +01:00
Konstantin Ritt
4f8f0f16d0 Update the internal CLDR tables up to v.24
Change-Id: I9c0b110e36dd80c6a0b7275aa13bc548419aca9c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: John Layt <jlayt@kde.org>
Reviewed-by: Mehdi Fekari <mfekari@blackberry.com>
2014-01-13 19:02:10 +01:00
Frederik Gladhorn
019588f307 Testlib: Add test duration to xml output
[ChangeLog][QtTest] Added test duration to xml output.
When running tests with xml output a new tag of the form
<duration msecs="123"/> is added to each test function and the test as a
whole.

Change-Id: Ibc4db066b6acf5fac6c578f5e5ca5ce4b5d8ea8e
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2014-01-13 07:13:17 +01:00
John Layt
684ebc6648 QDate - Fix parsing Qt::ISODate
Fix parsing of ISO Date from being totally lenient to being semi-strict
by requiring the separator positions to be non-numeric.

[ChangeLog][Important Behavior Changes] Parsing of Qt::ISODate by
QDate::fromString() and QDateTime()::fromString() is not as lenient as
before, the date component separators are now required to be
non-numeric.  This means a string like "2000901901" will no longer be
recognized as a valid ISO Date, but "2000/01/01" will still be even
though it doesn't strictly meet the ISO format of "2000-01-01".

Task-number: QTBUG-34141
Change-Id: I0e481144136c60d4cac61364b9b2c1d2cd1e78fc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-11 20:45:22 +01:00
John Layt
a41a5f6671 QDateTime - Fix isValid() if invalid QTimeZone
Explicitly check that the QTimeZone is valid before trying to use it.

Change-Id: Iec415a2cb07071502fe71ee5ac92a7657e818f99
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-11 20:45:22 +01:00
Frederik Gladhorn
7917dfbf1c Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I99af0bef7f1c931533a324ebcfb27c40ee871a5e
2014-01-10 18:27:49 +01:00
Peter Hartmann
6fd205d579 network proxy tests: adapt proxy authentication to new server
The tests pass with the new test server image. Once we are using the
new test server we can remove the test for the host not found error.

Change-Id: Iac8ba6d8ce31b0865b33a003086aac0339afe338
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-01-10 17:14:29 +01:00