Commit Graph

13470 Commits

Author SHA1 Message Date
Jani Heikkinen
283e29e539 Revert "Android: fix Android assets handler not listing dirs with only sub dirs"
This reverts commit 89f89cedc0.

Reason for revert: QTBUG-107879

Task-number: QTBUG-107627
Fixes: QTBUG-107879
Change-Id: I31ceec5156837281b25fd17024c01e3477550ce0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-10-25 13:38:46 +00:00
Harald Sitter
75e8754875 a11y: support GetAccessibleId for at-spi
This introduces a new helper function accessibleIdForAccessible
(inspired by Windows' automationIdForAccessible) to synthesize an id out
of the objectNames of the accessible parent chain. The id is then
exposed via the GetAccessibleId D-Bus function for consumption in a11y
tools.

Change-Id: If72b86c5864c43f4ca842aa11423dd8aea0dde4a
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
2022-10-25 15:19:41 +02:00
Christian Ehrlicher
05ec29f76c SQL/Tests: fix tst_qsqldatabase::caseSensivity() for MySQL on linux
MySQL has a different default setting for case sensitive table names on
linux and windows which makes the test fail on linux but work on
windows when using the database with the default settings. Read out the
respecitive setting so the test will pass every time.

Change-Id: I8651858d47652022ddc4b6386a6153cf70c6fed6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-10-24 19:08:17 +00:00
Shawn Rutledge
c3e2a624fb QApplication: send QHoverEvents with correct scenePosition()
The QHoverEvent ctor takes two points: pos and globalPos; pos is then
passed as both the scene and global pos to the QSinglePointEvent ctor,
which calls QMutableEventPoint::setScenePosition() on the persistent
QEventPoint instance and then detaches befeore setting ephemeral state.
Therefore, we must construct QHoverEvent with scene position first, not
local position, so that the right value is persisted; it's better to set
local position after the detach(), whereas it's too late to fix the
persistent point then.

Pick-to: 6.4
Fixes: QTBUG-106918
Change-Id: I45726a9ec05bba2fe0cde6f5fb87c269105caca6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-10-23 09:28:45 +02:00
Peter Varga
55449a6528 Fix bool comparison in tst_qopenglwidget.cpp
This commit amends 1ea73bc29b

Pick-to: 6.2 6.3 6.4
Change-Id: I02000f86ff030ad369ccef1d4488ad22558eb974
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-10-23 00:14:15 +02:00
Peter Varga
600752aa97 Set alphaBufferSize to -1 when disabling translucency in QtWidgets
-1 is the default value for QSurfaceFormat::alphaBufferSize. Changing it
to 0 may result an unexpected pixel format change by ARB OpenGL
extension.

Pick-to: 6.4
Fixes: QTBUG-107629
Change-Id: Ia6a1b90fba6c43b6872b406f4fd946d937135cf8
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-10-21 19:11:51 +02:00
Maxime Roussin-Bélanger
3f8e3c3335 dbus: use same type of matching quotes
There is no reason to use different style of quotes when printing
messages.

Change-Id: I7d513ec04c803702974054569d28f26947942fbf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-21 12:02:34 -04:00
Assam Boudjelthia
89f89cedc0 Android: fix Android assets handler not listing dirs with only sub dirs
Amends edd983071e.

Remove redundant calls to AAssetDir_getNextFileName() in
AndroidAbstractFileEngine::setFileName(). It's enough to check
if AAssetManager_open() returns null and AAssetManager_openDir() is
valid for the provided asset file name.

As part of this fix, add some unit tests to cover/ensure assets
listing/iterating works as expected.

Fixes: QTBUG-107627
Pick-to: 6.4 6.2 5.15
Change-Id: I37ae9cb64fbbc60699bb748895f77fd6a34fae1f
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-10-21 16:54:29 +03:00
Liang Qi
63cfab628a tests: skip tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget() on Wayland
QWindow::requestActivate() is not supported.

This function crashed very often in ci/coin when system is busy.

Task-number: QTBUG-107153
Pick-to: 6.4 6.2
Change-Id: I82523080db40bddce9c9dc000433117d8ef74847
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-10-21 13:58:19 +02:00
Liang Qi
d8c078c2b6 tests: skip tst_QGraphicsProxyWidget::scrollUpdate() on Wayland
QWindow::requestActivate() is not supported.

This function failed in test vm in coin manually very often.

Task-number: QTBUG-107153
Pick-to: 6.4 6.2
Change-Id: I013651b0e5e7618c29742effd85a091ca95a7414
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-10-21 13:58:19 +02:00
Luca Di Sera
e2fef733be Replace usages of Q_CLANG_QDOC with Q_QDOC
To allow the user to customize the C++ code that QDoc sees, so as to be
able to work-around some limitations on QDoc itself, QDoc defines two
symbols: Q_QDOC and Q_CLANG_QDOC, both of which are "true" during an
entire execution of QDoc.

At a certain point in time, QDoc allowed the user the choice between a
custom C++ parser and a Clang based one.

The Q_QDOC symbol would always be defined while the Q_CLANG_QDOC symbol
would be defined only when the Clang based parser was chosen.

In more recent times, QDoc always uses a Clang based parser, such that
both Q_CLANG_QDOC and Q_QDOC are always defined, making them equivalent.

To avoid using different symbols, and the possible confusion and
fragmentation that derives from it, all usages of Q_CLANG_QDOC are now
replaced by the equivalent usages of Q_QDOC.

Change-Id: I5810abb9ad1016a4c5bbea99acd03381b8514b3f
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-10-21 09:48:36 +02:00
Yuhang Zhao
738e05a55a QWinRegistryKey: fix assert when querying default value
I wrongly assumed we can't query a value with an empty name ""
during the previous refactor commit, however, in Windows registry,
an empty name for a value means the default value of a key, we can
read and write it through the "Default" name.
Remove the wrong assert to fix the crash when we are trying to query
a default value of a key.

Add a new test case to test this kind of scenarios.

Amends commit 40523b68c1

Fixes: QTBUG-107794
Change-Id: Idacbcb86df4435a8c1ca1c19121599390ae8f3d3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-10-21 11:51:31 +08:00
Thiago Macieira
77eef32917 QLibrary: fix loading multiple versions of a library
The libraryMap only stored the file path, so we couldn't load two
versions of the same library as we'd find the other version already
loaded. Change the map to index by file name and version (using a NUL as
separator, since that can't appear in file names).

[ChangeLog][QtCore][QLibrary] Fixed a bug that caused QLibrary to be
unable to load two different versions of a library of a given name at the
same time. Note that this is often inadviseable and loading the second
library may cause a crash.

Pick-to: 6.4
Change-Id: I12a088d1ae424825abd3fffd171ce3bb0590978d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-10-20 15:38:47 -07:00
Assam Boudjelthia
3731e04668 Android: skip tessellation(Vulkan)
Fails on CI's Android 12 emulator.

Amends c681c7c23f.

Change-Id: Icb0c39a9d0b7952aea76b7b0c45fbfc7f2b0556f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-10-20 20:52:47 +00:00
Mikolaj Boc
fffea48ea5 Fix typo in QWasmWindowStack's name
'Wasm' in it is duplicated.

Change-Id: Ie00e02fb7ae4d9e13f490ce2d46a4eabf3f5710c
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-10-20 16:36:23 +02:00
Mårten Nordheim
9efb27e40c tst_QTcpServer: Unblacklist addressReusable
According to the grafana dashboard it has not failed in the
past week.

Reverts ad736e9150

Pick-to: 6.4 6.2
Change-Id: I3eac3c7fd667cfe2cf951b2808dddbfed8eae087
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-10-20 07:47:36 +00:00
Fabian Kosmale
7502e57ca8 Apply Q_FLAG to flag type instead of enum type
Change-Id: I05cebef521a532654ae8fa306eed9c8db5a0db69
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-19 13:54:07 +02:00
Thiago Macieira
823b7c7bce QLibrary: fix load() after a failed load()
Regression introduced by commit 8d4eb292b2
in 6.0, when QTaggedPointer was introduced. We set the tag even when the
loading failed and failed to reset it because d = {} retains the tag.

Pick-to: 6.2 6.4
Fixes: QTBUG-103387
Change-Id: Ie4bb662dcb274440ab8bfffd170a07aa9c9ecfca
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-10-18 17:10:42 -07:00
Thiago Macieira
636dbe6045 tst_QLibrary: add a cleanup() method to unload left-overs
QLibrary intentionally does not unload on destruction, so failing tests
may leave libraries already loaded and cause further tests to fail
because of that. So add a cleanup() method to unload everything we may
have loaded.

Note that QLibrary::unload() sets its state to NotLoaded after one
successful call, so we must recreate the object in case it had been
load()ed multiple times.

Pick-to: 6.2 6.4
Change-Id: I12a088d1ae424825abd3fffd171d133c678f910a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-10-19 00:10:42 +00:00
Thiago Macieira
d9280bb63b tst_QSet: fix flakiness after we removed the fixed, non-zero seed
The "qhash" test relied on the fact that those four elements would
produce a different order with a zero and a non-zero seed. But since
commit b057e32dc4 removed the setting of a
deterministic non-zero seed, this test had a 1 in 4! chance of failing.
Since 4! = 24, 128 retries should be more than enough to ensure we do
find at least hash seed that provokes a different order.

Fixes: QTBUG-107725
Change-Id: I3c79b7e08fa346988dfefffd171ee61b79ca5489
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-10-18 14:15:51 +00:00
Mårten Nordheim
30077d462d tst_QSql*/sqlite: Don't use random output in the datatags
It makes it impossible to rerun it, bad for both CI and local test runs.

As a drive-by name the database file sqlite.db instead of foo.db

Pick-to: 6.2 6.4
Fixes: QTBUG-100245
Change-Id: I2e4ee01189ccbad2a6add5db7771d35fd7248da8
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2022-10-18 16:15:50 +02:00
Edward Welbourne
01b1155ac6 Anticipate various warnings in tst_QVariant
Various places were knowingly provoking warnings without telling QTest
to check for and suppress those warnings. Some others did check for
this warning, so let's consistently suppress the noise.

Change-Id: I71b9829680c7a513f4d8fbb3c57442875a6c2dc4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-10-18 14:13:28 +02:00
Edward Welbourne
b9b516f42e Ignore the warning for all types in tst_QCborValue's mapFromArray*()
For some reason the QTest::ignoreMessage() was conditioned on the type
being tested being Array; however, the warning is in fact produced for
all types. So anticipate it for all and make the test log less noisy.

Change-Id: I78681624252ff8a71f080204f8b031609ddac468
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-18 14:13:28 +02:00
Edward Welbourne
d1bf556e24 tst_QChar::fromUcs4(): deduplicate a test-case
There were two copies of the 0x1D157 row and we can't remember why.
So change one of them to the Chakma digit 3 (a spiral) and annote all
three test-cses with what meaning Unicode assigns to them.

Change-Id: I95837588bd5944f7f2c39c8438d9076e844e4dd0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-10-18 14:13:28 +02:00
Edward Welbourne
95230ffd81 tst_QLocalSocket::listen(): distinguish two data tags
Two test-cases had the same name; distinguish them by the part of
their data in which they differ - one closes, the other doesn't.

Change-Id: I37051baf194bf8df742688739ad01e3335e64dc7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-10-18 14:13:28 +02:00
Edward Welbourne
e7913006f1 tst_QDoubleValidator::setRangeOverloads(): rename a data row
Two rows shared the same name. They claimed the value used was out of
range, but actually that was only true for one of them. The other was
in range, but the test reduced the number of digits allowed after the
decimal point, thereby making it invalid, so rename that one to
reflect this.

Change-Id: I0936ea25ec799c0069cd148b9f9bae5d35906093
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-10-18 14:13:28 +02:00
Edward Welbourne
09e86cfbef tst_QFont::serialize(): distinguish two letterspacing data tags
Include the spacings used, to avoid a naming collision.

Change-Id: Iaf78f7142f6780dcf4c7a0b973db9f625af06767
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-10-18 14:13:27 +02:00
Edward Welbourne
b65a7d80be tst_QPainter::blendARGBonRGB(): rename some data rows
Avoid duplication by distinguishing similar test-cases.

Change-Id: I1a100d6c9729f0ea356f177535d15c3d36e2da9e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-10-18 14:13:27 +02:00
Edward Welbourne
bed8663a0b tst_QPainterPath::testNaNandInfinites(): anticipate the warnings
The test used to trigger a lot of QWARN messages; these are clearly
intended, so tell QTest to expect them, so that we get an error here
if those warnings ever don't show up.

Incidentally tidy up a comment and convert a != verify to a
QCOMPARE_NE(), since it's now available to do that job.

Change-Id: I83e225c37abe8446dac06ebe4e75258cb87b71b0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-10-18 14:13:27 +02:00
Edward Welbourne
4af55438d0 tst_QPainterPath::testArcMoveTo(): include index in some data tags
In the process, clean up the building of the data tags: use a
range-for loop, albeit we do need an index to show in tags; show it
and the angle in the tags using addRow()'s easier formatting. Change
the low angle tests to show the sign of the angle (which is how they
differ)rather than just labeling them 1 and 2.

Change-Id: Ib5aaa3e22d771c530c9343ba368b0fdfceb264ce
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2022-10-18 14:13:27 +02:00
Edward Welbourne
119801f70d tst_QPainterPath::contains_QRectF(): rename some data rows
The last three duplicated earlier ones; and their names didn't take
into account the circle that had been added to the path since those
tests. So revise their names to reflect that.

Change-Id: I32d74f21947b4ba0c04eee53daf8efde6b4a6409
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-10-18 14:13:27 +02:00
Edward Welbourne
d52abad85d tst_QImage::reinterpretAsFormat(): deduplicate a data tag
Two rows shared a data tag. Prefixed one of them with the color of the
half-transparent image it involves (the other's is fully transparent).

Change-Id: I1bd174008ed29bcf2f460e683fdf6d1f12ba19d0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-10-18 14:13:27 +02:00
Edward Welbourne
e6fb0e0779 tst_QImage::mirrored(): deduplicate some data row names
Change-Id: Ia10c72c450eed12d29c9608c6a6270dd4dc4ef7c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-10-18 14:13:27 +02:00
Edward Welbourne
c13df5b6ea tst_QImageReader::preserveTexts(): deduplicate data tags
The same data tags were used with two distinct filenames in their
data. Include the basename of each filename in the data tag, to avoid
duplication.

Change-Id: I216fecbd413fab409227ad6f93f8ac3fcc74b059
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-10-18 14:13:27 +02:00
Edward Welbourne
af0c910912 tst_QKeySequence::parseString_data(): drop duplicated rows
The "a" and "A" rows appeared under Valid, then again under Only Keys.
The two copies were identical, in each case, so drop the latter.

Change-Id: Ib3d84710e772171bb4a5e0aefd20022810fb41cd
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-10-18 14:13:27 +02:00
Edward Welbourne
ab27c1e2d5 tst_QDBusTypes::isValidFixedType: don't duplicate fixed types
tst_QDBusType::isValidFixedType_data() called addFixedTypes() and then
addBasicTypes(); but the latter calls addFixedTypes(), too; so those
rows got duplicated. Only add the fixed types once.

Change-Id: If0d6f44ec7defb12117dad251878850ca75beb48
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-18 14:13:27 +02:00
Edward Welbourne
c74cf23124 tst_QRect::containsPointF_data(): remove duplicate data row
The row 27 that was positioned before row 01, as if it were meant to
be numbered row 00, was identical to the row 27 that appeared after
row 26. Since row 26 was the other case dealing with the null
QRectF(), I kept the one after it instead of renumbering row 00 and
deleting row 27.

Change-Id: I3585839184233f1f1629280ac9e5b25110c155c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-18 14:13:27 +02:00
Edward Welbourne
c10132888e tst_QCryptographicHash: avoid duplicate data tags
Use key(i) rather than valueToKey(value) as the Sha3_* alias Kekkak_*
or RealSha3_*. This way, we still test all members of the enum,
without duplicating row keys (albeit the aliases duplicate values).

Change-Id: I6acba5ffdf5b68294031d609a76b37ca8fad9d94
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-18 14:13:26 +02:00
Edward Welbourne
0448d57c07 tst_QBitArray: remove duplicate data rows
Both countBits() and datastream() had two copies of an all-zeros test
with 35 zeros. Removed the second, in each case.

Change-Id: I5dec4765236ae870c30828dae0f04b8902a100f0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-18 14:13:26 +02:00
Yuhang Zhao
ade68c9949 MSVC: Disable buggy conformance check
/Zc:lambda seems buggy. Although in my experiments it works well
for 99% Qt repos, it seems some tests will trigger the bug and it
also blocks some new commits. So disable it for now, it's not stable
enough.

Now that this check is disabled, the workaround for tst_qstringapisymmetry
is also not needed anymore, so remove the workaround as well.

Partially reverts commit 8cb832090a

Change-Id: Icf0ecbbaa6262522470e5f5dea05705985ab18f1
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-10-18 19:31:25 +08:00
Axel Spoerl
b1054d45e9 Fix flakiness in tst_QDoubleSpinBox / editingFinished
setFocus() was called on a double spinbox without calling show()
first. That causes flakiness on XCB when checking focus afterwards.
The test can still fail, when focus is acquired by e.g. a system
popup.

This patch adds a show() call before setFocus() to stabilize normal
behavior. In case the double spin box is shown, but cannot acquire
focus, the test is skipped.

Fixes: QTBUG-70088
Change-Id: If02e88800a31b09a1da63dcc074eb8bb1b0df391
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2022-10-18 11:31:25 +00:00
Marc Mutz
2fd990b386 Port qCompress() to zstream/deflate()
The zlib convenience API we've been using so far has two problems:

- On Windows-64, where sizeof(long) == 4, the use of ulong for sizes
  meant that we could not compress data compressable on other 64-bit
  platforms (Unix). While zstream also uses ulong, being a stream API,
  it allows feeding data in chunks. The total_in and total_out members
  are only required for gzip compression and are otherwise just
  informational. They're unsigned, so their overflow does not cause
  UB. In summary, using zstream + deflate() allows us to compress more
  than 4GiB of data even on Windows-64.

- On all platforms, we always allocated the output buffer in such a
  way as to accommodate the pathological case of random, incompressible
  data, so the output buffer was larger than the input. Using zstream
  + deflate(), we can start with a smaller buffer, then let zlib pick
  up where it left off when it ran out of output buffer space, saving
  memory in the common case that compression meaningfully reduces the
  size. To avoid the first few rounds of reallocations, we continue to
  use zlib's compressBound() for input less than 256KiB.

This completely fixes the compression side of QTBUG-106542 and
QTBUG-104972.

Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-104972
Fixes: QTBUG-106542
Change-Id: Ia7e6c38403906b35462480fd611b482f05a5c59c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-10-17 23:33:41 +02:00
Marc Mutz
f5205bd6a4 tst_Q{BitArray,ContiguousCache}: check not only count(), but size(), too
Add at least a few, so size() isn't completely untested.

Pick-to: 6.4 6.2 5.15
Change-Id: I500d28f7efb30ab578808d8fefb6ea57949edc2e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-10-17 19:33:34 +02:00
Edward Welbourne
0d915623ec tst_QAlgorithms: fix misleading indent in data table
A violation of coding style (requiring braces on multi-line bodies
of conditionals) was accompanied by a mis-indented else block.
Fix a long line while I'm about it.

Change-Id: Ibe9cf15eadbe9ef58138d7876e5e2c5a14a92fd4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-10-17 15:53:32 +02:00
Edward Welbourne
ce950bcbf7 Clean up tst_QAlgorithms::count{Trail,Lead}ing_data_impl()
Pull out the arbitrary factor of three as a named constant and
document its arbitrariness once.

Pull out the mask and bit used in each function's loop to the outer
layer of the loop, since they don't depend on the inner loop variable
(or the random value generated in that loop).

Use QTest::addRow() instead of constructing a string to pass to
newRow().

Change-Id: Ifacbcb390e00828fd47f51b0c73d0ad5f6bc8bdb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-10-17 15:53:32 +02:00
Edward Welbourne
2ffc36c24a tst_QTime: fix two duplicated test data tags
Names for data rows should be distinct.

Change-Id: I2ee1c4f362222d448278a90fc0a1cc9731e30976
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-10-17 15:53:32 +02:00
Edward Welbourne
565a827170 tst_QDateTime: eliminate some duplicate test-cases
Change-Id: I588494f2a79340599cafc48b3f4f4a79e6ca0a19
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-10-17 15:53:32 +02:00
Edward Welbourne
f6e9279ead tst_QAtomicInt:fetchAndAdd(): remove two duplicate data rows
Change-Id: I6568399945f421a18ddb5c52c68f82474de936c5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-17 15:53:32 +02:00
Edward Welbourne
8bb0d2308e tst_QStringApiSymmetry: use startpos to deduplicate indexing data tags
The tests for indexOf() and lastIndexOf() had duplicate data row tags,
due to only using the needle and haystack, although some tests
differed only in start position. Include start position where needed.

Change-Id: I197d415265ab1a805f2d36fb88aec92ea8646f7a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-10-17 15:53:32 +02:00
Edward Welbourne
5b70546c17 tst_QStringApiSymmetry: avoid repetition in trimmed_data()
Enclosing one string in each substring of another does not need to
repeat the empty substring of the latter. Extracting the empty
substring from different positions doesn't get different results.
In the process, tidy up the code a bit.

Change-Id: Ic66febbdadeaac0c466f4f1174d831a991d31e20
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-10-17 15:53:32 +02:00
Edward Welbourne
781bd075a6 tst_QStringApiSymmetry: eliminate one duplicate of a mid_data() row
There were two copies of the same line in mid_data(), leading to
duplicated data row tags.

Change-Id: Ia21e855ff781b13fe18c932cff48cb0aabd12750
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-10-17 15:53:32 +02:00
Marc Mutz
3d6f5e95f0 Update Catch2 to v2.13.10
Two patches applied to upstream release.

Pick-to: 6.4 6.2
Fixes: QTBUG-103321
Task-number: QTBUG-99122
Change-Id: Ief451a21e5f61851cb03a9ca94ffe0f864e4b1f8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-10-17 14:07:43 +02:00
Marc Mutz
bda3628402 Port qUncompress() to zstream/inflate()
The zlib convenience API we've been using so far has two problems:

- On Windows-64, where sizeof(long) == 4, the use of ulong for sizes
  meant that we could not uncompress data compressed on other 64-bit
  platforms (Unix). While zstream also uses ulong, being a stream API,
  it allows feeding data in chunks. The total_in and total_out members
  are only required for gzip compression and are otherwise just
  informational. They're unsigned, so their overflow does not cause
  UB. In summary, using zstream + inflate() allows us to decompress
  more than 4GiB of data even on Windows-64.

- On all platforms, if the size hint in the header was too short, we'd
  double the output buffer size and try again, from scratch. Using
  zstream + inflate(), we still need to reallocate, but we can then
  let zlib pick up where it left off when it ran out of output buffer
  space. In all but the most pathological cases, copying the
  already-decoded data instead of re-decoding it again should be
  faster, esp. if QArrayData uses realloc() instead of malloc() +
  free() to grow the buffer.

We also now directly allocate at least as much output buffer as we
have input, to cut the first few rounds of reallocations when the
expectedSize was created, as qCompress still does, using modulo
arithmetic mod 4GiB instead of saturation arithmethic.

Factor the growing of the output buffer into a wrapper function,
flate(), which can be reused when porting qCompress().

This completely fixes the uncompression side of QTBUG-106542 and
QTBUG-104972.

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-104972
Task-number: QTBUG-106542
Change-Id: I97f55ea322c24db1ac48b31c16855bc91708e7e2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-10-16 23:01:36 +02:00
Shawn Rutledge
0f94430a0f testlib: make it possible to test double-clicks with discrete events
The timestamp will no longer be incremented by 500ms after a mouse
release if the delay has been explicitly specified.

The default delay is 1 ms since f5010c49a3
but the running timestamp was unconditionally post-incremented by 500ms
after every mouse release, to prevent double-clicks, which were always
deemed as unintended (because we have a mouseDClick function for that).
Now, we do that 500ms increment only if the user has not provided a
delay value in the function argument at all. We have often found it
useful in our own tests to generate double-clicks "the hard way", by
sending indivdual events, so as to be able to check state in some target
object at each step, as shown in the new snippet.

[ChangeLog][QtTest] QTest::mouseRelease() and mouseClick() can now be
used to test double-clicks, by specifying a realistic timestamp delay.

Fixes: QTBUG-102441
Change-Id: I8e8d242061f79efb4c6e02638645e03661a9cd92
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-10-16 08:36:03 +02:00
Christian Ehrlicher
5caf808750 SQL/tests: fix tst_qsqlquery
Fix two tests which got broken due to the latest changes without
notifying because those tests are not run automatically.

Change-Id: Ibe9d9601f0a2ad4ce8f06ca21e7503e77fa55781
Reviewed-by: Fredrik Ålund <fredrik.alund@mimer.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-10-16 06:05:34 +02:00
Marc Mutz
fc76767692 Long live Q_UNREACHABLE_RETURN()!
This is a combination of Q_UNREACHABLE() with a return statement.

ATM, the return statement is unconditionally included. If we notice
that some compilers warn about return after __builtin_unreachable(),
then we can map Q_UNREACHABLE_RETURN(...) to Q_UNREACHABLE() without
having to touch all the code that uses explicit Q_UNREACHABLE() +
return.

The fact that Boost has BOOST_UNREACHABLE_RETURN() indicates that
there are compilers that complain about a lack of return after
Q_UNREACHABLE (we know that MSVC, ICC, and GHS are among them), as
well as compilers that complained about a return being present
(Coverity). Take this opportunity to properly adapt to Coverity, by
leaving out the return statement on this compiler.

Apply the macro around the code base, using a clang-tidy transformer
rule:

    const std::string unr = "unr", val = "val", ret = "ret";
    auto makeUnreachableReturn = cat("Q_UNREACHABLE_RETURN(",
                                    ifBound(val, cat(node(val)), cat("")),
                                    ")");
    auto ignoringSwitchCases = [](auto stmt) {
        return anyOf(stmt, switchCase(subStmt(stmt)));
    };

    makeRule(
       stmt(ignoringSwitchCases(stmt(isExpandedFromMacro("Q_UNREACHABLE")).bind(unr)),
            nextStmt(returnStmt(optionally(hasReturnValue(expr().bind(val)))).bind(ret))),
       {changeTo(node(unr), cat(makeUnreachableReturn,
                                ";")),  // TODO: why is the ; lost w/o this?
        changeTo(node(ret), cat(""))},
       cat("use ", makeUnreachableReturn))
    );

where nextStmt() is copied from some upstream clang-tidy check's
private implementation and subStmt() is a private matcher that gives
access to SwitchCase's SubStmt.

A.k.a. qt-use-unreachable-return.

There were some false positives, suppressed them with NOLINTNEXTLINE.

They're not really false positiives, it's just that Clang sees the
world in one way and if conditonal compilation (#if) differs for other
compilers, Clang doesn't know better. This is an artifact of matching
two consecutive statements.

I haven't figured out how to remove the empty line left by the
deletion of the return statement, if it, indeed, was on a separate
line, so post-processed the patch to remove all the lines matching
^\+ *$ from the diff:

  git commit -am meep
  git reset --hard HEAD^
  git diff HEAD..HEAD@{1} | sed '/^\+ *$/d' | recountdiff - | patch -p1

[ChangeLog][QtCore][QtAssert] Added Q_UNREACHABLE_RETURN() macro.

Change-Id: I9782939f16091c964f25b7826e1c0dbd13a71305
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-15 22:11:47 +02:00
Yuhang Zhao
8cb832090a MSVC: Enable all possible conformance checks
For the full list, please refer to [1].

Needed to change the qstringapisymmetry unit test:
In theory we don't need the array to be static and it did compile
without any problems so far, indeed. However, with this patch applied,
MSVC complains that the lambda function below can't access the array.
I don't understand why, because we use [&] in the lambda and it should
capture all the variables in theory, but in reality it failed to
capture this variable in the end. And making the variable static
solves this issue. Maybe it's a MSVC bug.

Already tested locally. Most Qt repos build without any issues,
only very few repos are not tested, as my local environment
can't build them.

[1] https://docs.microsoft.com/en-us/cpp/build/reference/zc-conformance?view=msvc-170

Change-Id: I658427aa171ee1ae26610d0c68640b2f50789f15
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-10-15 13:34:20 +00:00
Joerg Bornemann
5430fb2243 CMake: Set RPATH of deployed plugins on Linux
When deploying into some directory structure where CMAKE_INSTALL_LIBDIR
is different from Qt's lib dir, we need to set the RPATH of installed
plugins such that Qt libraries are found.

We do this using CMake's undocumented file(RPATH_SET) command and pray
that this command is safe to use across current and future CMake
versions.  For CMake versions < 3.21, we use patchelf, which must be
installed on the host system.

The adjustment of rpaths can be turned on explicitly by setting
QT_DEPLOY_FORCE_ADJUST_RPATHS to ON.

The usage of patchelf can be forced by setting QT_DEPLOY_USE_PATCHELF to
ON regardless of the CMake version.

Change-Id: I62ced496b4c12bf6d46735d2af7ff35130148acb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-15 13:00:04 +02:00
Joerg Bornemann
5ca714318c Don't set QT_PLUGIN_PATH in the deployment test's run environment
Otherwise we don't properly test whether the deployed executable can run
without adjusting the environment.

We temporarily adjust the test_widgets_app_deployment test and set
CMAKE_INSTALL_LIBDIR to make the test pass.  It would now fail on Linux
distros where CMAKE_INSTALL_LIBDIR defaults to "lib64" but Qt is built
with lib dir "lib".  The next commit removes this hack.

Change-Id: I63c79ef1ee23ffaeed881337fde6e9d889ecc0fe
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-15 12:59:59 +02:00
Thiago Macieira
c849c48d19 Autotest/Unix: request zero-sized core dumps for crashing code
Unix systems have got crash loggers in the past 15-20 years, notably
macOS and Linux (abrtd, systemd-coredumpd, etc.). By setting the core
dump limit to zero, those tools should be mostly inhibited from running
and thus not interfere with the parent process' timeouts. Even for
systems without core dump loggers, disabling the writing of a core dump
to the filesystem should also help.

Pick-to: 6.4
Change-Id: I12a088d1ae424825abd3fffd171d112d0671effe
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-10-14 08:18:53 -07:00
Liang Qi
673f89d62c tests: skip tst_QWidget::touchEventSynthesizedMouseEvent() on Wayland
Task-number: QTBUG-107157
Pick-to: 6.4 6.2
Change-Id: I88df3215aceb7a619b4c1fbc2f457400a1bc7025
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-10-14 17:18:53 +02:00
Liang Qi
bdd2b68696 tests: skip tst_selftests on Wayland and XWayland
QWindow::requestActivate() is not supported.

We have one tst_selftests binary, and will test it with both xcb and
wayland qpa plugin. A runtime check and skip will have different
restult files, which is not implemented in testlib yet.

Task-number: QTBUG-107578
Pick-to: 6.4 6.2
Change-Id: Idc8cb24c6f42a9f0f4dc9493e3fd1a5803ba7ce0
Reviewed-by: Liang Qi <liang.qi@qt.io>
2022-10-14 17:18:53 +02:00
Liang Qi
f2aa04722a tests: skip tst_QTouchEvent::multiPointRawEventTranslationOnTouchPad() on Wayland
QWindow::requestActivate() is not supported.

Task-number: QTBUG-107158
Pick-to: 6.4 6.2
Change-Id: I047337d736ff10693d98075e2636028225162765
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-10-14 17:18:53 +02:00
Liang Qi
f990c256eb tests: skip tst_QCompleter::showPopupInGraphicsView() on Wayland
Task-number: QTBUG-107186
Pick-to: 6.4 6.2
Change-Id: I1f67c0b7c70dec210989073660db6b03afb98fff
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-10-14 17:18:53 +02:00
Liang Qi
ca3c72b27a tests: skip tst_QWidget_window::mouseMoveWithPopup() on Wayland
Task-number: QTBUG-107154
Pick-to: 6.4 6.2
Change-Id: I94149e8ffdb834b44c605cfd9bdea7e9f458dc90
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-10-14 17:18:53 +02:00
Liang Qi
a16fd6bbe2 tests: skip tst_QWidget::setWindowGeometry() on Wayland
Task-number: QTBUG-107157
Pick-to: 6.4 6.2
Change-Id: I65a21898d6a5d40a4e7e9eeecf1e2398e45d97fe
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-10-14 17:18:53 +02:00
Liang Qi
7f27189d90 tests: skip tst_QGridLayout::setMinAndMaxSize() on Wayland
Task-number: QTBUG-107184
Pick-to: 6.4 6.2
Change-Id: Iddc280acd18e230d1ae778ccb6d7d17a8ff3d76c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-10-14 17:18:53 +02:00
Liang Qi
3846b27dd8 tests: skip tst_QWidget_window::resetFocusObjectOnDestruction() on Wayland
QWindow::requestActivate() is not supported.

Fixes: QTBUG-107155
Pick-to: 6.4 6.2
Change-Id: I3a3ce04695ce5039229ce51d80948c62456f5944
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-10-14 17:18:52 +02:00
Liang Qi
ca8554d338 tests: tst_QWidget::renderChildFillsBackground() passes on Wayland
This amends 1453f048f5.

Task-number: QTBUG-107157
Pick-to: 6.4
Change-Id: I606dd2013e11a4f7639fea59d75091191fd30d87
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-10-14 17:18:52 +02:00
Liang Qi
89b54bb4ec tests: skip a few tests in tst_QWidget on Wayland
QWindow::requestActivate() is not supported.

* tst_QWidget::dumpObjectTree()
* tst_QWidget::enterLeaveOnWindowShowHide()
* tst_QWidget::imEnabledNotImplemented()
* tst_QWidget::activateWhileModalHidden()

Task-number: QTBUG-107157
Pick-to: 6.4 6.2
Change-Id: Ic8e0eeff05cfc4e6dc16fc570caf80a1dcc57800
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-10-14 17:18:52 +02:00
Liang Qi
584aa8ad41 tests: skip tst_QWidget::renderInvisible() on Wayland
Task-number: QTBUG-107157
Pick-to: 6.4 6.2
Change-Id: I405a5dfc915b754e30389208cc0bdb01f17ed166
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-10-14 17:18:52 +02:00
Volker Hilsheimer
9eca8d62fa Fix memory leak and clean up splitter test
Allocate the QSplitter on the stack so that it and its child widgets are
cleaned up when the test function finishes.

As a drive-by, replace QString usage with QByteArray to avoid unneeded
conversion from and to latin1, and modernize list construction and for loop.

Pick-to: 6.4 6.2
Change-Id: I2e29961edbab1ec88be356fca6bc100f08894e82
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-10-14 16:34:47 +02:00
Volker Hilsheimer
cdadd1bdb3 Allow programmatic closing of windows that are modally blocked
In Qt 6, after changes such as 121fddcf5a,
we go through the QPA layer to close widget windows properly. Closing
and hiding of windows is now done in when we receive and handle the
window system's CloseEvent.

Such an event to a modally blocked window should be blocked, so that
users can't close a modally blocked window. However, if the event is the
result of a call to QWindow::close, then it should not be blocked.
Luckily, we know that the event is the result of such a call, so let
such events through. This restores compatibility with Qt 5, where it was
possible to first open a new dialog, and then close the previous dialog.

Add a test case.

Fixes: QTBUG-107188
Pick-to: 6.4 6.2
Change-Id: Id812c1fc36aa0e1a10dfb8d3a16a11d387289b05
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-10-12 01:53:42 +02:00
Marc Mutz
aa37e67ef7 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace, with manual
unstaging of the actual definition and documentation in dist/,
src/corelib/doc/ and src/corelib/global/.

Task-number: QTBUG-99313
Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-10-11 23:17:18 +02:00
Thiago Macieira
a94731c2ad tst_QTcpServer: use a random port number in addressReusable
Just in case the same test is being run in parallel. We do that by
creating a listening TCP server in the test process. This test is
supposed to test the address reusability, so a clean close on a server
that never accepted a connection should not cause reusability issues.

Change-Id: I12a088d1ae424825abd3fffd171ccfb9fc5c09ee
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-10-11 09:36:11 -07:00
Thiago Macieira
742584b0f2 tst_QTcpServer: Output useful more useful info for addressReusable
To try to figure out why QProcess::waitForReadyRead is returning false
so quickly. Though we know it's going to be "Address in use".

FAIL  : tst_QTcpServer::addressReusable(WithoutProxy) 'process.waitForReadyRead(5000)' returned FALSE. (Failed to listen: The bound address is already in use
Netid State  Recv-Q Send-Q Local Address:Port  Peer Address:PortProcess
tcp   LISTEN 0      50         127.0.0.1:49199      0.0.0.0:*    users:(("crashingServer",pid=40529,fd=4))
)

Pick-to: 6.4 6.2
Change-Id: Ic43a460bfc7c7eb6379405b7a1a064e502b6fef3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-10-11 09:36:11 -07:00
Ievgenii Meshcheriakov
c4e550703c Update UCD to Revision 30
This corresponds to Unicode version 15.0.0.

Added the following scripts:

    * Kawi
    * Nag Mundari

Full support of these scripts requires harfbuzz version 5.2.0,
this version adds support for Unicode 15.0:

    https://github.com/harfbuzz/harfbuzz/releases/tag/5.2.0

Fixes: QTBUG-106810
Change-Id: Ib06c526e49b0f01ef9f21123bcf875c6b19f2601
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-10-11 14:10:59 +00:00
Edward Welbourne
35ff456407 tst_QString::compare(): rename a test tag to be unique
There were two data8 rows; and no data9, so that was easy to fix.

Change-Id: I8191de142e1a3be57bf1ad97e63d5780f2859fea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-11 11:24:51 +02:00
Edward Welbourne
3af2747c46 tst_QString::number_base(): distinguish negative binary test-cases
Two test cases were called "base  2, negative"; one of them use -1 as
value, so s/negative/minus 1/ for it.

Change-Id: Ia5da3952d93976262cc8423d4e75ec19dab9a088
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-11 11:24:39 +02:00
Edward Welbourne
167da771f6 tst_QRE::wildcard(): use more informative data row tags
Using simply the pattern didn't work so well when some patters are
used repeatedly, on different haystacks. So include the haystack
in the tag name. Remove one straight up duplicate row.

Change-Id: Ib46364581f23c493e83d75e6d04ab09e4329a3a5
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2022-10-11 11:24:11 +02:00
Edward Welbourne
042702d961 tst_QBAApiSymmetry::toInt_data(): deduplicate a data-row name
One "empty" test was base ten, the other left the code to work out the
base. Change the latter's name to reflect that difference.

Change-Id: I4918eb0d293420df315d86e532787950b8f05be8
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-10-11 11:24:01 +02:00
Edward Welbourne
cc204f96c9 tst_QCborValue: remove duplicate data row from tests
The addCommonCborData() helper had two identical rows named simple255.
It only needs one.

Change-Id: Ie934c31f373069788c3ef774fde8956b54814e67
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-11 11:23:50 +02:00
Edward Welbourne
2192d6a62e tst_QPlugin::scanInvalidPlugin(): de-duplicate a data-tag
Change-Id: Ibc25041b5e003cf21d781012f279e9bdd75a2ee9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-11 11:23:40 +02:00
Edward Welbourne
97470a7838 tst_QUuid::fromString(): tweak a test to avoid data-tag collision
Two of the uuidA test cases had an open-brace for the string and no
close; one of them ended with a space (which, apparently, is valid).
Since the data-tag was constructed by formatting the string in a
fixed-width field, padding with spaces, these two cases coincided.

Fortunately the only uuidB test-case had closing as well as opening
braces, so we can just switch the test for "trailing space is not an
error" to use it, instead.

Change-Id: I7068d40145c6b6b3b72777b029282850b1d1ea81
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mate Barany <mate.barany@qt.io>
2022-10-11 11:23:15 +02:00
Edward Welbourne
439066ea84 tst_QResourceEngine::checkStructure(): fix name of some data rows
The first "test1 text" test-case related to a file called test1.txt;
but the second related to a file called test2.txt; I suspect a
copy-and-paste with incomplete post-edit. In any case, change the
latter's data tag to reflect the difference.

Change-Id: I8354a3d1bd18715d6717dfd0962aa70faefbee90
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-11 11:23:04 +02:00
Edward Welbourne
f89d3484b2 tst_QUrl::fromUserInput(): distinguish to data rows by name tag
Change-Id: Ia3d232466ae618c26b95a6c33b094b197a2e4ec8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-11 11:22:53 +02:00
Edward Welbourne
6e4a5211a2 tst_QUrl: distinguish two ipvfuture test-case data tags
Change-Id: I20e318b4c17c35aae5f5440b2fd9c6e0af7c4a70
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-11 11:22:41 +02:00
Edward Welbourne
5455ea7ccd tst_QUrlQuery: remove duplicate of reconstructQuery data row
Change-Id: I7903eca0887c0cbccef9fcadac6e95009703e1c2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-11 11:22:31 +02:00
Edward Welbourne
ef8905aa2b tst_QFile: distinguish invalid from valid in mapResource data-tags
The test was using the same tags twice each, giving no clue to the
difference between the two test-cases for each.

Change-Id: I645b01c0c4008a766e505047cb05cc22640ee129
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
2022-10-11 11:22:22 +02:00
Edward Welbourne
50561716f0 Distinguish the repeats of QSystemSemaphor's processes tests
It's not clear why this test repeats each test-case five times, but
give the duplicates distinct names, at least.

Change-Id: I4a098d90c3fe6f61842745c1d5f62047fe13a9b5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-11 11:22:14 +02:00
Edward Welbourne
1f07199a48 Remove duplicate tst_QVariant canConvert:Int data row
There were simply two copies of the same row-adding code.

Change-Id: I12240dedf2649c314ad32984f4de9d6b9bf280d8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-10-11 11:22:04 +02:00
Edward Welbourne
691de7f696 Rename some tst_QTextStream::manipulators() data rows
Two rows named "hex" were a collision we should avoid.
The two "showpos" rows could be better distinguished.

Change-Id: I43727041eb00e6883ce8b34b346de5e2a63f1a34
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-10-11 11:21:57 +02:00
Edward Welbourne
16732e368a Reflow tst_QTextStream::manipulators_data()
Now I can read it and work out how to rename the duplicated data tag.

Change-Id: I78f2b3f38f955fa6e6a88cb87cfca6e4f755a177
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-10-11 11:21:47 +02:00
Edward Welbourne
11997578ac Provide optTitle for a NumberDoubleTestData testcase that needs it
The test-case for 0.0001 with precision 0 has the same expected text
as that for 0.0 with the same precision; which lead to QBA's test of
it getting a duplicated data tag. Add an optTitle for the one that
isn't precise to deduplicate.

Change-Id: I03600e2af43f6d11b53e05e8027924c92ed4db89
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-10-11 11:21:38 +02:00
Edward Welbourne
3f43ddbd10 Rename tst_QBA::toFromHex()'s longer no-leading-zero data-row
No two data-rows should have the same name.

Change-Id: I0e222498ca5bb973f703b7e6bd314fc38bb4db4d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-10-11 11:21:30 +02:00
Edward Welbourne
5c4dcd0697 Rename tst_QBA::movablity() to fix the typo
There's an i between b and l, as well as after l.

Change-Id: I9252935687e25f1f11aacb11286edf666ff9af8a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-10-11 11:21:15 +02:00
Edward Welbourne
e61dc8a83b Don't duplicate a column name in tst_QByteArray::movablity_data()
It first added a column, then some rows, then called
prependExtended_data(), which expects to be called first in a data
function and starts by adding the same column. So put that first and
drop the duplicate addition of the column.

Change-Id: Ia5cf86f821608e78f0e4872db2b3167ef81cc59e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-10-11 11:21:06 +02:00
Edward Welbourne
f71daf857c Fix tst_QQuaternion's duplicate test tags
Having the same test tag for two rows of a data table makes the report
less useful. We also intend to forbid doing that.

Change-Id: I67ec32514b6550f4f97610a2140f1383d0d85b23
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-10-11 11:20:58 +02:00
Alexandru Croitor
a6b430337c CMake: Only build ssl tests if the feature was enabled
Pick-to: 6.4
Task-number: QTBUG-107538
Change-Id: If2d473fbf8240b356d226be7bc4058506149a0e6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-10-11 11:13:36 +02:00
Volker Hilsheimer
2ef130a41d JNI: add generic support for array-types
The typeSignature for a type T[] is always "[" + typeSignature<t>, so we
can just implicitly support arrays of any known type. To prevent support
for multi-dimensional arrays, make sure that the underlying type is not
also an array.

By adding a QJniTypes::isArrayType in addition (that is true for any
type with a signature starting with '['), methods like
QJniObject::callMethod could then return a special QJniArray type that
provides array-specific functionality.

As a drive-by, and since all lines need to be touched to add braces,
replace std::is_same<>::value with std::is_same_v.

Change-Id: Iccadf03cfceb8544381a8f635bb54baeddf46c99
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-10-10 20:19:30 +02:00