Commit Graph

421 Commits

Author SHA1 Message Date
Laszlo Agocs
91b48208f5 Add touchEvent() virtual to QWindow.
Unlike keyPressEvent(), mousePressEvent(), etc. the touch events had
no equivalent so one had to fall back to reimplementing event() or
using an event filter. This is now corrected by introducing
touchEvent(). Touch events are finally becoming a first-class citizen
in Qt 5.

Change-Id: Ia2044030154fd5b1b5384f08a3cb1749b798435f
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-12-12 17:27:19 +01:00
Laszlo Agocs
4222603f8e Extend touch events.
The capability flags indicate which information is valid in the touch
points. Previously there was no way to tell if e.g. the value returned
by pressure() is actually the value provided by the driver/device or
it is just something bogus due to pressure not being supported.

The points' flags return information about the individual touch
points. One use case is to differentiate between touches made by
finger and pen.

Velocity, if available, is now also exposed.

Each touch point can now contain an additional list of "raw"
positions. These points are not reported individually but are taken
into account in some way by the underlying device and drivers to
generate the final, "accurate" touch point. In case the underlying
drivers expose these additional positions, they are made available in
the lists returned by the touch points' rawScreenPosition().

The raw positions are only available in screen coordinates to prevent
wasting time with mapping from global positions in applications that
do not use this data. Instead, apps can query the QWindow to which the
touch event was sent via QTouchEvent::window() and can call
mapFromGlobal() manually if they need local raw positions.

The capability and device type information is now held in a new
QTouchDevice class. Each touch event will contain only a pointer to
one of the global QTouchDevice instances. On top of type and
capability, the new class also contains a name which can be used to
differentiate between multiple touch input devices (i.e. to tell from
which one a given QTouchEvent originates from).

The introduction of QTouchDevice has three implications: The
QTouchEvent constructor and QWindowSystemInterface::handleTouchEvent
need to be changed (to pass a QTouchDevice pointer instead of merely a
device type value), and each platform or generic plug-in is now
responsible for registering one or more devices using the new API
QWindowSystemInterface::registerTouchDevice.

Change-Id: Ic1468d3e43933d8b5691d75aa67c43e1bc7ffe3e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-09 14:15:37 +01:00
Friedemann Kleint
45374d0886 QPixmap test: Re-enable tests of Windows bitmap/icon conversion.
- QPixmap::to/fromWinHICON/BITMAP() became free internal
  functions (see b8d330904b)
- Improve QImage check function similar to
  11732d133b

Change-Id: I80ff066964ce6c339a6b9bfa5a0e10421dca162a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-09 08:24:28 +01:00
Bradley T. Hughes
60e93449d2 Re-enable 'check' target for tests/auto/gui on Mac OS X
Failing tests are marked with CONFIG+=insignificant_test.
tst_QTextLayout currently asserts, so it has been disabled to prevent
destabilization of the CI system.

Change-Id: I7bd836ee14085689c8a0f0ce8e3c80d81a55eb94
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-12-09 02:39:06 +01:00
Friedemann Kleint
11732d133b QPixmap test: Make lenientCompare() more verbose.
- Output cause of failure
- Streamline code

Change-Id: I597e8cf0178c2417ea55c2319398a48d839b4474
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-08 08:51:35 +01:00
Jason McDonald
e3640d1bdd Remove TESTED_CLASS/TESTED_FILES comments from tests.
These comments were mostly empty or inaccurate.  Appropriate naming of
tests and appropriate placement of tests within the directory tree
provide more reliable indicators of what is being tested.

Change-Id: Ib6bf373d9e79917e4ab1417ee5c1264a2c2d7027
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-06 02:19:25 +01:00
Jason McDonald
4bca278d63 Don't set graphics system at start of test.
QApplication::setGraphicsSystem() is a no-op, and even if it wasn't it
would be unwise to force a graphics system that isn't guaranteed to be
included in the Qt build, without including any logic to skip the test
if setting the graphics system failed.

Change-Id: Id9a0a87586872088625de7840b5032d0c3cc48a1
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-05 07:28:47 +01:00
Friedemann Kleint
45a4a7b3fb Temporarily disable Windows-specific QPrinter autotest.
See QTBUG-22927.

Change-Id: I6022d795bf893797c2ab1a91ffffa7b482109137
Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
2011-11-29 12:27:49 +01:00
Samuel Rødal
5116a25a55 Fixed regression in tst_qscreen.
The ScreenOrientation enum was changed so that the values are power of
twos, angleBetween() needed to be fixed in order to reflect this.

Task-number: QTBUG-22554
Change-Id: Ia45dd6643b40b14204abf967b00c0d04834736a3
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-11-23 22:23:55 +01:00
Holger Hans Peter Freyther
01c795bcd1 uclibc: fenv.h does not define the necessary things.
libstdc++ provides the fenv.h found and for uclibc default toolchains
the bits/c++config.h has _GLIBCXX_HAVE_FENV_H undefined leading to
no import of the uclibc fenv.h

Change-Id: I53173b099f3d8791f527f1ccb60991de57cd19db
Filed: https://bugs.busybox.net/show_bug.cgi?id=4484
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
2011-11-22 15:17:08 +01:00
Joona Petrell
0c8f471c96 Remove handlesInputPanelVisibility() deprecation mechanism
Task-number: QTBUG-21964
Change-Id: I508ba690c90369d31ca33390d3001064857fb62e
Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-11-21 22:46:11 +01:00
Friedemann Kleint
e8b4c49efd qtbase tests: Fix some warnings
- Fix warnings about QAtomicPointer/Int usage
- Fix some gcc 4.6 warnings about assigned/unused variables

Change-Id: Ib4dbf9110f0dad93ad48e97278310f05fad3a82a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-21 09:58:23 +01:00
Jason McDonald
a8fd0c3654 Don't depend on moc to disable test functions.
The moc tool is not aware of all defines (particularly those that are
compiler builtins) and does not correctly evaluate others that depend
on compiler builtins, such as Q_OS_FOO.

This commit reverts parts of the following commits, but is not a
complete fix as there were many instances of this problem in the tests
prior to those commits:
    924d810dbd
    8aaff67510
    338d3f1197
    a55034062b
    253497b744
    7cfad460c5
    9d2ff58f36
    0cf6baa2d6

Change-Id: I947d797fe3ec76139ba1b55561cea569895662c5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-18 01:51:57 +01:00
Kent Hansen
44b6bb3560 Call invalidateResource() on QOpenGLMultiGroupSharedResource-owned resources
Commit 202127f860 ensured that
QOpenGLMultiGroupSharedResource-owned resources are deleted,
but it was missing a call to invalidateResource().

Change-Id: I166ce8a7298772408081331fe1a91bd2cd88aebb
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-11-17 17:40:06 +01:00
Kent Hansen
202127f860 Ensure that QOpenGLMultiGroupSharedResources are cleaned up
When a GL context group is destroyed, all multi-group shared
resources associated with the group should be cleaned up.
Otherwise we could get a double deletion in the resource's
destructor, because it still retained a pointer to the
deleted group.

The missing cleanup resulted in a crash when the global
static qt_gl_functions_resource was destroyed, first seen
in the tst_examples autotest in qtdeclarative. It possibly
didn't manifest before because it's event loop-dependent
(the contexts are deleted via deleteLater()).

Change-Id: I6b1e0bfdfbbb2bff8e795f545e680fcdfa094768
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-11-15 17:09:35 +01:00
Jason McDonald
51b7d3c8b6 Remove obsolete QSKIP parameter.
Change-Id: I269337d802ec6b383a496fe8dc62a6b11e4d61c5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-15 08:51:43 +01:00
Jo Asplin
51ae37d8c4 Added QTBUG-22296 to QEXPECT_FAILs
Change-Id: I6c619cea64a14d957077813256c7d4f7ff6a4220
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2011-11-11 10:58:10 +01:00
Jo Asplin
f7d5d07ace Re-enabled passing tests in tst_qopengl
To increase the effective test coverage, this patch
re-enables the tst_qopengl test case as such, and
instead disables only the test functions that are currently
failing in CI.

Task-number: QTBUG-22453
Change-Id: Ifa9ccab81efb1577767465c150fc64a9d9e3f8e0
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2011-11-09 14:05:19 +01:00
Charles Yin
78542c6275 QPainterPath: Fix copy constructor again.
The previous fix a05270f435 is not correct,
QPainterPathPrivate(other) should be QPainterPathPrivate(), as there
is only a default ctor for QPainterPathPrivate and ref is initialized there,
 use copy ctor just copies the ref value which makes all detach() calls broken.

Add an unit test for this as well.

Change-Id: I658f0a977664d5ec523af3f8a48c1a866eda6ab0
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2011-11-08 07:43:00 +01:00
Jo Asplin
7ba57e2630 Re-enabled passing tests in tst_qprinter
To increase the effective test coverage, this patch
re-enables the tst_qprinter test case as such, and
instead disables only the test functions that are currently
failing in CI.

Task-number: QTBUG-22453
Change-Id: I74cc30dc26b8b83852b3516f8def995eab19cf0f
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-07 09:27:07 +01:00
Jo Asplin
087fcc6182 Moved tests into gui/kernel/ and gui/qopengl/
This commit moves tests from test/auto/ into more appropriate
locations (i.e. matching the locations in the Qt source):

- qscreen and qwindow are moved into gui/kernel/
- qopengl is moved into gui/qopengl/

Note: qscreen is disabled for now since it is broken
on Linux (see QTBUG-22554).

Change-Id: Idcc7a51e78d6d0955bddb9cb4091866659193cc8
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-11-04 20:48:19 +01:00
Laszlo Agocs
0008428f90 Prevent timestamps in widgets' touch events from disappearing
Change-Id: I096914eb2b02ad9c4a5c0462a1f4b76ef17c3957
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-11-04 20:48:19 +01:00
Jason McDonald
9dc4907074 Don't rely on PlatformQuirks in qimagereader test
The PlatformQuirks header is, by its author's own admission, based on
"very bad assumptions", those being that only Meego has quirks.

The assumption that only Meego has versions of libjpeg and libpng with
rounding errors is not a good assumption.  Change the test to be a
little tolerant of rounding error regardless of the platform, at least
until there's a reliable way to tell which libjpeg/libpng versions have
rounding errors.

Change-Id: Id2be5cc54739249b615bf3307ee1850c0a5c06b3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-04 07:11:07 +01:00
Jiang Jiang
c30ebdeac0 Do not put cursor at non-stop character positions
When moving cursors, non-stop positions are skipped, however certain
input sequences can still lead us there. In such cases we should
simply ignore those positions in cursorToX.

Task-number: QTBUG-7076
Change-Id: Ia0a25931f4043359f72a6c0c14a74b905e40b93e
Reviewed-by: Eskil
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2011-11-04 01:54:33 +01:00
Samuel Rødal
9022f42a4f Get rid of "#if 0" and skipped tests in QPainter autotest.
qt_format_text_clip() and qt_format_text_boundingrect() have been
skipped ever since they were originally added to git, so I see no point
in keeping them.

The #if 0 in setEqualClipRegionAndPath() was ifdefed out from when that
specific test case was added (maybe it was failing to begin with?), but
it passes now, so we should enable it.

Change-Id: I6551e3b5612a4d4b00a969511af6abc85db43892
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-03 01:06:05 +01:00
Jason McDonald
c8c9f6b46f Remove dead code from QTransform autotest.
Remove the operator_star_qrect() test function.  The body of this test
function has been inside "#if 0" since the commit that created the test
in 2006 and the operator it is trying to test doesn't exist.  Seems fair
to assume that this function isn't worth keeping.

Change-Id: I9748273b28eae4b07c3a25f77cee412ad94ea822
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-31 02:34:43 +01:00
Jason McDonald
5b9ada3cd5 Remove debugging code from QPainter autotest.
Any test diagnostics that are useful should be part of the regular test
output, as the CI system cannot switch on commented-out code when there
is a test failure.

Change-Id: Ic7fb619081e9ff453769f4064431dc726e90b985
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-31 02:34:36 +01:00
Jason McDonald
f935b98b20 Remove debugging code from QPathClipper autotest.
Any test diagnostics that are useful should be part of the regular test
output, as the CI system cannot switch on commented-out code when there
is a test failure.

Change-Id: I36c0624cccf70853a697a2395259b387fa334134
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-31 02:34:30 +01:00
Jason McDonald
5029a99118 Remove dead code from qpixmap autotest
The removed code was in #if 0 in the original commit of the test
function and appears to be an earlier version that should have been
discarded before the initial commit.

Change-Id: I91f16aa7adcccb50f4f3a02062fb9d105d85000c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-31 02:34:23 +01:00
Robin Burchell
a2337f79ff Remove Windows and X11 from src/widgets/platforms.
This is dead code, unused with QPA in place, so remove it to avoid confusion
caused through grepping for class names existing in both old and new places.

Mac code is left in place for now, as some of it is still in use.

Change-Id: Ia82cd5bbabe71285ca997f79d8fd9c0504e32c28
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-28 16:29:13 +02:00
Jason McDonald
919c5982b8 Remove pointless QVERIFY(1) calls in QPainter test
Change-Id: Iae5fcb9fa7dc64ed2d2bd369dbe689c5136ad283
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-27 11:14:53 +02:00
Friedemann Kleint
0c3d898a03 Tests: Remove Q_WS_QPA, qpa-sections from .profiles.
Compile without -qpa.

- Make Q_WS_QPA-#ifdefed sections the default in the code
- Replace some Q_WS_ by Q_OS_
- Add ### fixme for places that need checking
- Remove qpa conditionals from .pro files.

Change-Id: I6ea930afc0c236cc12a7b7e95f1b8a1c24b3a513
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-10-27 09:50:30 +02:00
Sergio Ahumada
c3313fdd1c Doc: Fixing typo
Fix typos I was able to find in `tests/auto' directory.

Change-Id: Id0bfcc18301381ac8b1ca8d5af17bd926e5913d4
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2011-10-26 13:50:12 +02:00
Jo Asplin
1b345e8655 Re-enabled tests
This commit re-enables tests that are assumed to be ok by now, since they:
- Have been passing in CI for a long time recently (more precisely, not failed once in pulse run range 730-829).
- Did not have any known issues associated with them.

Note that not all of these tests were disabled as a result of QTBUG-21402.

Task-number: QTBUG-21402
Change-Id: I80bbf8b351bd9165aa968e98f4dc17e8be6bc7c3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-26 02:58:36 +02:00
Jo Asplin
2dd6745306 Re-enabled tst_qstatictext
tst_qstatictext is fixed by 8b4e40f535

Task-number: QTBUG-20977
Change-Id: I70631951c98ee3033f4d0c7a61fad102d28846d1
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-26 00:47:24 +02:00
Jo Asplin
777d34ab5a Re-enabled tst_qrawfont
tst_qrawfont is fixed by 8b4e40f535

Task-number: QTBUG-20976
Change-Id: I862674211f581abec8714d1a3da4dc38227c2606
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-26 00:45:06 +02:00
Rohan McGovern
c0fb09465b gui: eliminated usage of qttest_p4.prf
qttest_p4.prf was added as a convenience for Qt's own autotests in Qt4.
It enables various crufty undocumented magic, of dubious value.
Stop using it, and explicitly enable the things from it which we want.

Change-Id: I97046aa51f1b3fc100e2eb2fa115f1bf8ae6437d
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-10-25 07:19:31 +02:00
David Faure
dfa24768a3 Deprecate QDesktopServices::storageLocation/displayName
Which required porting the related unittests to qstandardpaths

Change-Id: I6eb63c46845f05cd29cc42b59872707526277c90
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
2011-10-23 15:28:25 +02:00
Jason McDonald
27f9f136f7 Remove SkipMode parameter from QSKIP calls.
The previous commit removed SkipMode from the testlib APi.  This commit
removes the parameter from all calls to QSKIP.

Task-number: QTBUG-21851, QTBUG-21652
Change-Id: I21c0ee6731c1bc6ac6d962590d9b31d7459dfbc5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-21 01:20:29 +02:00
Kent Hansen
9e92ecde74 Provide API for "placement new" construction of meta-types
By making it possible to specify the place in memory where a
type should be constructed, any meta-type can be allocated on
the stack, for example. In the QML/JS QObject binding, this
makes it possible to call slots and access properties from
JavaScript without having to perform any mallocs (e.g. due to
QVariant creation) in the C++ <--> JS value conversion, in
the best case.

In addition to QMetaType::construct() and QMetaType::destruct(),
this change introduces QMetaType::typeSize(), which returns the
size of a type in bytes. This can be used to prepare a suitable
buffer for constructing a type using construct().

Benchmarks indicate that in-place construction is 2-5x faster
than normal construction for core and GUI types on linux-g++.

Note that there is already a QMetaType::construct() function
in Qt 4, which has been renamed to QMetaType::create() in Qt 5.
In order to avoid existing usages of construct() in user code
to call the Qt 5 construct() (when they really meant to call
create()), the third argument ("copy") of construct() is made
mandatory. Hence, calls to QMetaType::construct() written for
Qt 4 will cause a compile error when compiled with Qt 5, and
the user must adapt his code.

Task-number: QTBUG-12574
Change-Id: I836f06f6ee1c1c3edbd199a03424c78c942bdd3e
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2011-10-19 10:25:28 +02:00
Jason McDonald
8f02339e76 Remove DEPENDS_ON from qtestlib API.
The DEPENDS_ON macro didn't do anything and has misled many users to
think that they can write test functions that depend on other test
functions.

Task-number: QTBUG-21851
Change-Id: Ibe65b2d5d88bb81b6a0ebbe0b220f7d409a1446c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-19 07:24:13 +02:00
Jason McDonald
ae1810658b Move QTRY_VERIFY/QTRY_COMPARE into testlib.
These functions have lived in tests/shared/util.h for a long time, but
they really belong in qtestlib.

Change-Id: I60d569d002dea220b51563931d8b7aa77a20b98b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-19 07:23:44 +02:00
Jason McDonald
730382a968 Prefer QSKIP to QTEST_NOOP_MAIN.
Use QSKIP instead of QTEST_NOOP_MAIN so that the user receives a clear
indication that these tests aren't testing anything when the required
defines are not defined.

Change-Id: I977e24205a1bb7787ecddbdb1ebbeda1f2ded321
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-18 03:10:24 +02:00
Kent Hansen
d5aa4355f1 Add autotest for QMetaType creation of gui types
This test verifies that all gui types with built-in QMetaType
support can be created, either using the default constructor
or the copy constructor.

Change-Id: Ibb1c5aab8571b598638c74112471d6869516a202
Reviewed-on: http://codereview.qt-project.org/6344
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-10-14 14:46:35 +02:00
Joona Petrell
e941b37fcc Move input panel visibility ownership from QInputPanel to QPlatformInputContext
Now QInputPanel::visible() can be set true even when platform doesn't provide
a virtual keyboard. Like keyboard geometry, visibility should be dictated by
the platform plugin and not QInputPanel, whose role is more like that of a mediator.
QInputPanel::show() and ::hide() calls should be treated as requests that may fail.
Changed the QInputPanel's visible property to read-only as a setter that may
fail is not really a setter, show() and hide() should be used instead.

Enabling the new functionality cannot be activated immediatelly without breaking
existing keyboards, added a temporary function handlesInputPanelVisibility that
handovers the responsiblity of updating input panel visibility to QInputContextPlatform
only once QInputContextPlatform says that it is able to handle it.

Change-Id: Ideecaf7225cc3971f33a0ac976bd92cf7767475b
Reviewed-on: http://codereview.qt-project.org/6429
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-10-11 16:03:25 +02:00
Morten Sorvig
9fa6e8f627 Clean-up a macro for Cocoa
Remove the usage of Q_MAC_USE_COCOA and Carbon code paths.

Change-Id: Ib569ad8c6d9ffe258f454b3c3b06e95294a10112
Reviewed-on: http://codereview.qt-project.org/5100
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Sanity-Review: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-10-10 07:47:58 +02:00
Jason McDonald
b4de0b1721 No need to return after QSKIP.
QSKIP already causes the test function that calls it to return, so the
returns removed by this commit were unreachable.

Change-Id: I1fa2f3a3271927d8a600b02d8b31bd81db9146b1
Reviewed-on: http://codereview.qt-project.org/6188
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-07 04:30:30 +02:00
Jason McDonald
924d810dbd Avoid using QSKIP in lieu of compile-time checks
QSKIP is intended to be used to skip test functions that are found at
run-time to be inapplicable or unsafe.  If a test function can be
determined to be inapplicable at compile-time, the entire test function
should be omitted instead of replacing the body of the test function
with a QSKIP, which only serves to slow down test runs and to inflate
test run-rates with empty, inapplicable tests.

Task-number: QTQAINFRA-278

Change-Id: I95feba3edbfa092c0ef4d85bb8c6877bd6be698e
Reviewed-on: http://codereview.qt-project.org/6128
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-07 04:30:30 +02:00
Pierre Rossi
614b9efcf5 Fix QFont::defaultFamily() in the new QPA world.
This is so that the results of LayoutTests in WebKit are
more in line with what things were like in Qt 4.8.

Change-Id: I25962e03bd8e0316cb303c0d94c25ac4e73ea9a8
Reviewed-on: http://codereview.qt-project.org/6162
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2011-10-07 00:43:26 +02:00
Jason McDonald
454f6f43dc Remove obsolete QMatrix test function.
The operator tested by this function (QMatrix * QRect) has not existed
since Qt 2.x.

Change-Id: Id09154de2bdda70c0fe342fe78b82709953e2b56
Reviewed-on: http://codereview.qt-project.org/5965
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-06 01:28:04 +02:00
Jason McDonald
1fad83bac6 Remove last remnants of symbian in autotests.
Change-Id: I91489614653cfe4bcf16b723976e33531402a464
Reviewed-on: http://codereview.qt-project.org/5948
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-06 01:27:58 +02:00
Samuel Rødal
677cf76340 Prevent QPixmapCache potentially growing indefinitely.
QPixmapCache has until now refused to throw out shared pixmaps, i.e.
ones that still have shallow copies lying around. This leads to problems
when someone inserts two shallow copies using different keys, causing
the cache itself containing multiple shallow copies and thus forever
refusing to throw out those entries.

It's rather easy for this to accidentally happen in a user application
since QPixmap::load() or QPixmap(const QString &fileName, ...)
automatically cache the pixmap in the QPixmapCache, thus if the user
then calls QPixmapCache::insert() on the same pixmap or a shallow copy
it is locked in the QPixmapCache forever.

The only reason for not throwing out a pixmap that's shared would be to
prevent re-loading a pixmap from file when a user has a direct reference
to it in his application, but in that case the user is unlikely to
re-load the pixmap from file in any case. Therefore it seems the best
fix is to get rid of this limitation.

Task-number: QTBUG-21359
Reviewed-by: John Brooks
Reviewed-by: Olivier Goffart
(cherry picked from commit 7ab0bed3a56d46c386e65abc381264c57137cb43)

Change-Id: I46dce19227e19a25e0287cf7372177430da15a66
Reviewed-on: http://codereview.qt-project.org/4563
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
2011-10-03 11:55:32 +02:00
Friedemann Kleint
f18b690cca Tests: Fix compilation on Windows.
Replace Q_WS_... by Q_OS_... in corelib tests.

Change-Id: I14c41dca1ec490b3c49ba2c24e60def14c6de9da
Reviewed-on: http://codereview.qt-project.org/5778
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-03 07:57:41 +02:00
Jason McDonald
0cf6baa2d6 Avoid using QSKIP in lieu of compile-time checks
QSKIP is intended to be used to skip test functions that are found at
run-time to be inapplicable or unsafe.  If a test function can be
determined to be inapplicable at compile-time, the entire test function
should be omitted instead of replacing the body of the test function
with a QSKIP, which only serves to slow down test runs and to inflate
test run-rates with empty, inapplicable tests.

Task-number: QTQAINFRA-278
Change-Id: I31e069f5476f8adf9851e94b33c6afac4394b88e
Reviewed-on: http://codereview.qt-project.org/5824
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-03 03:34:57 +02:00
David Faure
b863df7de9 Rename Qt::escape to QString::toHtmlEscaped, add compat method
Merge-request: 56
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>

Change-Id: I46bbb2df10968e88b5eb5ef8dae182a651b622b8
Reviewed-on: http://codereview.qt-project.org/5793
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2011-09-29 15:22:07 +02:00
Jason McDonald
95cebd34eb Remove Symbian-specific code from tests.
Symbian is not a supported platform for Qt5, so this code is no longer
required.

Change-Id: I1172e6a42d518490e63e9599bf10579df08259aa
Reviewed-on: http://codereview.qt-project.org/5657
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-09-29 06:41:42 +02:00
Holger Ihrig
f57f01e201 Re-enabled test that was marked insignificant and passes
Added comment why QVariant Autotest is marked insignificant

Task-number: QTBUG-21424

Change-Id: I5b911bd36e376ad529342055180ff9c5de19de67
Reviewed-on: http://codereview.qt-project.org/5399
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-09-26 07:50:20 +02:00
Holger Ihrig
56b7ee1dae Re-enabling tests that were marked insignificant but not failing
Task-number: QTBUG-21402

Change-Id: Ibcc2cff81aff669c02b1b7b2c0cb599646b0dd61
Reviewed-on: http://codereview.qt-project.org/5455
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Matthew Cattell <matthew.cattell@nokia.com>
Reviewed-by: Jo Asplin <jo.asplin@nokia.com>
2011-09-23 13:51:59 +02:00
Joona Petrell
3f311a5b3a Add autotest for QInputPanel
Change-Id: I8ac28d93f610cd3eb69087d2c961a5aab6c47e1e
Reviewed-on: http://codereview.qt-project.org/5394
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-09-23 11:09:19 +02:00
Jiang Jiang
8b4e40f535 Support adding application fonts with QFontconfigDatabase
QFontDatabaseQPA should be able to reinitialize database and
reregister all the fonts when an application font is added, because
it will trigger db->invalidate().

Add cloneWithSize support to QFontEngineBox so that even no usable
font is found in QFontDatabase, QRawFont::setPixelSize can still
work (without making the result rawfont invalid).

Register application fonts with QFontconfigDatabase, the code is
adapted from QFontDatabaseX11.

Reenable QRawFont tests for QPA, these usages are now supported in
QPA.

Fix QStaticText tests, raster in QPA does support transformations.
Translate the text before ZAxix rotation so that it will be visible
in canvas.

Add back fixedPitch support to QPA, and fix QFontDatabase tests.

Fix QGlyphRun tests, ignore non-existence glyphs in alphaMap
locking.

Fix QFontMetrics tests.

Task-number: QTBUG-21415, QTBUG-20754, QTBUG-20977,
             QTBUG-20976, QTBUG-20760, QTBUG-20759
Change-Id: I24aea7d6ec6b2ac6342134d1f2591327c23a692b
Reviewed-on: http://codereview.qt-project.org/5384
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2011-09-23 10:48:37 +02:00
Kent Hansen
b8d656d878 Fix autotest gui/widgets dependencies
This is in preparation of removing testlib's
dependency on QtGui and QtWidgets.

Autotests that need QtWidgets api must
explicitly include it (since the types are no
longer provided by the QtGui master header).

Autotests that don't need QtGui or QtWidgets
api shouldn't link against those libraries.

Change-Id: I2808289068514fcac582808828ad4634e2631733
Reviewed-on: http://codereview.qt-project.org/5093
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-09-19 10:24:25 +02:00
Frederik Gladhorn
4b3a551e05 Fix include path.
Reviewed-by: Gabi

Change-Id: I99b08f8b41f483c92ae175630b812e4b299069b6
Reviewed-on: http://codereview.qt-project.org/4916
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
2011-09-15 20:39:28 +02:00
Samuel Rødal
5bb0c7c5ca Fixed crash in tst_QPathClipper.
QPathClipper uses QPainter which requires QGuiApplication.

Task-number: QTBUG-21402
Change-Id: If08b0ddee97cad347450fa06878f787e94292854
Reviewed-on: http://codereview.qt-project.org/4777
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-09-15 09:11:35 +02:00
Samuel Rødal
b6389bb6d4 Fixed tst_QIcon::task184901_badCache().
QIcon has not been moved to QtGui after all, re-introduce
QtWidgets-dependent code path.

Task-number: QTBUG-21402
Change-Id: I61c37babaeceadf7d53c10736bcc847758adaf1b
Reviewed-on: http://codereview.qt-project.org/4775
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-09-15 09:11:35 +02:00
Samuel Rødal
d6f971c854 Fixed tst_qpixmap::grabWidget().
prepareToRender() might call adjustSize() resulting in the widget's size
changing, so we should make sure to call adjustSize() _before_ we decide
on the required pixmap dimensions.

Task-number: QTBUG-21402
Change-Id: Ie72b46bc8e8e22f848769f78187f47ae9f4e37d3
Reviewed-on: http://codereview.qt-project.org/4772
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-09-15 09:11:35 +02:00
Gunnar Sletta
b62bd0584a Merge branch 'refactor'
Conflicts:
	mkspecs/qws/linux-lsb-g++/qmake.conf
	src/gui/image/qpixmap_mac.cpp
	src/gui/painting/qpaintengine_x11.cpp
	src/gui/painting/qtessellator.cpp
	src/gui/text/qfontengine_qws.cpp
	src/gui/text/qfontengine_x11.cpp
	src/gui/widgets/qlinecontrol.cpp
	src/opengl/qgl.h
	src/opengl/qgl_x11egl.cpp
	src/plugins/plugins.pro

Change-Id: If52dcd55cd55f2983a756c2f843967702b60a310
2011-09-13 08:54:45 +02:00
Jo Asplin
831a160e00 Disabled tests for refactor->master integration
This change disables failing tests to increase the
likelihood that 'make check' terminates with a zero
exit status. This is done to prevent the CI system
from blocking further commits once qtbase#refactor
is merged into qtbase#master.

Failing tests are marked as insignificant (by putting
'CONFIG += insignificant_test' in the .pro file).

Note: This is a temporary measure that needs to be cleaned up
once the refactor->master integration is complete.
Ideally all disabled tests need to be enabled and passing.
All changes will be marked by the string QTBUG-21402 in a comment
for easy location.

Task-number: QTBUG-21402
Change-Id: Ic4400671671f6d9b75b106a6aa4755b20e74378d
Reviewed-on: http://codereview.qt-project.org/4678
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2011-09-13 08:25:05 +02:00
Jo Asplin
9360ee1605 Disambiguated access to touch event API in QTestLib
Commit 079ec157f8 overloads
the touch event API in QTestLib so that QWindow * can be
passed directly to certain functions.

This fix disambiguates access to the new API by selecting
the QWindow * versions. This assumes that the QWidget *
versions are kept mostly for backwards compatibility.

Change-Id: Ib6b33edc64d81f300d4109d59fd29f25ccd605db
Reviewed-on: http://codereview.qt-project.org/4443
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-09-08 16:00:30 +02:00
Jo Asplin
a4e6b04419 Mark test as insignificant
This change was missed out from a90f50942e

Task-number: QTBUG-21133
Change-Id: I7365562c79515eb52221bff8bb4fbb9987c7425c
Reviewed-on: http://codereview.qt.nokia.com/4123
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2011-09-05 14:14:58 +02:00
Sergio Ahumada
5638da4de2 tests: mark `qstatictext' as using private API
This autotest is using private symbols, available only when Qt is
configured with -developer-build.

Change-Id: I9bf221040b8225ed173761c7ee23e69efd85c3cb
Reviewed-on: http://codereview.qt.nokia.com/4148
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jo Asplin <jo.asplin@nokia.com>
2011-09-05 10:24:04 +02:00
Jo Asplin
a90f50942e Moved gui autotests into new directory structure
Task-number: QTBUG-21133

Change-Id: I83b8f652935cf92151265ca2530a3cf81c31fdef
Reviewed-on: http://codereview.qt.nokia.com/3996
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jo Asplin <jo.asplin@nokia.com>
2011-09-01 10:59:49 +02:00