Commit Graph

1122 Commits

Author SHA1 Message Date
Peter Hartmann
1ddecb0aa2 network auto tests: add QNetworkReply test for pipelining
Reviewed-by: Markus Goetz
Task-number: QTBUG-21369
(cherry picked from commit a32bfdef6d6b45c916f143dcf8495a2e102c3eec)

Change-Id: Iecde23c56f128008c5172675601928d83180358a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 21:58:57 +01:00
Sami Rosendahl
b9acd85b2f Fix crashes and non-portable functionality in QDBusDemarshaller QByteArray extraction
QDBusArgument QByteArray extraction operator and QDBusDemarshaller that
implements the extraction do not check the type of the extracted value.
When extracting a QByteArray when the value actually is e.g. a struct of
mixed types the byte array extraction will crash as it attempts to extract
the struct data as a fixed array.

The fix adds DBus type checks to QDBusArgument byte array extraction
operator implementations.
The checks invalidate extracting arrays of other types than bytes to a
QByteArray that worked with the unchecked implementation. The rationale
for this restriction is
1) extracting a QByteArray to a variant checks already that the array
   element type is byte
2) Results of extracting arrays of types wider than a byte to a QByteArray
   are architecture-dependent making such code inherently non-portable.

Task-number: QTBUG-22840
Change-Id: Ie20f2adc06c697a68055c803215fb408568fdd90
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 21:58:57 +01:00
Sami Rosendahl
b4398dc4e3 Fix crash in QDBusDemarshaller QStringList extraction
QDBusArgument QStringList extraction operator and QDBusDemarshaller that
implements the extraction do not check the type of the extracted value.
When extracting a QStringList and the value actually is e.g. an array of
bytes the string list extraction will crash as it interprets the bytes as
char pointers.

The fix adds DBus type checks to QDBusArgument QStringList extraction
operator implementations.
The checks are as permissive as possible provided crashes are avoided.

Task-number: QTBUG-22840
Change-Id: I4b67d75b59c5052d939f3a69f3e92dabdb3bdd6b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 21:58:57 +01:00
Sami Rosendahl
8f19f14274 Fix crash in QDBusDemarshaller basic string-like type extraction
QDBusArgument string extraction operators and QDBusDemarshaller that
implements the extraction do not check the type of the extracted value.
When extracting string-like basic DBus type that actually is e.g. an
integer the string extraction will crash as it blindly attempts to use the
integer as a pointer to char.

The fix adds DBus type checks to QDBusArgument string type extraction
operator implementations.
The checks are as permissive as possible provided crashes are avoided.
Previously supported functionality of extracting an object path or type
signature to a string type is retained.

Task-number: QTBUG-22840
Change-Id: I29be1ae592658ca268c65ed692e1d42619d52280
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 21:58:57 +01:00
Jason McDonald
bca775edaa Improve QSettings autotest
QTestLib-based autotests cannot perform verification steps in the test
class constructor.  This needs to be done in initTestCase() instead.

Change-Id: Ib1f7f838f052fa0fc5104603bdac01ffd8313aef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 20:19:46 +01:00
Jason McDonald
f4c7bbba13 Remove empty functions from QSet autotest.
Change-Id: Id6fac3a83e3f4385ee1978a19e6dc92605f4abdb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 20:19:05 +01:00
Jędrzej Nowacki
fe089823bc Build fix for tst_qprinter with c++11
GCC 4.6 fails to build the test because of narrowing conversion.

Change-Id: I927693789be7f3df7bd1a96c8924fc04716a03f0
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 20:16:55 +01:00
Bradley T. Hughes
ae8c61db21 Finish removing Qt3 support
Remove the (-no)-qt3support options from configure, and remove the last
remaining references to Qt3Support, QT3_SUPPORT, and
QEvent::ChildInserted.

The compatibilityChildInsertEvents() tests in tst_QObject and
tst_QWidget have been renamed to childEvents(), which is a more
appropriate name.

Change-Id: Id0b45e9b177efcc8dceee8c9ed8afafedeeace2f
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-23 11:59:11 +01:00
Sune Vuorela
ef03396072 QCryptographicHash: allow to hash the content of a QIODevice
This adds a new function (and tests) to give the possibility of doing a
QCryptographicHash of a QIODevice, like a QFile or whatever people
needs.

It is a quite handy overload in many cases.

Change-Id: I22fd272f05571844641b3daefcc6746be4e5c7c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-22 19:47:47 +01:00
Shane Kearns
4954f71648 Fix http authentication to a different realm on the same server
This is a regression caused by the NTLMv2 authentication patch.
I have manually tested NTLMv2 authentication against MS IIS and reverting
these two lines does not break it.

Task-number: QT-5209
Change-Id: I64159cbe468e1a7f834f8726fd0c9d4ab4c54b38
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-22 16:10:33 +01:00
Jędrzej Nowacki
ee0a997bcd Fix movablity of QVariant.
After 8fd64d22ac (Make usage of internal
QVariant space.) change QVariant started to "inherit" movablity from
interned type.

This change fix it by interning only movable type in QVariant and by
using external allocation for not movable ones.

Obviously, this change has negative impact on QVariant it self, but
after it, QVariant will behave a lot nicer with our containers.

Change-Id: Ibffc95833918f65be737f52d694ee81a2036c412
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-22 16:09:34 +01:00
Friedemann Kleint
23382669b9 QTestLib-selftest: Unblock on Windows.
Do not run tests that pop up assert boxes.

Change-Id: Idac94398ff1109605eb33a042dab734eafb1a17a
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2011-12-22 15:11:32 +01:00
Jędrzej Nowacki
56f154c747 Allow QMetaType to register information about movability
We need that information to perform some optimizations in QVariant.

Change-Id: Id9a1716e49e4cedd17cd09a32fea4ff003ef61f2
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-12-22 13:20:40 +01:00
Harald Fernengel
d868c9945a Remove QT_NO_STL_WCHAR hack
We don't support gcc 2.95 any more.

Change-Id: I842f1f8ac64b9006516c104add0991830ac9a46a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-22 13:20:40 +01:00
David Faure
c02ca6752a Fix handling of invalid modifiers in QKeySequence.
When decoding a string don't assume valid modifier strings. If a
modifier string is unknown return Qt::Key_unknown instead of skipping
the modifier.
Currently 'Win+a' is decoded to 'A' but should be Qt::Key_unknown.

Change-Id: I1c82031159a8b3c19924a7c9e991bc6b1f90d617
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-22 13:20:40 +01:00
Morten Johan Sorvig
40cfdf30fa Enable Mac style on Mac OS X.
Add styles/qmacstyle_mac back to the build, modify
qstylefactory to load it on Q_OS_MAC.

Move helper functions from platforms/mac to
qmacstyle_mac.mm. QMacStyle should now be self-
contained and not rely on anything from platforms/mac.

Change-Id: I68fe40bb7f88c01269968bffd9579b7f3b932d4c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-22 13:20:40 +01:00
Shane Kearns
4be2430925 Test case for QTBUG-22875
Test the authentication cache works properly with "cancelled dialogs"
or if the user enters username/password incorrectly.
Expected behaviour is based on web browsers:
If cancelled, current request fails, and prompt again the next time.
If wrong password is given, prompt again and retry the current request.
If bad credentials are in the cache, prompt again

Task-number: QTBUG-22875
Change-Id: Ic02ccac8dbeb3f2580ca4ffe47d0773982c4ab25
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-22 06:02:32 +01:00
Shane Kearns
d62228a77e Fix compile error when configured with -no-exceptions
The test was skipped, but still tried to compile code that uses
exceptions. The throwing class it uses was conditionally compiled
out earlier in the file, causing an error for undefined class.

Task-number: QTBUG-23028
Change-Id: Ia2e05a8a0abbf0e913f6c41e85bfee8b85cbc8a5
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-12-22 02:28:09 +01:00
Friedemann Kleint
bc8f25c7e6 QTestlib: Make QImage comparison more verbose.
Introduce a specialization for qCompare(QImage,QImage) that
checks isNull, size and format and outputs verbose messages.

Check isNull, size similarly for QPixmap.

Add an autotest:
- Add test to cmptest and make it a GUI application since
  QImage requires QGuiApplication.
- Make testlib/selftests capable of running X11-GUI applications
  by passing DISPLAY.
- Ignore stderr output for cmptest
- Add test data

Change-Id: I2b29c7822fbeedf2b22c90889739ed7ff859ce92
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-12-21 22:59:28 +01:00
Bradley T. Hughes
cd796404f1 Reimplement QIODevice::reset() properly
The reset() function is not const.

tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp:324:
warning: 'FixedSizeDataGenerator::reset' hides overloaded virtual
function [-Woverloaded-virtual]
    virtual bool reset() const{
                 ^
src/corelib/io/qiodevice.h:112: hidden overloaded virtual function
'QIODevice::reset' declared here
    virtual bool reset();
                 ^

Change-Id: I022d902147f9c8fb71bee8c3e21b963b2d7bec55
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2011-12-21 20:32:42 +01:00
Bradley T. Hughes
f0710e1d95 Reimplement QGraphicsEffect::sourceChanged() properly
sourceChanged() takes one argument, not zero.

tests/auto/widgets/graphicsview/qgraphicseffectsource/tst_qgraphicseffectsource.cpp:125:
warning: 'CustomEffect::sourceChanged' hides overloaded virtual function
[-Woverloaded-virtual]
    void sourceChanged()
         ^
src/widgets/effects/qgraphicseffect.h:104:
hidden overloaded virtual function 'QGraphicsEffect::sourceChanged'
declared here
    virtual void sourceChanged(ChangeFlags flags);
                 ^

Change-Id: If227b7b79c4a2fc3d21f93e371510ddccb408d7d
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2011-12-21 20:32:36 +01:00
Bradley T. Hughes
103c2e3690 Reimplement QVariantAnimation::updateState() properly
The updateState() takes 2 arguments, not 1.

tests/benchmarks/gui/animation/qanimation/dummyanimation.h:54: warning:
'DummyAnimation::updateState' hides overloaded virtual function
[-Woverloaded-virtual]
    void updateState(State state);
         ^
src/corelib/animation/qvariantanimation.h:106: hidden overloaded virtual
function 'QVariantAnimation::updateState' declared here
    void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
         ^

Change-Id: Ieb2e4e0b1f017c51c4fed5bdb874ba30cb056916
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2011-12-21 20:32:31 +01:00
Bradley T. Hughes
58170cea15 Reimplement QAbstractFileEngine::open() properly
The virtual function takes a QIODevice::OpenMode argument, not an int.

tests/auto/corelib/io/qfile/test/../tst_qfile.cpp:1942: warning:
'MyEngine::open' hides overloaded virtual function [-Woverloaded-
virtual]
    bool open(int ) { return false; }
         ^
src/corelib/io/qabstractfileengine.h:118: hidden overloaded virtual
function 'QAbstractFileEngine::open' declared here
    virtual bool open(QIODevice::OpenMode openMode);
                 ^

Change-Id: I92338dacb89c05d8c5cfbf8ce094dc519b84d3ba
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2011-12-21 20:32:24 +01:00
Pekka Vuorela
a32df45bec Remove QInputContext based test from QGraphicsItem tests
Was basically checking that a method call is a method call and
QApplication::setInputContext() sets the input context.

Change-Id: Ia8723fe245f2480d503f0140f61078dc074161fc
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2011-12-20 12:57:38 +01:00
Pekka Vuorela
db55b6aee7 Removed test for obsolete QInputContext
Change-Id: Idb3b909934434f8f55eb6e94aa814840ab628856
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2011-12-20 12:57:38 +01:00
Alan Alpert
cb9b7ceffb Revert "Revert "Add QObject::objectNameChanged(con... signal""
This reverts commit 9b17557f3b.

Justification: Temporary commit, see JIRA task.
Task-number: QTBUG-22985
Change-Id: I3df9eb5fdbdc133349dca5e192dcfcc9e758626c
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-20 11:15:21 +01:00
Jason McDonald
85a77cd5c8 Retire QTest::pixmapsAreEqual().
QTest::pixmapsAreEqual() was left in the Qt4 API for compatibility with
some old tests written for Qt3.  QCOMPARE() is the preferred way to
compare QPixmaps and provides superior diagnostic output when a
comparison fails.

This commit removes QTest::pixmapsAreEqual() from the testlib API and
replaces the last few remaining calls with QCOMPARE.

Change-Id: I051c0e7d3bda072855fcd262d82e8e540619233b
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-20 06:17:42 +01:00
David Faure
8707c09fcd Fix QDir::removeRecursively so it doesn't follow symlinks to directories.
Critical bug... Good thing I had backups of my $HOME.

Change-Id: I43b3a80786c946b0aec797036c1164d436d521f8
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-12-19 20:48:16 +01:00
Shane Kearns
0443a51228 Fix QNetworkReply test cases that use the MiniHttpServer on windows
The "happy eyeballs" connection code means that IPv4 and IPv6 connections
are both attempted for a http request.
For a normal http server, this is no problem, but the MiniHttpServer in
the test code is very simplistic and cannot cope with more than one
client connected at the same time.
On windows this causes all these tests to fail with timeouts.
Changed the MiniHttpServer to listen on IPv4 only instead of Any address.

Change-Id: I81e249997d894d266001da474a351b1f5642599e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-19 19:08:57 +01:00
Olivier Goffart
87679491cb Do not call QueuedConnection slot on partialy destroyed object
This is a regression introduced in Qt 4.8
When QApplication::processEvents is called from a destructor, it is
possible that pending events would still be called on the already
destroyed subclass.
Prevent that by using the same pattern as in QMetaObject::activate

Change-Id: Ida50db07ae089264402dafcde7a41a066479d08b
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-12-19 14:06:12 +01:00
Frederik Gladhorn
74c9f9d83f Accessibility: childAt returns interface
childAt used to return an integer.
Return an interface instead.

Not requiring a direct child to be returned allows optimizing
by bypassing iterating through the hierarchy of accessibles.
For QtQuick this is the only sensible way of implementing this.

The bridges are still responsible for finding the top-most element.

The default implementation in QAccessibleObject is sufficient
to return direct children. The implementation in
QAccessibleApplication is therfore no longer needed.

Change-Id: Id7100dd5bcc3a98de516a7f4a12eaaa41cb46d26
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-19 12:27:45 +01:00
Stephen Kelly
211e434a05 Move proxy and selection models to QtCore.
Change-Id: I71097855cb9e28105238e496778f29f99f7fc84e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-16 13:00:57 +01:00
Friedemann Kleint
92667d14a4 QTestlib-Selftest: Add initTestCase() setting the directory.
Required for launching the sub-processes. The test worked only
when launched locally, not from 'make check'.

Change-Id: I42c9202a7726c3135f94445fb336b2b8241535a4
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-12-15 21:04:27 +01:00
Joerg Bornemann
81a825ea9b fix QMutex warning in tst_QLocalSocket::threadedConnection
Change-Id: I5728af1944e44bd976e51d4f0c0a923deacbeea0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-12-15 15:39:24 +01:00
Giuseppe D'Angelo
be6b29f001 Fix typos in QObject::(dis)connect warnings
For some strange reason "Object::method ..." was printed, without
the leading Q.

Change-Id: I10b99e8aa8730e4020d15b3e04a01004bade76c3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-15 05:48:27 +01:00
Kurt Korbatits
d936fe0858 Fix qimagereader, qmovie and qmake unittest to work in shadow build.
Changed to use QFINDTESTDATA and TESTDATA.

Change-Id: I8684bc191cf8ffb8b531456e32047d582ebc018c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-15 05:48:27 +01:00
Friedemann Kleint
2163f05942 Application-test: Fix location of sub-executables.
Use QFINDTESTDATA to set the working directory
and change the profiles accordingly (as in
the qprocess-test).

Change-Id: I332038728c64214f73ced448e1466ad96c11b3b3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-15 03:56:16 +01:00
Friedemann Kleint
f54916697a QThread-test: Fix test on Windows (timer inaccuracy).
- Tolerate WaitTime - 1 (799ms when expecting 800ms).
- Remove commented-out code.

Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>

Change-Id: Ibe246d47ab7667692386b0f9333150c195948282
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-12-14 23:26:15 +01:00
Morten Sorvig
f950a0f0c0 Make QCocoaWindow independent of NSWindow.
QCocoaWindow now gets resize events from QNSViev
and does not require a NSWindow. QWindow instances
can now be inserted in NSView hierarchies. This is
useful for Qt-as-a-plugin use cases and is needed to
implement QMacNativeWidget for Qt 5.

Change-Id: Ia95ea9c22a15a3e62d1e6543466cff07390c70a2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-14 23:26:15 +01:00
Laszlo Agocs
3064c1bc8c Remove redundant touch processing in QtGui and widgets.
The duplicated hash tables in QGuiApplicationPrivate and
QApplicationPrivate are now unified into one single hash table in
QGuiApplicationPrivate. This also reduced the number of lookups.

The extra processing needed to keep the touch points' first/lastPos
values in sync is now done only once, in QGuiApplication. This
eliminates the performance penalty (for widget-based apps) that was
introduced during the QPA migration.

As an added bonus the patch adds support for touch events arriving
simultaenously from multiple devices. This was broken before: As there
is no guarantee that two devices/drivers will not send touch points
with the same ID, using structures with only the ID as key is
wrong. The proper key is composed of the device ID (that is, a
QTouchDevice pointer) and the touch point ID.

The exported internal function qt_translateRawTouchEvent() has been
removed. This function cannot work properly in the QPA world: It
injected touches into the widget subsystem (QApplication) only which
is wrong, and would result in half-filled touch events due to not
routing the injected data through QGuiApplication. Autotests using
this function are migrated to
QWindowSystemInterface::handleTouchEvent().

Change-Id: I7632781d77f9e0ac4626fd7c9933511c94492156
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-12-14 13:17:19 +01:00
Kurt Korbatits
0c9b050f91 Fix testlib selftests on shadow build.
Changed to use QT_INSTALL_TESTS to install subtests.

Change-Id: I4a2a7bd2d3e7d6da34dbb922bf377bee98cdedb0
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-12-14 07:15:46 +01:00
Friedemann Kleint
ab272fff56 QObject-test: Reorganize subprocess.
On Windows, the signalbug.exe could not be launched since it is
not next to tst_qobject.exe, which is in one of the
'release', 'debug' subfolders.

Introduce a subdirectory structure similar to that of
the QProcess test and use QFINDTESTDATA to locate it.

Change-Id: Ie8f2ede8cb76f22a908cb77517a74076be11fbb7
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-14 07:07:09 +01:00
Jason McDonald
d939dd8791 Improve QStringList test in cmptest selftest.
The old test only verified the behaviour of QCOMPARE when comparing
lists that were different.  Add data rows for comparing empty lists and
non-empty lists that are equal.

Note that testlib currently does not report passing data rows (only
failing rows and completely passing test functions), so the new data
rows do not cause any change in the expected test output.

Change-Id: I137650ce0ca6250cee36bd9cb74b01f8abd4e89c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-14 02:40:31 +01:00
Jason McDonald
4a233f9a90 Give names to data rows in cmptest selftest.
Change-Id: Ia362f0651c8d32602fa13d6639fb8386fe8d9e0b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-14 02:40:26 +01:00
Jason McDonald
9bc546e492 Add testlib selftest for QStringList comparison.
The (disabled) alive selftest contained a test for the QStringList
specialization of the QTest::qCompare template.  This test is unrelated
to the rest of the alive selftest, so move it to the cmptest selftest,
where QCOMPARE is tested.

Change-Id: Ic6f0e491dd3b3ce8b4ca1d49666a099815575eaa
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-14 02:40:17 +01:00
Michael Brasser
a9ad8886fe Fix possible jump in animation timer.
When starting new animations with existing animations running, ensure
we force an update to the timer first, so that the new animations can't
mistakenly start with a very large delta.

This fixes tst_qdeclarativeanimations::alwaysRunToEndRestartBug failure
on slow machines.

Change-Id: Ida4e5dcf0ff792e6bfe0d244b6e969d04d0b20fa
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2011-12-14 02:16:40 +01:00
Friedemann Kleint
abb1c066e5 QImageReader-test: Make more verbose, use QTemporaryDir.
- Add some QVERIFY to check for isNull().
- Use QTemporaryDir to avoid spurious failures in the format
  extension-ignore test (cannot copy to '/tmp/black.jpg').

Change-Id: Ia57ea4daa6b8686d1111c9c27a47666265fa9781
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-13 09:33:49 +01:00
Sarah Smith
0786716ce5 Fix failing unit tests.
The test that was failing was the readFromDevice one - where the
extension is not known.

Looks as though image detection is required in a positive way, that is
it is not enough to say I think I can read this file, and then fail if
the format is "corrupt", you must be certain that the file was intended
to be that format.

In the case of TGA the original format has no magic byte header, and no
consistent way to check if it really is a TGA file.  With 2.0 the footer
was added at the end, so that can be checked for confirming the file is
TGA.  However rejecting files which do not have this means that old TGA
files will not be read.

On a quick survey TGA files that have been used in applications so far
all seem to be 2.0 TrueVision, so for now, lets just reject earlier
files and see how it goes.

Also add reading the tga test file to the readFromDevice test.

(cherry picked from commit 665bc3951709f0d726cb82501a5bca684f3347a5)
Change-Id: I665bc3951709f0d726cb82501a5bca684f3347a5
Reviewed-by: Sarah Jane Smith <sarah.j.smith@nokia.com>
2011-12-13 09:33:49 +01:00
Friedemann Kleint
1a5f5d0056 QClipboard-test: Fix test
- Use QFINDTESTDATA to locate sub-executables
- Remove dependency on QtWidgets, use QGuiApplication everywhere.
- Improve error handling when running sub-executables, prevent
  hangs (Windows)

Change-Id: If8e3be82f855c8be6bdbfc9f9728e8490ed181f3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-13 09:33:49 +01:00
Kurt Korbatits
3c189d9b74 Fix qfile unit test failing on shadow build.
Updated three instances were not using QFINDTESTDATA.

Change-Id: Ibd0f6734791fc5d98ebeb65ac3bd80aa1c076414
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-12-13 07:41:27 +01:00