We forgot to initialize the tracker if create() was used.
Task-number: QTBUG-43696
Change-Id: Ic5d393bfd36e48a193fcffff13b740931ff2204b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
For windows that do not have WS_EX_TOOLWINDOW set, the WINDOWPLACEMENT
API uses workspace/available aera coordinates. Introduce a helper
function to return the offset and use that.
Task-number: QTBUG-43872
Change-Id: I329c640f180524699b45b855b4583f447c4a0987
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Replace by QCOMPARE where applicable; introduce message to generate
output for failed comparisons with QVERIFY2().
Task-number: QTBUG-43872
Change-Id: I09c8f9fd31ceed224e441f253049f68907ca0d7a
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Change-Id: Ie6c659f6d8e8b3eeaf2453f0cba6189d56f86581
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
The text edit that shows which flags we have set should be updated in
PreviewWindow::setWindowFlags() and PreviewWidget::setWindowFlags()
but QWidget::setWindowFlags() isn't virtual so only the base class
one was called.
Change-Id: I5c9d47d003d5701dde1ab63df0d349f641d66f44
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The layout for an invalid block is very likely to be null, it
shouldn't be accessed without checking the block's validity first.
We can make the check a bit more conservative and simply check that
the block isn't empty.
Change-Id: Ic1459a6168b1b8ce36e9c6d019dc28653676efbe
Task-number: QTBUG-43562
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
The QPageSize-based refactoring led to casting DevicePixel to a QPageSize::Unit
value of 6 (out of bounds). And then the switch in qt_nameForCustomSize
would leave the string empty, leading to "QString::arg: Argument missing: , 672"
warnings.
Change-Id: I85e97174cc8ead9beccaaa3ded6edfad80f8e360
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Selftests for testlib fail when executed in UTC timezone because local and
UTC are the same, but expected to be different. A custom timezone is used
instead.
Debug output of qCompare does only handle local and non-local timezones, using
new Qt5 features allows to show the correct timezone in format string.
Change-Id: I753884a12370952b7b62a90d62896db4f2d3d1b4
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Output the current active/modal/popup windows when receiving
FocusAboutToChange or FocusIn events.
Task-number: QTBUG-42731
Change-Id: Ia88e9a9b41f7c80fb7a2a048b06da56d989ff18a
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Until now, QSqlQuery::execBatch did not call resetBindCount, which lead
the next call to QSqlQuery::addBindValue to start at non zero index.
This is problematic in case of a prepared query which is called several
times.
Task-number: QTBUG-43874
Change-Id: I1a0f46e39b74d9538009967fd98a269e05aac6f2
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
This test requires test data to be available and the
testRetainSizeWhenHidden test assumes that a widget will be
sized based on its sizeHint(), which does not work on
platforms where show() implies showMaximized().
Change-Id: I9bf372d8c0ea94845ae08481ec555fe25dcfebc0
Reviewed-by: BogDan Vatra <bogdan@kde.org>
This test needs to have a test environment available on the regular
file system, so we create this when initializing the test. In
addition we QEXPECT_FAIL one of the tests which seems to expose
a legitimate bug. A bug report has been created for this.
Change-Id: I7c90aea78a067815cb647a51db5d91a652a9fc1c
Reviewed-by: BogDan Vatra <bogdan@kde.org>
On Android, the HOME and TMPDIR environment variables both point
to the application sandbox, whereas the QSideBar test assumed
they were different. We work around this simply by creating
a new directory and using this as the test dir in place of the
home directory.
Change-Id: I67e01926b901ddf237b05aff116d30b6c7885535
Reviewed-by: BogDan Vatra <bogdan@kde.org>
This requires building a command line tool and running it using
QProcess, which is not a supported deployment option on Android.
Change-Id: I795374bf809a8e4d8634a55f5ebf1699ee9745d1
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
The auto-hinter in the FreeType version bundled in Qt gives
slightly different advances on some glyphs. As noted in
the removed code, this was already observed on Windows and QNX,
and recently also on Android.
I'm sure it could also happen on platforms using the system library
if the system library was the same version as the one bundled in Qt.
Instead of expect-failing the test, we simply accept both the
observed results as valid.
Note that we need to accept 9 as a result for the default hinting
preference on all platforms, not just Windows, since the default
hinting preference in FreeType can be a system setting.
Change-Id: I3cc0f33f0f66dd64419770b37c10dee457706b5e
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
The files for the test have to be included in a qrc to be available on
Android.
Most of the image files are already in a qrc, but a couple were missing.
We add this in a separate qrc to avoid interfering with the tests on
other platforms.
Change-Id: Ibb24f5015a1aba4d5622e14f7aae80bc18611ec4
Reviewed-by: BogDan Vatra <bogdan@kde.org>
The algorithm searches for all executables in search path starting with
"tst_". Tests are not named like the folder they are contained in
anymore.
Change-Id: I360f293e43e30292fe0ae6230fd3ec7abf3d632d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
isnan is C99 and POSIX.1, which the older MSVC do not support. Use the
Qt equivalent.
Change-Id: Ic5d393bfd36e48a193fcffff13b8679cb83d12db
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Some of these tests are verifying things that are not supported
on Android, so we XFAIL these cases when we see the appropriate
error message.
Change-Id: I8245266f061c902515bb12251521159a8e19bfb7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Two serious mistakes:
- we need to call dbus_server_free_data_slot as many times as we call
dbus_server_allocate_data_slot
- we need to delete the d pointer...
The changes to the unit tests are simply to cause the used peer
connections to be removed so they don't show up in valgrind.
Change-Id: I9fd1ada5503db9ba481806c09116874ee81f450d
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
The window size was too small on high-DPI screens.
Save the default text color instead of setting it to black.
Change-Id: I78b50624110be0cb1d077d3782d421eb323f4fb0
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
On e.g. Android, the tabs will be scaled by DPI. This breaks the
logic in the QTextLayout tests for tabs. It's not possible to
just scale the expected sizes either, since the whole text layout
will be affected by font sizes and scaling, and it's difficult to
predict where characters will land on different platforms and
resolutions.
To avoid breaking this test on other platforms, we just skip them
when we know they will break. Since the code tested is
cross-platform, this will hopefully not have any significant
impact on our coverage.
Change-Id: I65d6c33c9c6724665983a17f99eadcf1baedcc20
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Include test data on Android.
Change-Id: Ic0890495c0bf8d2e38595585226a03073b043d57
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Add all test data to resources.
Change-Id: I31b0dbb7546a15151f64523c86bf8eb687ff9ec0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
We must add all test data to resources.
Change-Id: I1b18415cd53a27bd23e51ac6b738d3ed94162ac9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
This adds the testdata to a qrc to make them available on Android.
There are still some failures which might be actual errors, and which
will be addressed separately.
Change-Id: I1bdcfb2c6676134ca52388d49a1b2d25cf2813f9
Reviewed-by: BogDan Vatra <bogdan@kde.org>
QWidget is polished when show() is called, so unless you do this
first, QWidget::font() will return a default constructed QFont,
and not necessarily the default specified in the platform theme.
Comparing this to QPainter::font() later, which has been resolved
against the platform theme font, and not the default constructed
font, you can get a mismatch and a false test failure. This
happened on Android.
Change-Id: I41ef5b10879bbd4bb8ef8d52ecaccf5e8e894075
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Fixed a few instances of files that should be deployed to the
file system. The way we do this on Android is via qrc. We also
need a special case for the resources/test.txt, because
QFINDTESTDATA will find this in qrc, but that's not the one
we are looking for.
Change-Id: I7097e8b7795b3a8fd483adad090208f295478412
Reviewed-by: BogDan Vatra <bogdan@kde.org>
The testdata needs to be in a qrc to be available on Android.
Note that a single test will still fail. Since this requires
a platform-independent fix, it will be committed separately.
Change-Id: Ib2438a3298d81d77b7f4f240ef045aa0500d8382
Reviewed-by: BogDan Vatra <bogdan@kde.org>
We must add all test data to resources. Write output data into a writable location.
Change-Id: I5a1c212f6108abf2a82288a2c84cfb31eda5e101
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
QVersionNumber will gain a small-version-number optimization, which
stores sequences of less than 4 (32bit) or 8 (64bit) 8-bit signed
segments inside the class instead of a QVector. Make sure the tests
cover those cases, too.
Change-Id: If1d875c75d284908756b305f767a7218cab5226f
Reviewed-by: Keith Gardner <kreios4004@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The change 35bc3dc45a moved some padding out
of QTextureGlyphCache into the font engines directly, however this was not
done for the DirectWrite font engine so it caused a buffer overrun.
Task-number: QTBUG-41782
Change-Id: I4e643159036f06c5edd8a742dc6694d517a47826
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
There's a change in Qt 5.4.0 that makes Qt compile with its own set of
D-Bus headers, which means QT_CFLAGS_DBUS may be empty. Thus, we can't
compile or link if we're using the actual libdbus-1 API to build the
test.
This commit makes these unit tests use the same dynamic loading
mechanism.
Change-Id: I56b2a7320086ef88793f6552cb54ca6224010451
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
The error of "Not connected".
This incidentally solves a crash when QDBusServer().lastError() is
called but libdbus-1 couldn't be found.
Change-Id: Id93f447d00c0aa6660d4528c4bbce5998d9186a8
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
On the unit test side, everything is sequential: we first ask for the
connection, verify that it is connected, then ask the remote side via
the session bus if it is connected. Unfortunately, the remote site may
handle things in a different order: it may handle the incoming function
call to "isConnected" before doing accept(2) on the listening socket.
So, instead, make the local side block until the connection is received
on the other side. On the remote, we don't block, instead we use the
feature of delayed replies.
Change-Id: Ie386938b8b39dd94a9d7e5913668125fb4a3c7da
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Skip the tests that require building and deploying an external
command line application, since that's not how we do things on
Android, and it's really not very relevant for that platform.
Change-Id: I2c1985687e25fb0cf124b1d57c8ba60e37d2ff96
Reviewed-by: BogDan Vatra <bogdan@kde.org>
On Android the POSIX implementation of QCollator is used, and
this does not support setting other locales than the default.
Change-Id: I25d23949341fc555e8be4f6836ae68cc8813cc46
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Include test data in qrc so it can be found on Android.
Change-Id: Iaca8422120f1ef842aafeb0cc209cb9fdd70f05f
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Bundle test data in qrc on Android. Extract it, as the tests
expect to find it in the file system.
Change-Id: I251eca3c23141a608b1cbac5ee0b7164c068f9b4
Reviewed-by: BogDan Vatra <bogdan@kde.org>
The failures will be printed in red color.
Use -f param to stop on fail.
Change-Id: Ife58f9264a9ac859d739842c6d1359acde807ce7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
The orientation is unsigned short, read it as such. In
JPEG-files created by Ricoh/Pentax cameras, the data is saved in
Motorola format. Reading the wrong data size will produce invalid
values when converting the byte order.
Change-Id: I8f7c5dc5bfc10c02e090d3654aaefa047229a962
Task-number: QTBUG-43563
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Linux gracefully allows us to do that and treat the v6 socket as if it
were v4. Other OS (notably OS X) aren't so forgiving.
Change-Id: I13dd3274be2a4b13e8b1eef93cbc2dd17b648f96
Reviewed-by: Richard J. Moore <rich@kde.org>