When removing rows, the tester is looking at the data of the row
"just before" and the row "just after" the removed rows, to see if
they are still the same at the end of the removal operation.
Guard this with bounds check, in case there is no row just before
or just after.
This is the opportunity to use modeltester in tst_qidentityproxymodel,
which was already a testcase for removing the only row in a given parent.
Change-Id: Iec8228c16b9c670b794e2665356d153679178494
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
When testing zones "America/Mazatlan" and "Mexico/BajaSur" the test
crashes from an assert. Skip testing the zones for now.
Task-number: QTBUG-69132
Change-Id: I595089647792e9a2c094d63cb837584b8cdc9cb9
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
It causes most of the fails seen on Android.
Task-number: QTBUG-69064
Change-Id: I2f97fea41ee78e7962b8c34ed996bbe4bcb88732
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Skip a few tests that Android's time-zone information doesn't suffice
to get right.
Task-number: QTBUG-68835
Change-Id: Ibf8d213c96b29d74fc478a0ede686ae52b5200fb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Where possible. Sometimes the replacement is QTRY_COMPARE instead.
Also don't use QTestEventLoop directly when it can also be replaced with
QSignalSpy use.
Remove the TimerHelper class, since its uses can be done with QSignalSpy (and a
lambda when remainingTime is checked). Although checking static single-shot
timers still needs a target object, so use a stripped down version in those
tests.
remainingTimeDuringActivation() was not actually testing the repeating case, but
single-shot case twice, so fix that. In the repeating case the remaining time is
exactly 20 ms on my machine, but QEMU emulation seems to be slow enough for time
to advance before the lambda is executed, so relax the conditions.
Task-number: QTBUG-63992
Change-Id: Iae92ff7862a13d36e695eec63b54403ec872f2b4
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
This only enables compilation, it doesn't fix any test.
Qt on Android supports process, but not TEST_HELPER_INSTALLS. See also
acdd57cb for winrt.
android-ndk-r10e is used to compile, see
http://doc-snapshots.qt.io/qt5-5.11/androidgs.html .
corelib/io/{qdir,qresourceengine} need to be fixed later.
Done-with: Frederik Gladhorn <frederik.gladhorn@qt.io>
Done-with: Mårten Nordheim <marten.nordheim@qt.io>
Change-Id: I34b924c8ae5d46d6835b8f0a6606450920f4423b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
A follow-up of 9d078c8f147ea875e862360b0d7480201fbbcff7 in qtqa repo.
Change-Id: Ib7c1f5cf325e9ad0066aae139b0dc72bc0184b32
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Before the fix is applied this test fails because QFINDTESTDATA will
return "/usr/" instead of the folder with the same name in the current
directory.
The 'usr' folder can't be located 'next to' the application since this
does not trigger the issue (QFINDTESTDATA looks for the folder next
to the executable early on). So we put it in a subdirectory and change
the current working directory to its parent directory.
Change-Id: I627679dcb6f2f6954264e23bfc1a71de3bff7203
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
... by adding a prefix to the resource.
On android there is a resource ("qpdf") which gets included in the root
in all applications, included from "src/gui/painting/painting.pri".
So we move the test data to a sub-folder.
Task-number: QTBUG-68596
Change-Id: I67f2ed79a32c68d9a76cafba8ef23fe0da7c0fe8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
"terminate" and "terminated" both fail on Android since
QThread::terminate not supported on Android. So we should skip them.
Task-number: QTBUG-68596
Change-Id: Id0d1dde2cfa02bb2978e5dd16087bf8f3bf112b0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In tst_QDateTime::springForward(), we test correct handling of times
in the gap; these are formally invalid and a mktime() implementation
may reasonably reject them causing our date-time code to produce an
invalid result. So handle that case gracefully in the tests, only
insisting on consistency between the two ways of preparing the date.
In one test, package the repeated code I was going to adapt into a
macro to save repeitition.
Task-number: QTBUG-68832
Task-number: QTBUG-68839
Change-Id: Ib8a16ff007f4e75ab2ccff05b1ccf00a45e50dc8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Android doesn't use the proper zone-abbreviation, so just check it
starts with the right date-time. Revised the way the #if-ery for that
is handled, to avoid repetition of the (now more complex) condition in
the two tests affected.
Task-number: QTBUG-68833
Change-Id: Iceb5469f46c69ba5cdbaf7ca050ad70f2bb74f44
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Have a test expect what it does produce rather than fail what we can't
fix.
Task-number: QTBUG-68837
Change-Id: Icda7bd9968682daf97d46d597f8bb0433560cde2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
They used different messages for the same excuse, which weren't well
worded in any case; and their #if-ery was differently decorated.
Change-Id: I28f5032693aff1036cb086ac4032c669110a5cb5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
It appears that in the 5 years since we deprecated this function, people
have not stopped using it. The removal of qt5_use_modules() caused lots of
troubles in packages still using it when they were compiled against Qt 5.11.0.
Instead, let's revive this function and keep it for the Qt5 life time.
See discussion on qt-development mailing list:
http://lists.qt-project.org/pipermail/development/2018-June/032837.html
Change-Id: Ic263e3bb6706268cb9ea38a0711665f166a3aa9e
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QString::sprintf(), like the C printf-family, always includes two
digits in any exponent it outputs. Up to 5.6, number() and arg()
taking a double did the same; but changes at 5.7 to enable opting out
of the leading zero this implies for a single-digit exponent
accidentally opted out of it in args() and number(). This commit
fixes number() and arg() to include QLocaleData::ZeroPadExponent in
the flags they pass down to the C locale's doubleToString(), restoring
the prior behavior, including consistency with sprintf().
[ChangeLog][QtCore][QString] Formatting of doubles with single-digit
exponent, by number() or args(), now includes a leading zero in that
exponent, consistently with sprintf(), as it did up to 5.6.
Task-number: QTBUG-63620
Change-Id: I10c491902b8556e9f19e605177ead8d9fd32abd9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
If there is a parent (typically an itemview) then StatusTip events
should be sent to that. However in the case of there not being a parent
then the event should be sent to the QHeaderView itself.
Task-number: QTBUG-68458
Change-Id: I2a8c11c973210c7adf1bf29443f224f968a357a9
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
If the fbo had samples > 0 set, it would use a temporary fbo with
a default configuration losing the HDR precision.
Change-Id: I7e9966165b3100f148c4ad24738f3ee71273f29a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The implementation of QTransform::transposed() had a wrong assumption
about the type of the result.
Task-number: QTBUG-68630
Change-Id: Ia5ce794efe773d74fb5fdaff3da8cae2b452e7e5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
qFuzzyIsNull has a fixed range, where qFuzzyCompare can tell if numbers
are different in a more relative range. Without it QPointFs that are
heavily scaled will be interpreted as identical, when they are quite
different at their own scale.
Task-number: QTBUG-60359
Task-number: QTBUG-62161
Change-Id: Ic4ba90e9e994aedff5548d690f053eb309b0a60b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We move QInternalMimeData to a separate file, because this class is
used, even if draganddrop is disabled. From now on, include
qinternalmimedata_p.h instead of qdnd_p.h for QInternalMimeData.
Change-Id: I594e08e2e90d574dc445119091686b4b69e4731b
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
It happens because our filesystemwatcher thinks it is subdirectory and not
two different paths
Task-number: QTBUG-60676
Change-Id: Ic753e9481cb26303a030044e0a5ab4d703bc529f
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
When a new model was set with setSourceModel() and the mapping was
built up, the destruction of the old model caused a reset in the
QSortFilterProxyModel which lead to an empty view or an assertion.
Now we properly disconnect the old model again and also clean up the old
mapping/persistent indexes when a new source model is set.
Task-number: QTBUG-44962
Task-number: QTBUG-67948
Task-number: QTBUG-68427
Change-Id: I2e0612899c210bde3ac0cfa59aefd78269deee5b
Reviewed-by: David Faure <david.faure@kdab.com>
Wait for the spinbox to show become active in the previous test. Also use
QWidget::activateWindow() instead of QApplication::setActiveWindow(). Use of the
latter seemed to result in some confusion where QWidget::isActiveWindow()
returned true but QWindow::isActive() on the underlying window returned false,
leading qWaitForWindowActive() to fail.
Also remove superfluous setting of focus. It was just set and verified.
Change-Id: I023cdc2d272e23b2537b32606b7a3bf35bf671ac
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
[ChangeLog][QtCore][QSharedPointer] Fixed a problem that made create()
on a type with const qualification fail to compile.
Task-number: QTBUG-68300
Change-Id: I0825ff5b5f6f4c85939ffffd152f3e55e5b9caae
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This accounts for a case of a placeholder being duplicated in the
prepare query, but where only one placeholder was used. This amends
e4e87a2ece
Task-number: QTBUG-68299
Change-Id: Ia92ee912facd51a13e7222886debb219b24442b0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
setAutoRepeat() is failing on macOS and Windows when run together with
defaultAndAutoDefault(). It succeeds when run on its own. Adding the wait allows
it to succeed when run with the other tests as well.
Amends 0cb940b1d3, which removed the wait.
The comment is the same as before. I couldn't see a better way to replace the
wait (QApplication::topLevelWidgets() already returns only the testWidget and
testWidget->isActiveWindow() returns true).
Another theory I had was something waiting for the KeyRelease so I changed
QApplication::sendEvent() uses to QTest::keyClick(). It did not help but that
still seems preferable.
Change-Id: If87d1e6e018751f3068ea4c913ae6731aba41ff0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
tst_QProcess hangs sometimes in QEMU. Based on my experiments in a debug VM the
offending test seems to be processesInMultipleThreads(), since that was were I
was able to reproduce the hanging in.
Since the whole test executable hangs, blacklisting is not enough, so skip the
test.
Task-number: QTBUG-67760
Change-Id: I34f8852be955a8612deac22b369f68d79a139d11
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The added test case contains the binary JSON equivalent of
["ž"]
with the modification that the string's length has been set to INT_MAX. In
Value::usedStorage this length is used through the pointer d like so
s = sizeof(int) + sizeof(ushort) * qFromLittleEndian(*(int *)d);
Because 2 * INT_MAX is UINT_MAX-1, the expression as a whole evaluates to 2,
which is considered a valid storage size. However, when converting this binary
JSON into ordinary JSON we will attempt to construct a QString of length
INT_MAX.
Fixed by using String::isValid instead of Value::usedStorage. This method
already takes care to avoid the overflow problem. Additionally, I've tried in
this patch to clarify the behavior of Value::isValid a bit by writing it in a
style that is hopefully more amenable to structural induction.
Finally, the test case added in my previous patch had the wrong file extension
and is renamed in this one.
Task-number: QTBUG-61969
Change-Id: I45d891f2467a71d8d105822ef7eb1a73c3efa67a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Previously the test worked because the client was the last party to know
when encryption was established. However, due to changes in the TLSv1.3
handshake the server is now the last one.
In either case, relying on both to be encrypted when one of them is
finished is not great, so now we only quit the event loop when both
client and server have emitted 'encrypted'.
Change-Id: Ic1fc75671206d866f7ea983805fd58a99657aac6
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Replace with QSignalSpy or QTRY_COMPARE when possible.
Task-number: QTBUG-63992
Change-Id: I18dc8837301424855487a12ee62451a5aeb21bf0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The test relies on the existence of qt-project.org in resources. It
contains mimetype data and is automatically added. For static builds on
MSVC it is only added if it is actually needed though.
Change-Id: Icd1d74466607196f9b635205f7cb4d9b300ec4b8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
If builtin_testdata is present additional data ends in inside of
resources so that tests can access this data when needed. The addiitonal
data has to be taken into account in the resource engine's test.
Change-Id: I10de6b9612ca49b314d77cfadd5b2360a5d90d53
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Change-Id: I399cc1aed3ee4151cf6adfd8f8780d8975604d52
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
The formatting of the output from QSslCertificate::toText has
changed slightly from before, so it no longer matches the test's
data.
From what I can tell we just do a manual sanity check and create
a new file with the new output and then augment the test.
Task-number: QTBUG-67463
Change-Id: I751e5a3f9a28015f97c895cea47384704fd68e38
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The added test case is the binary JSON equivalent of
{"a":{"š":null}}
with two modifications. First, the length of the string "š" has been corrupted
to 0xFFFFFF00. Second and more import, the Base::size field of the inner object
has been reset to 0.
On its own the first modification would normally trigger a validation error.
However, due to the second modification the Value::usedStorage for the inner
object evaluates to 0, completely disabling all further validation of the
object's contents.
Attempting to convert this binary JSON into standard JSON will lead to the JSON
writer trying to construct a QString of length 0xFFFFFF00.
Fixed by validating also objects with usedStorage == 0.
Task-number: QTBUG-61969
Change-Id: I5e59383674dec9be89361759572c0d91d4e16e01
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>