Commit Graph

5299 Commits

Author SHA1 Message Date
Thiago Macieira
473ad206c4 Fix QSharedPointer::create and QEnableSharedFromThis
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>
2015-01-21 08:23:59 +01:00
Friedemann Kleint
0b62cd8da7 Windows: Fix coordinate offset when positioning the taskbar on the left.
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>
2015-01-20 19:59:23 +01:00
Friedemann Kleint
8c5b3c6d91 Fix QVERIFY() in tst_qwidget.
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>
2015-01-20 19:59:18 +01:00
Rainer Keller
668a3a4da1 Autotest: Use QFINDTESTDATA to find test data
Change-Id: Ie6c659f6d8e8b3eeaf2453f0cba6189d56f86581
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-01-19 15:53:51 +01:00
BogDan Vatra
a15569b269 Android: don't report xfail
Change-Id: I2998632cffc29161eb26421b07cf51a4138fcad3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-19 15:48:50 +01:00
Joni Poikelin
1909ab4b8f Add test for QColorDialog initial color
Task-number: QTBUG-43548
Change-Id: I9410072e5bf837933148d48c4f9d6797337485f5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-01-19 15:41:10 +01:00
Sérgio Martins
9087df6bd2 windowflags test: Fix showing which flags are set
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>
2015-01-19 11:17:49 +01:00
Pierre Rossi
890ae41d06 Fix a crash in QPlainTextEdit::documentChanged
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>
2015-01-19 10:47:28 +01:00
David Faure
7fc8c560e2 Fix QPrinter::setPaperSize regression when using QPrinter::DevicePixel
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>
2015-01-19 10:39:55 +01:00
Rainer Keller
20480070a6 Autotest: Selftests fail in UTC timezone
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>
2015-01-19 10:21:26 +01:00
Friedemann Kleint
9d1bcd727a Diaglib/Event filter: Output application state on focus events.
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>
2015-01-16 17:25:20 +01:00
Eric Lemanissier
c28718b88b Correction on bound values in case of repeated QSqlQuery::execBatch
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>
2015-01-16 13:14:26 +01:00
Eskil Abrahamsen Blomfeldt
4448576ae0 Android: Fix QLayout tests
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>
2015-01-16 09:27:57 +01:00
Eskil Abrahamsen Blomfeldt
7a760f5ed9 Android: Fix QDirModel tests
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>
2015-01-16 09:27:52 +01:00
Eskil Abrahamsen Blomfeldt
a0c21829ea Android: Fix QSideBar test
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>
2015-01-16 09:27:45 +01:00
Eskil Abrahamsen Blomfeldt
9a34b69b7d Android: Skip QProcess_and_GuiEventLoop test
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>
2015-01-16 09:27:37 +01:00
Eskil Abrahamsen Blomfeldt
1ee6fdc72c Fix QRawFont test when used with bundled FreeType
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>
2015-01-16 09:27:29 +01:00
Eskil Abrahamsen Blomfeldt
b4031387f9 Android: Fix QImageReader test
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>
2015-01-16 09:27:15 +01:00
Rainer Keller
997b040310 Autotest: Find all autotests due to changed naming conventions
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>
2015-01-16 08:14:55 +01:00
Rainer Keller
f6a59f8def Benchmarks: Build gui benchmarks only when gui module available
Change-Id: I57fc2f09a4e31e379c256dfe3f5d7546cdcf2b4b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-01-16 08:14:49 +01:00
Thiago Macieira
63ca2846e1 Fix compilation with older MSVC: use qIsNan instead of isnan
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>
2015-01-15 08:40:14 +01:00
Eskil Abrahamsen Blomfeldt
e1bd0ee534 Android: XFAIL a few tests in QDnsLookup
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>
2015-01-12 13:09:57 +01:00
Thiago Macieira
fb16664893 Fix memory leaks with QDBusServer
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>
2015-01-11 03:39:40 +01:00
Shawn Rutledge
e0981a0d9e QScreen manual test: use sizeHint; don't override QLineEdit text color
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>
2015-01-09 16:21:04 +01:00
Eskil Abrahamsen Blomfeldt
ccf50893e8 Skip incompatible QTextLayout tests when dpi-scaling is used
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>
2015-01-09 15:41:40 +01:00
Eskil Abrahamsen Blomfeldt
d30c446d35 Android: Fix QDataStream test
Include test data on Android.

Change-Id: Ic0890495c0bf8d2e38595585226a03073b043d57
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-09 15:41:34 +01:00
Eskil Abrahamsen Blomfeldt
099db090d5 Android: Fix QTextBoundaryFinder test
Include test data on Android.

Change-Id: I35c17618d84822df126fe3462a00d3d49b1377c8
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-09 15:41:27 +01:00
BogDan Vatra
7ab513d539 Android: Fix qpixmap test.
Add all test data to resources.

Change-Id: I31b0dbb7546a15151f64523c86bf8eb687ff9ec0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-01-08 10:10:50 +01:00
BogDan Vatra
c161197b5f Android: Fix qimage test.
We must add all test data to resources.

Change-Id: I1b18415cd53a27bd23e51ac6b738d3ed94162ac9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-01-08 10:09:39 +01:00
Eskil Abrahamsen Blomfeldt
14c94240f9 Android: Fix some QStyle tests
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>
2015-01-08 10:07:06 +01:00
Eskil Abrahamsen Blomfeldt
d056618d68 Make sure widget is polished before checking its font
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>
2015-01-08 10:07:00 +01:00
Eskil Abrahamsen Blomfeldt
7ad75cd8ef Android: Fix QTemporaryFile tests
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>
2015-01-08 10:06:50 +01:00
Eskil Abrahamsen Blomfeldt
954d355fbc Android: Fix QPainter autotest
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>
2015-01-08 10:03:27 +01:00
BogDan Vatra
57949b5f2d Android: Fix qimagewriter test.
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>
2015-01-08 10:02:23 +01:00
Marc Mutz
d511aa906c QVersionNumber: test more version numbers
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>
2015-01-08 01:46:41 +01:00
Thiago Macieira
8190291fb0 Autotest: don't leak a socket every call to QtNetworkSettings::hasIPv6
Change-Id: I87e31945052233cee17460ee6f59c02ec416b27b
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-01-08 01:06:17 +01:00
Andy Shaw
bb16ceac68 Prevent buffer overrun when getting the glyph images
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>
2015-01-07 09:42:32 +01:00
Thiago Macieira
cf4b413fa4 Make QtDBus unit tests compile with runtime dbus-1 too
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>
2015-01-06 18:16:32 +01:00
Thiago Macieira
1fc4053337 Allow the QtDBus type benchmark to run without libdbus-1 found
Change-Id: I1086e6cd6534dc96311e981cc9c73f501c1128ac
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-01-06 18:16:09 +01:00
Thiago Macieira
624ee454ec Make QDBusConnection and QDBusServer return an error on default objects
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>
2015-01-06 17:37:00 +01:00
Thiago Macieira
aa83bacb14 Autotest: fix a race condition in verifying a peer D-Bus connected
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>
2015-01-06 17:36:58 +01:00
Eskil Abrahamsen Blomfeldt
ce40b8b7ef Android: Fix QCryptographicHash test
Include test data in qrc when building on Android.

Change-Id: I611ca24fe8764eb709b6ce27e814840ea919d4f1
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-06 16:44:38 +01:00
Eskil Abrahamsen Blomfeldt
8057ce61d0 Android: Fix QCommandLineParser test
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>
2015-01-06 16:44:36 +01:00
Eskil Abrahamsen Blomfeldt
4613e1d2c1 Android: Fix QCollator test
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>
2015-01-06 16:44:34 +01:00
Eskil Abrahamsen Blomfeldt
463835b306 Android: Fix QChar test
Include test data in qrc when building on Android.

Change-Id: Id80623324788dac21bd5ddbeef8108f54d6bc8f7
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-06 16:44:32 +01:00
Eskil Abrahamsen Blomfeldt
6a4704cc64 Android: Fix QByteArray test
Include test data in qrc so it can be found on Android.

Change-Id: Iaca8422120f1ef842aafeb0cc209cb9fdd70f05f
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-06 16:44:30 +01:00
Eskil Abrahamsen Blomfeldt
75f0578124 Android: Fix QTranslator tests
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>
2015-01-06 16:44:27 +01:00
BogDan Vatra
af32727362 Android: Check XML output and optionally stop on fail.
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>
2015-01-06 14:26:39 +01:00
Friedemann Kleint
16c32c6dfb JPEG: Fix reading of EXIF orientation.
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>
2015-01-06 14:26:00 +01:00
Thiago Macieira
b699ac070c Don't bind to QHostAddress::Any if we want to do IPv4 multicast ops
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>
2015-01-05 08:07:10 +01:00