Commit Graph

8380 Commits

Author SHA1 Message Date
Simon Hausmann
22eb4bacae Enable QPluginLoader test for static builds
The majority of tests use QPluginLoader::setFileName implicitly, which
refuses to do any work in static builds. Therefore the majority of tests
are skipped. But in the future we'll get tests here that for example use
QPluginLoader::staticPlugins() and for that we want to include the
sub-directory in the build and test run.

Change-Id: Ib8ec274e22ac8050feaca8967eb8626b53876b92
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-03 20:26:58 +00:00
Thiago Macieira
6c8160b0dc QCborValue diagnostics: Properly escape strings
I'm intentionally not testing improperly-paired surrogates, since those
can't be encoded in CBOR.

Change-Id: I0d3cc366baaa49f3ad28fffd154240287ce34c22
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-08-03 20:26:42 +00:00
Ryan Chu
0eb1574b28 Disable Docker-based test servers on QEMU devices temporarily
Before libnss-mdns package is added to boot2qt dependency, the QEMU
devices should keep using the remote test server. There are two Linux
QEMU devices using 'linux-generic-g++' and 'linux-lmx7-g++' target
mkspec.

Relates to yocto/meta-boot2qt (Change-Id: I480f45)

Change-Id: I7870d3a184109e0abf712b4513148cf9a4520189
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-08-03 19:25:29 +00:00
Timur Pocheptsov
9f2a671560 Extend 'ignoreExpectedErrors' test
with a case when we fail to ignore/pre-set one of possible
verification errors.

Change-Id: I23b06243b61acef1ef3576c51529f3ef6601ba7d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-02 04:05:27 +00:00
Edward Welbourne
cf2d59bfe8 Merge "Merge branch '5.11' into dev" into refs/staging/dev 2018-07-31 11:34:23 +00:00
Edward Welbourne
23c9d4c98f Merge branch '5.11' into dev
Conflicts:
	qmake/library/qmakebuiltins.cpp
	src/plugins/platforms/windows/qwindowstabletsupport.h
	src/plugins/platforms/xcb/qxcbconnection.cpp
	src/plugins/platforms/xcb/qxcbconnection.h
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/plugins/platforms/xcb/qxcbwindow.cpp
	src/widgets/styles/qstylesheetstyle.cpp
	tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp

Done-With: Gatis Paeglis <gatis.paeglis@qt.io>
Change-Id: I000b0eb3cea2a5c7a99b95732bfdd41507cf916e
2018-07-31 13:33:14 +02:00
Timur Pocheptsov
5c7d2033e0 QDtls: respect pre-set verification errors
That's actually how ignoreVerificationErrors (and QSslSocket::ignoreSslErrors)
are used to set the expected/known verification errors before handshake.
Auto-test updated too.

Change-Id: I9c700302d81ddb383a4a750fafd594373fb38ace
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-07-31 11:20:53 +00:00
Oliver Wolff
3ed22c5efe tst_qsystemsemaphore: Use qt_test_helper functionality
Change-Id: I18a5d2d496e1442470423e0f05062cc2ae76a4e4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-07-31 05:27:08 +00:00
Oliver Wolff
8860c26260 tst_qobject: Use qt_test_helper functionality
Change-Id: I79949ffa82a98e0d3a71e2bf416a0bee321bf113
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-07-31 05:27:01 +00:00
Oliver Wolff
6be553a2c8 tst_qsharedmemory: Use qt_test_helper functionality
Change-Id: I70b92b8350822f6d627e5f267188bb7d1d2946d9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-07-31 05:26:59 +00:00
Tony Sarajärvi
27005d3352 Extend blacklistin of tst_QTimeLine tests to macOS 10.13
Task-number: QTBUG-61037
Change-Id: I709f15ccb1fb8bbfad8989923991f752fa22ae0a
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-07-31 05:02:32 +00:00
Tony Sarajärvi
4563dac19a Extend blacklisting of tst_QElapsedTimer::elapsed to cover macOS 10.13
Task-number: QTBUG-58713
Change-Id: I4465aeb245faf0d2e937c04b737c9a4768e662ee
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-07-31 05:02:30 +00:00
Tony Sarajärvi
1f605b62ad Extend blacklisting of showMinimizedKeepFocus to macOS 10.13
Task-number: QTQAINFRA-1359
Change-Id: I5d291dcbb41ce71ec85e238b29bb98d292538f9f
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-07-31 05:02:27 +00:00
Thiago Macieira
7cb5b324f0 QCborValue: move the toDiagnosticNotation() function to its own file
If we ever need to add QCborValue to the bootstrap library, it's
unlikely that we'll need this part. And by splitting it, I can make the
code handle more cases, that hadn't been properly handled before.

Change-Id: I2f630efbbce54f14bfa9fffd154160c0ad893695
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-07-30 16:21:12 +00:00
Edward Welbourne
f69a5857d1 canonicalFilePath: treat ENOTDIR as a case of file not existing
There is no such file, if one of the "directory" components of its
path is not, in fact, a directory.  Added a test for non-existent file
(specified to give empty canonical file path) as well as a test for a
file in a sub-directory of a known file.  The former incidentally
tests for QTBUG-29402, fixed long ago.

Change-Id: I60b80acc0f99f0a88cdb1c4d191af7384f3a31c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-30 15:05:29 +00:00
Edward Welbourne
a76a0afc1a Reduce redundancy and duplication in tst_QFile::appendAndRead
Use one QStringLiteral instead of repeating a QLatin1String(), that
was passed to a function that has to convert it to unicode; do the
conversion at compile-time.

Reducing i % 256 is fatuous when i ranges from 1 to 100.

A QFile will close() itself on destruction, no need to do it explicitly.
Especially when *not* close()ing the *other* QFile that was left open.

Change-Id: Idb39312d9c9beaf082b7cead574bc6bb9bb3a775
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-30 15:04:40 +00:00
Edward Welbourne
cb505bedde Actually truncate when asked to
On Unix, we wouldn't even *try* to truncate if the file was open for
appending.  The combination may be an eccentric choice but - at least
when it's combined with reading - I can imagine use-cases for it; and
we should (at least try to) deliver what we're asked for, even if we
can't think why anyone would want it.  So actually enable truncation
when asked to.

Amended some tests to check this works and corrected the QIODevice
documentation of mode flags (which misdescribed the special case that
implies Truncate).  Removed special-case code, to apply truncate when
writing but not reading, since it's been made redundant by the
pre-processing of mode done in QFSFileEngine::processOpenModeFlags().

[ChangeLog][QtCore][QFile] When opening a file, if Truncate is asked
for, or implied by other flags, it shall be attempted, regardless of
what other options are selected.  We previously did this on Windows;
now we do so also on Unix (even when appending).

Task-number: QTBUG-13470
Change-Id: I1e08d02cfbae102725fccbbc3aab5c7bf8830687
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-30 15:04:31 +00:00
Thiago Macieira
b0085dbeea QRandomGenerator: remove unnecessary cast to float in RandomValueFP
I don't know why I did that.

Change-Id: I20fd00e600264ff98c6afffd15410722b6d95a61
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2018-07-29 19:09:16 +00:00
Kai Koehne
bd0279c417 Logging: Accept .ini files written by QSettings
For keys, QSettings escapes all characters outside of [-a-zA-Z0-9_.]
by using percent encoding, and changes '/' to '\'. That is,

  settings.setValue("qt.*", true)

will be written to an .ini file as

  qt.%2A=true

This means that QSettings can not be used to write general-purpose
qtlogging.ini files. Fix this by applying the reverse transformation
method from QSettings when reading in the .ini file.

[ChangeLog][Logging] Qt will now accept qtlogging.ini files
written by QSettings.

Task-number: QTBUG-69548
Change-Id: I55b7a8b433291268dc6855901f72b1c04f8ee6d3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-28 14:43:40 +00:00
David Faure
ce4407c327 QSFPM unittest: check dataChanged and layoutChanged signals
I'm not sure why QSFPM purposefully emits dataChanged for a source
dataChanged that triggers a layoutChanged (i.e. due to sorting, multiple
rows are moving around). (This predates the git import in Qt 4.5.)
Surely whoever is listening will not gain much from the "small" dataChanged
after the "big" layoutChanged... anyhow, this documents the current behavior,
at least.
It also proves that the bug I saw long ago (changing a filtered-out
value used to emit dataChanged(invalid, invalid), IIRC) is no longer present.

Change-Id: I8975c549db88226b2b3393de9f8dca4f4109df15
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-07-28 12:26:41 +00:00
Robbert Proost
8a450f570b QUrl: Support IPv6 addresses with zone id
Task-number: QTBUG-25550
Change-Id: I37ec02b655abe2779aa11945e20550ce00e43723
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-27 21:20:29 +00:00
Ryan Chu
3f80783b11 Rework QNetworkReply tests to use docker-based test servers
This change frees the tests of their dependence on the Qt internal test
server (qt-test-server.qt-test-net). It makes the developers run the
tests out of Qt testing infrastructure.

If the user has installed Docker engine on their host, the test servers
will be built up inside separate Docker containers, and then, the test
case goes with the Docker-based test servers. Otherwise, the test case
will keep using the Qt internal test server.

Task-number: QTQAINFRA-1686
Change-Id: I518bc3675bfd658938509744b0e7e0610bc8bf66
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-07-27 17:40:27 +00:00
Timur Pocheptsov
8948491eda QDtls - use conventional names
More Qt-style and more natural, also, shorter names.

Change-Id: I97bd68a8614126d518a3853027661435dc4e080d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-07-27 11:53:28 +00:00
Oliver Wolff
2e88340ad2 tst_qpluginloader: Fix preprocessor condition
Change-Id: Icb7767cb6b0e091a21196518d3908a810970592a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-07-27 04:48:30 +00:00
Allan Sandfeld Jensen
9ce4006565 Fix moc'ing of enum class flags
Keep the original class name around for a little longer so we can
generate the correct scoped enum in the moc output.

Task-number: QTBUG-47652
Change-Id: Ib5934316fa786cc475335b03c86b8ec2dc239055
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-07-26 22:14:56 +00:00
Allan Sandfeld Jensen
89f784757e Improve output of Q_ENUM
When we have the named keys and not just integer values, we can output
something unambiously that closer match how the enums should be used.

Output of enums without proper metadata is left unchanged

Before:
QSurfaceFormat::ColorSpace(DefaultColorSpace)
QPainter::CompositionMode(3)

After:
QSurfaceFormat::DefaultColorSpace
QPainter::CompositionMode(3)

Change-Id: I537e879ba8b5c555b2aae9ba831facc88d430443
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-07-26 22:14:42 +00:00
Edward Welbourne
0b688e2955 Check against copying the husk left by a move
The copy-assign operator tests against other.d being NULL but the
copy-constructor didn't.  This can only matter if the value being
copied has been moved from, so we could probably replace with an
assertion in practice, but we should at least be consistent.

Amended test to check this case too; and verified new test crashes
without this fix.

Change-Id: I46872a677775944bbdf6a9112e719873e574ae60
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-26 16:35:59 +00:00
Timur Pocheptsov
056fbf03a5 QDtls - refactor
This patch renames rather awkward 'remote' into more conventional
'peer' (similar to what we have in QAbstractSocket).

Change-Id: Ifc45e538b8adf9cc076bd7aee693277829fd94dc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-07-26 15:13:57 +00:00
Oliver Wolff
a5d8f00b3b tst_qplugin: Re-enable loadReleasePlugin test case
Change-Id: I678a8748ac757ae2918dd80e4a6d802d7de7b0b0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-07-26 14:26:42 +00:00
Oliver Wolff
b6597c8b7b Skip qplugin auto test for static configurations
All test cases use QPluginLoader which will not work for static builds of
Qt.

Change-Id: I7dcddcd5213681bd3ae4cd85e49ee0bb5748f687
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-07-26 14:26:36 +00:00
Oliver Wolff
eed8141a7c Fix compilation of tst_QGraphicsItem in Visual Studio
Visual Studio complained about the usage of a potentially uninitialized
variable which made compilation fail.

Change-Id: I0bc9d1e47d3b00b047912164c3bc4197a2058f85
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-07-26 06:45:49 +00:00
Thiago Macieira
9a04453b50 Fix the fix for mmap() overflow check
The code I introduced in 4ee7425794 only
dealt with systems that reasonably used a 64-bit off_t parameter. Turns
out that we don't turn on largefile support on 32-bit Android, which
meant that the fix caused a regression.

[ChangeLog][QtCore][QFile] Fixed a regression that caused QFile::map()
to succeed or produce incorrect results when trying to map a file at an
offset beyond 4 GB on 32-bit Android systems and on some special Linux
configurations.

Task-number: QTBUG-69148
Change-Id: I2c133120577fa12a32d444488bac3e341966f8d7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-07-25 12:40:04 +00:00
Oliver Wolff
41ed77e59b tst_qtextcodec: Use qt_test_helper functionality
The helper application is only needed for Unix platforms, so there is no
need to build it for other configurations.

Change-Id: I4ebb896c66d3ded016f72fdbe631ec2f1276db22
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-07-25 10:27:42 +00:00
Edward Welbourne
dcd35d13e0 Rework the start-of-time fileTimes() test to add another test-case
Turned it into a data-driven test, with the old start-of-time as one
row, in order to add a regression test for an alleged MS API bug in
Windows XP.

Task-number: QTBUG-12006
Change-Id: I632ecc854f50f4183a990c8a27826ede9bd20e55
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-25 09:21:42 +00:00
Edward Welbourne
09f254fcc0 Fix two "unused variable" warnings
Change-Id: Iafced3ffcc24303a1034805b46eb49bd076d1e79
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-25 09:09:29 +00:00
Jędrzej Nowacki
6970d4048f tst_QCommandLineParser: Add missing QVERIFY
QCommandLineParser::addOption returns false in case of an error.
Tests should check it.

Change-Id: I3507e1c236a15a7c0a77c0c80f8dba65b664a535
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-07-25 07:26:45 +00:00
Mikhail Svetkin
d1dcc4d8cd corelib/tools: add qMakeArray() API
This function can be used to create std::array without the need
to explicitly provide the size of array. It also has a specialization
that allow to generate sorted array at compile time. Sorted array can
be beneficial for example in binary search.

Change-Id: Ifc7e06e451812fce2ab94293959db5e9cc038793
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-07-25 06:57:44 +00:00
Oliver Wolff
92c5f3fb7b Add qt_test_helper feature
To avoid (even more) duplicated code, "qt_test_helper" ensures the
policy of putting a test's helper application next to the test's
own executable.
The helper executable is suffixed with "_helper" to avoid name
clashes with its folder.

Change-Id: Ic50cb1daa257e7ffc75440c10a3b90fd39424683
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-07-25 05:17:47 +00:00
Eirik Aavitsland
731538fdd4 Add API for reading and decoding graphical texture files
Add a framework for reading and decoding stored graphical texture file
formats. Includes decoders for the PKM and KTX formats.

This is basically the same texture file reading that was added to
qtdeclarative for 5.11, but has been refactored to be independent of
the scenegraph and opengl.

Task-number: QTBUG-67026
Change-Id: I87d8117550d8a2112f4f58c03e9ac6b3249cbc5a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-07-24 16:46:05 +00:00
Eirik Aavitsland
1ed0b2170d Give the QGradient presets ObjectMode coordinate mode by default
ObjectBoundingMode has inconsistent behavior and is deprecated in
favor of ObjectMode.

Change-Id: I748f6283f3db5869bb9a67c08bf5f16abc6f95b0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-07-24 16:45:53 +00:00
Joni Jantti
549abf9e6a Blacklist tst_Gestures::graphicsView on Ubuntu 18.04
This autotest fails on the new Ubuntu 18.04 platform.

Task-number: QTBUG-69599
Change-Id: I575e6f52a539e03ab37ca62e580889854ddb9781
Reviewed-by: Simo Fält <simo.falt@qt.io>
2018-07-24 15:32:20 +00:00
Joni Jantti
05ddbacf6c Blacklist tst_QWidget_window::setWindowState
This autotest fails on the new Ubuntu 18.04 platform.

Task-number: QTBUG-68864
Change-Id: I799defcec3a41d86a604bfcd4c2e1081ae4e0e53
Reviewed-by: Simo Fält <simo.falt@qt.io>
2018-07-24 15:32:13 +00:00
Joni Jantti
d2015b4d06 Blacklist tst_QWidget_window::tst_resize_count
This autotest fails on the new Ubuntu 18.04 platform.

Change-Id: I815e36f7a099ca4c83767c7a1adb0f87f5bff7b5
Reviewed-by: Simo Fält <simo.falt@qt.io>
2018-07-24 15:32:07 +00:00
Joni Jäntti
28cdd1b497 Revert "Blacklist tst_QWidget_window::setWindowState"
Wrong test was blacklisted for this commit.

This reverts commit 85607bd70d.

Change-Id: Ica5272799afec88c05e2cd137835bcdcb587836e
Reviewed-by: Simo Fält <simo.falt@qt.io>
2018-07-24 15:32:00 +00:00
Richard Weickelt
f8c15fe63c Fix wrong relative path to qdbus_symbols.cpp
Commit d743df975d broke tst_qdbusinterface
when not using dbus-linked config option.

Change-Id: Iae5725ac781151e3a3d70032d6530bf4363daafa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-24 04:24:31 +00:00
Edward Welbourne
27f1f84c1c Let QDir::absoluteFilePath() use isAbsolutePath() for resource paths
Using QFileSystemEntry::isAbsolute() broke handling of resource paths.
Extended QDir::absoluteFilePath() tests to cover absolute resource path
and some UNC variants also resolved in the same fix.
Amend existing filePath tests to use drives where needed.

Task-number: QTBUG-68337
Change-Id: I4f02cf67828ad93e562857118f8442037f18bab7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-23 14:28:38 +00:00
Sérgio Martins
9229452e57 Introduce QScopeGuard
A RAII style class which calls a function at end of scope.

Example usage:
    auto cleanup = qScopeGuard([] { <my cleanup code> ; });

[ChangeLog][QtCore] Introduced QScopeGuard.

Task-number: QTBUG-62894
Change-Id: Ife67f5c76255a1fafbae03367263da0bac9a0070
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-07-21 17:47:35 +00:00
Friedemann Kleint
189e40e11e Add QTextStream operators for QStringView
Change-Id: I72d597fa21521a04b7f7c0e41bd45ee9dabb6222
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-20 20:51:08 +00:00
Joni Jäntti
588fcde580 Revert "Blacklist tst_QThread::create"
The "boot2qt" platform needs to be blacklisted,
not "ubuntu-18.04".

This reverts commit 0d49ac0ffc.

Change-Id: I768a66c56f5fc7e0771473152579ed1c01bbbdb9
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2018-07-20 07:00:29 +00:00
Oswald Buddenhagen
99c3ef0789 prune cargo-culted and obsolete winsock deps from autotests
Change-Id: I9666598d34e965d7058aeb2b2e7fb3f59600675c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-07-19 13:31:08 +00:00