Several of the test functions in the QDebug autotest call
qInstallMsgHandler() to temporarily use a custom message handler.
Unfortunately, these test functions were then resetting the message
handler back to Qt's default handler at the end of the test.
QTestLib also calls qInstallMsgHandler() to set a message handler that
redirects debug/warning/fatal messages into the test log. When the test
resets the message handler back to Qt's default handler, testlib's
message handler is bypassed for the rest of the test, preventing any
subsequent debug/warning/fatal messages from being visible in the test
log or subject to testlib's ignoreMessage() function.
This error also caused several of the test functions to fail if they
were run manually. The "defaultMessagehandler" test would fail if it
was run before any other test function and the "assignment" test would
fail if it was run after any other test function.
This commit fixes these failures by using a helper class to ensure that
the previously active message handler is restored at the end of each
test function, even if the test function fails or throws an exception.
Change-Id: I51376724d164c8ad126e5b9be76890bf3e6a9fb0
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
When verifying nonzero results (i.e. that something expected *did* happen),
using these macros allows bailing out of the timer much earlier than the
potential 5 seconds.
My running this on Linux goes from ~147 seconds to ~91 seconds.
Change-Id: Ie1e41252eb4eb295b5c8e795ded02f00eb7f9387
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Don't call QSKIP when omitting the optional part of the test, as doing
so hides the fact that the rest of the test passed.
Change-Id: I9c102e8daeaf9586b2e510c4c9ce697ead290795
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use QTRY_VERIFY() to fail after a reasonable timeout rather than putting
the test into an infinite loop.
Change-Id: Ie0917556e15999a94cc0587f3f4c11c0d743a228
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Register the meta-type in initTestCase(), which is run once, rather than
in init(), which is run before every test function is run.
Change-Id: Ic62a2469da6a2a85254ffc7c4d893395202c50d8
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
The threadCount() test function is unstable and had been disabled by
making it not be a slot. It is better to disable it with QSKIP so that
the test output shows that the test function exists and is in need of
repair.
Change-Id: Iccdc8da31e0d15d922f7e9606835d1ff1a3a4966
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Avoid using bug tracker identifiers in test function names. These
identifiers lose their meaning when the bug tracker is replaced.
Change-Id: Ia867f7c2ec2ab9ed546588843d532ac615a34031
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
The restored test data was marked as failing, but appears to pass, and
the available history does not explain why it was commented out.
Change-Id: I7e9e3ba72fc8fef42c91ee882efa98d25b3d8317
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
When using QSignalSpy, always verify that the signal spy is valid. This
will cause the test to give a meaningful failure when spying on a
non-existant signal. Without this change, tests that spy on a signal to
ensure that it is not emitted (i.e. by comparing the spy count to zero)
could pass erroneously if something went wrong when creating the signal
spy, as an invalid QSignalSpy will always return a count of zero.
Change-Id: I41f4a63d9f0de9190a86de237662dc96be802446
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
The data file named "trolltech" has nothing specific to Trolltech in its
contents. Rename it to "testhtml". The lack of a file extension is
intentional.
Task-number: QTBUG-19653
Change-Id: Idc5c5f4ffa447151e47f66ff7364f0fa8753a699
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
We need that information to perform some optimizations in QVariant.
Change-Id: Id9a1716e49e4cedd17cd09a32fea4ff003ef61f2
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
For some strange reason "Object::method ..." was printed, without
the leading Q.
Change-Id: I10b99e8aa8730e4020d15b3e04a01004bade76c3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
Updated three instances were not using QFINDTESTDATA.
Change-Id: Ibd0f6734791fc5d98ebeb65ac3bd80aa1c076414
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
If both a stop and start happen within an event loop, ensure they are
processed in order.
Based on a patch from Charles Yin.
Task-number: QTBUG-22865
Change-Id: I6131bd43a6ba5ad4fa37c863a9f4598bf2ac0e01
Reviewed-by: Leonardo Sobral Cunha <leo.cunha@nokia.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
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>
This also adds a unit test for length()/count()/size(), since there wasn't one
testing it explicitly.
Change-Id: Ifb7f113aa97beef5f76e5fb246eb38495344b0ad
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Marco Schmidt <Marco.Schmidt@Taugamma.de>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
The test generates the runtime_resource.rcc data file at build time. Add
this to .gitignore.
Change-Id: Ief4057072b28499049147b86f166523b71afe269
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Even though it is stated in the documentation that the SQL driver must
remain valid during the life time of QSqlQuery, there are users who don't
follow the rule. It's common that the destructor of QSqlQuery is called
after the driver is already deleted. This fix checks the validity of
the SQLite driver before QSqliteResult uses it in destructor.
Task-number: QTBUG-16967
Change-Id: If0f52113f12e14102da1671cd6e12bdaa267114f
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
The overload is used in Qt Creator
(see src/libs/extensionsystem/pluginmanager.cpp).
The use case here is an application whose internal
QObjects can be tested by passing a command line parameter.
For this use case, it is inconvenient to have to allocate
memory and create a char argv[]- array.
This reverts commit ad80d42f8e.
Change-Id: I2a2f91e2840100fd62743f6d03b33005d67b18f8
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
QWeakPointer is superior and preferred.
Remove QMetaObject::addGuard(), QMetaObject::changeGuard(),
QMetaObject::removeGuard(), and QObjectPrivate::clearGuards().
Implement QPointer using QWeakPointer<T> instead. This changes the
behavior of QPointer in 2 ways:
- During destruction of a QWidget. Previously, the destructor of QWidget
would reset all QPointers so that they would return zero when destroying
children. Update tst_QPointer to account for this change.
- When constructing a QSharedPointer to take ownership of an object
after a QPointer is already tracking the object. Previously, the shared
pointer construction would not be affected by the QPointer, but now
that QPointer is implemented using QWeakPoiner, constructing the
QSharedPointer will cause an abort(). Fix tst_QSharedPointer by
removing the use of QPointer in the objectCast() test.
These behavior changes are documented in the QPointer class
documentation and in the changes file.
Change-Id: I92d0276219c076ece7bcb60f6e1b9120ce4f5747
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
- Check path/fileName is empty upon failure, variable was unused
- Use /home instead of /, as / is writable by admins on Mac
Change-Id: I705471fda8b73843e98b30eb52aa0a73634ec075
Reviewed-by: David Faure <faure@kde.org>
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>
QMessageBox was being used to test nested event loops. This has been
changed to use QEventLoop directly.
Also, there was an unnecessary use of QPushButton to trigger a test
case, which has been removed.
As a result, 3 test cases can be run on VXWORKS, and one more test case
on Windows that were previously skipped.
Change-Id: Ic65ed441cd37d242f89df3ef3b8638a1458d9cf3
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
tst_QTcpSocket::disconnectWhileLookingUp required the host lookup +
connect + disconnect procedure to complete in <50ms, which is not always
true.
When disconnecting (rather than aborting with close()), wait for the
disconnection to complete with a timeout of 5 seconds.
Task-number: QTBUG-21043
Change-Id: I3b59abf9a8eb2c6d99416e1a8ec6b528885b656e
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
The executable needs to be in the test directory
as it expects it sub-executables from there.
Breakage introduced by 3385fb91e1
Change-Id: Ic1f3db70851f65e2f12041c3a16cb8f0b7bdf35e
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Commit a72468e820c2922540737c053eef27d033c2e77b split the test into two
functions, but kept them combined in a single slot for QTest to invoke.
That being the case, we might as well have them as test functions of
their own right. Should work nicer with test failures, skips and such.
Change-Id: I62c1fc7777c08b3e87a5903632d73dc1e1d97e1a
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
- 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>
- Use correct overload for QTranslator::translate()
- Fix LTR source text
- Use QDir::TempDir correctly (check for slash).
- Do not copy executable on Windows (which is locked), use
arbitrary data instead.
- Use Q_OS_MAC
Task-number: QTBUG-21402
Change-Id: I6ba1c7c764d4c847278eaff9a96c8cd312ac204d
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
In case a subprocess fails to start.
Change-Id: I1372c07de8f3580a8e7aadd6874da15bf273ac53
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
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>
setSocketDescriptor fails because socket is in the wrong state.
This is timing dependent, if qt-test-server is still in the DNS cache
then the test failed.
- clear the DNS cache to avoid the host lookup state being skipped.
Change-Id: If159d514b1aa9b62a4834f6352d5e7b0a00a5724
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Target names with spaces must be quoted.
Change-Id: I913ef386353fc75991c8db4e3205ab511fc1f1a9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
To follow the comments in the review by João Abecasis.
Change-Id: Ie566705d3b4071b8628d269246aadcde4866f34f
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
mkdtemp(10*X) replaces all 10 chars on Mac, while on linux it only
replaces the last 6. Adjusted the too-strict tests to allow for
both possibilities.
Change-Id: Ie6d57bd4947254ad7a39e75ac0e8881cebeaa428
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
- Do not run with empty environment. At least PATH
is required at least (Qt + MSVC/MinGW runtime)
- Account for MSVC's different formatting of double numbers.
Change-Id: Ic7b1cf4a16a88c5384347b2651b011ac13c92d70
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
This is needed in order to expose the enums to qml.
Do not inherit QAccessible.
Change-Id: I220a0ea3add2d790e4fa6e93ce3deda762859e1a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
The overload of QTest::qExec() that takes a QStringList is not used
anywhere in Qt's autotests, despite having been in the qtestlib API
since Qt 4.4.
This lack of use most likely derives from the fact that none of the
QTEST_MAIN macros use the overload, and more than 99% of Qt's tests
use those macros to avoid explicitly calling QTest::qExec().
Change-Id: I264b21d7fe1a9f2d565f748cf8bbe32414a73bb0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Which currently causes tests not to compile on Windows
due to missing symbols in QtWidgets (QSound::QSound() ,etc).
Change-Id: I87f0a403e61c3a67f9a758f114e33db1012e33e8
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
The docs say this is required, but we don't check it and instead
segfault right now.
Change-Id: I825b00a312a481c5383af127333c0c4698188348
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
QTRY_VERIFY waits for a condition to become true while regularly
processing events. There is no need for a custom solution to this
problem.
Change-Id: Ia65c90cbdb165b543f5c78f9bac3cfadd77dfb3f
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
QTRY_VERIFY waits for a condition to become true while regularly
processing events. There is no need for a custom solution to this
problem.
Change-Id: Ia23e2fb61cdc5c3a3a8a729cd4356ba930fe7cb7
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
When using clang, the forward-declaration test fails to link, unlike
with other compilers. The standard says that deleting a forward-declared
pointer is undefined behavior, so the link failure is a valid result of
trying to do so.
Change-Id: I527b91c15b7d51d9522d95af0630e7dacd26bb30
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bind() test failed if there is an autoconfigured IPv4 address.
e.g. bluetooth adaptor that is not attached to a network.
Or WLAN adaptor in peer-peer mode.
- solved by skipping the autoconfigured IPv4 addresses in the same way
as IPv6 addresses are already skipped
bind() test fails for proxy
- skipped, QTBUG-22964 created
Change-Id: I9a799ae8db421783f474e97cf876d6e265516397
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
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>
The subtests are intended to be executed by tst_selftests and therefore
don't need to have "CONFIG += testcase", which causes 'make check" to
treat them as stand-alone tests.
Change-Id: I1b47e0186be99c591bb1e03bbec6386518f8a449
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Make the test object names correspond to the test program names, so that
it is easier to see which test produced each block of test output.
Change-Id: Ib19a955938b549f27cdcaac83bfa9150285b396d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
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>
This test uses qt.conf to enforce a predictable tests install location.
This was not working in the shadow build case, as qt.conf was only
present in the source tree; embed it as a resource at :/qt/etc/qt.conf
so it works in the shadow build case too.
Change-Id: Iec708d9686c29a1fc5ff0020dc11a93a593d20c5
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
As discussed on qt5-feedback / development lists.
Change-Id: If1733369d12daa29054776ec2cbd78e63679768e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
In tst_qsql, there are function calls to QApplication(argc, 0, false), where
argc is zero. According to the documentation, argc must be greater than
zero and argv must contain at least one valid character string. The
misuse of this API has no problem on any platform other than Mac OS. This
commit has fixed the crash by passing valid dummy parameters.
Task-number: QTBUG-22811
Change-Id: I42b26d66f0becb7a942896e6ddcaea52ff720a48
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
After commit 79f675a1e0, the connect and
disconnect callback API effectively becomes useless. Now that these
callbacks cannot/do not, it makes little sense to keep the backdoors
added for Qt Jambi support.
Remove them for now. Should the Qt Jambi team want/need to port to Qt 5,
we can re-add them, possibly designing a better API for doing so as
well.
Change-Id: I6209a1d647d683c979d5294b632b8c12c0f9f91c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
QSqlRelationalTableModel doesn't follow relations on the first column
of a table. The DisplayRole and the EditRole for indexes on column 0
are always the same. The bug is found in QSqlRelationalTableModel::data.
Task-number: QTBUG-20038
Change-Id: Ie1e98b5f46ffc171113f2d51b9b19ff5febb1c3c
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
This is a source incompatible change. There is concern that the
convenience of the implicit cast and assignment operators can lead to
misuse. Several commits have already been done that remove excess use
of the implicit cast, which is a *volatile* read every time it's used.
Users of the QAtomic* API should have to think about when they are
loading the value, and if they do or don't need the acquire memory
barrier on load. The code that people would write using this API is
meant to be multi-threaded, concurrent, and correct. The API should not
allow them to inadvertently, possibly unknowingly, shoot themselves
in the foot.
SC-break-rubber-stamped-by: Lars Knoll
Change-Id: I88fbc26d9db7b5ec80a58ad6271ffa13bbfd191f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Rename the new interface after the old one has been removed.
This interface is very close to the IAccessible2 Table2 interface.
Change-Id: I8659232189fe0e8307151c743727de425c30ac9a
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
The test fails if the repository is checked out with
Windows line endings. Try to work around.
Basically, ensure that common developers can conveniently
run the test.
Change-Id: I91f31b830ba7ba305deea782737d4e07a89420eb
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
This is sent when the object's name changes.
tst_moc must be updated since the method count of QObject has changed.
The test assumed that there were 4 invokable methods in QObject. The
new signal is the 5th, which breaks the test's assumptions. Fix this
as well.
tst_QObject must be updated since the
QObjectPrivate::isSignalConnected() method only supports the first 64
signals. With the addition of this new signal, sig61() in the test
becomes the 65th signal, and will always appear connected now.
Task-number: QTBUG-13999 (related)
Change-Id: Ie87893c71a231fafa7ccf2f16102238a7be8327a
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
When listening on QHostAddress::Any, serverAddress() should return
QHostAddress::Any too, assuming that setting the socket options
was successful.
Task-number: QTBUG-22899
Change-Id: I50a9ff1b4ad0c1c1905e2952c595d7068df2627d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
By adding anonymous namespace and static linkage we are reducing
visibility of implementation of these macros.
This patch also fixes warning about a declared but unused variable which
was issued by gcc 4.6 for Q_CONSTRUCTOR_FUNCTION.
Change-Id: I2cb70ad4c93f6f77e5518420abcce6fd4cadccfa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
On Windows (only), this test depends on some Q_AUTOTEST_EXPORT symbols.
Change-Id: I3b2ef8dcd56b8860f02fc28f45823b889e794909
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Automated tests often need to load some data from external files.
Currently, a wide variety of approaches for this have been used in Qt
autotests, including:
- embed the source directory into the test binary at compile time, and
find the testdata relative to that; this fails when the source tree
is no longer available (e.g. when the tests are deployed to a device).
- use a path relative to the current working directory, and trust that
the caller always sets the current working directory such that the
testdata can be found; this fails when the caller uses a different
working directory than expected.
- use a path relative to QCoreApplication::applicationDirPath();
this fails when source tree != build tree (since testdata is not
automatically copied into the build tree).
- compile the files into the binary using the Qt resource system; this
should work, but does not allow for testing of code which genuinely
needs external files.
It seems that there is not a simple method for determining the testdata
path which can be reliably used in all circumstances, so various tests
have reinvented the testdata location method in different ways.
Therefore, this is a good candidate for an addition to the testlib API.
The current implementation of QFINDTESTDATA is able to find testdata
in all three of (build tree, install tree, source tree), in that order.
Change-Id: Ib2fed860723ccf437240da3b00db22dfe1a6b56c
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
In .pro files, removed wince/symbian-specific DEPLOYMENT cases and
replaced them with TESTDATA where appropriate.
In .cpp files, removed SRCDIR and relative paths to testdata and
replaced them with the QFINDTESTDATA macro where appropriate.
Modified test helper apps/libs to install themselves under the test
they relate to.
This change allows corelib tests to be correctly installed, along with
their testdata, via `make install'.
Change-Id: I5e202e2f3b577af7e39072d5c9fe13e0ca125304
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
The QString autotest shares test data between the remove() and replace()
tests because those functions are very similar. Unfortunately, when an
integer overflow bug was found in remove() the regression test was not
shared with replace(), which prevented the same integer overflow bug
from being discovered in replace().
This commit improves the test by sharing the overflow test data between
both functions, thus demonstrating the remaining bug.
Task-number: QTBUG-22967
Change-Id: I2778249800f74799d890eefa9227ca8ddd8fbaa3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Rename the qUncompress test to make clear that the test only deals with
uncompressing corrupted data and add a message making it clear that this
test will produce some warning messages.
Don't skip creating the test data, as that prevents the test output
reporting exactly what is skipped.
The expected output is the same for every row (an empty QByteArray), so
don't bother storing that in the data table.
Change-Id: I59f1cc91a941bcaadacb2a613dd5eca2564961c1
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
QWinEventNotifier is an essential class if you're using native Windows
Overlapped IO and need to convert it to Qt signals. However the header
is marked private.
Task-number: QTBUG-68
Change-Id: I22e9a84da97f969ddb82e9ba15e604a01abd80d0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
QHostAddress(QHostAddress::Any) was not equal to QHostAddress::Any
because only one of the operator== overloads was handling this.
Task-number: QTBUG-22898
Change-Id: Ifd36947a50e8c36362b4e850fd8d5105ee0925ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For compilations without variadic template support
Change-Id: I78af4f6022ad7a0923e5c5788a34eb7d834f50f3
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
If an ongoing query is not finalized before close function is
called, sqlite driver still tries to close the connection to
sqlite. In this case, sqlite reports an error to sqlite driver
which is not reported to the client. The failure in close causes
connection to sqlite unclosed and memory is not freed. This
fix tries to finalize all queries before close function is called.
The close function should succeed.
Task-number: QTBUG-16967
Change-Id: I2f10a2a9017446a9d44b693b00464a89625e3602
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Currently there seems to be no precise definition of what
an integrationtest is in the context of Qt testing.
To avoid confusion, the tests under integrationtests/ are
moved into other/ (which is effectively where we keep
tests that don't clearly fit into any other category).
Tests can be moved back into an integrationtests/ directory
at a later point, should an unambiguous definition be established.
Change-Id: I3bb289be2dc2aca11b51a8ce8fcc5942f06d6c5c
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Remove references to the old bug tracker. The data from the old bug
tracker is no longer accessible, so these markers are meaningless.
Change-Id: Ib9d029d52b70fd0a512b9532d65f03763eabfe57
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
For queued connections, the args[0] is set to null as it make no sens to
forward the return value to the signal.
So we need to check in the operator, that the pointer is not null.
(container.data is args[0])
Change-Id: I80bde66f1ec19de0f4962c80e5b2797d2819075c
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
This commit also improves the related documentation a bit.
The test is copied from the test with the old syntax, but all the
connection statement are changed to use the new syntax
Change-Id: Ia5630ca4335b9f8ca6d724ae3c8750d6f0804d8e
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Before, the constructor was called for complex objects, but
POD were left unitinialized. Now, they are zero-initialized.
Also add test for return values
Change-Id: Iff9bf6687589d7b7395a71fb6f650ab8aa2b6bd1
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
This add an overload to disconnect which is symetrical to the new
syntax of connect.
It is possible to diconnect connection like this:
QObject::connect( sender, &Sender::valueChanged,
receiver, &Receiver::updateValue );
QObject::disconnect( sender, &Sender::valueChanged,
receiver, &Receiver::updateValue );
This overload only work with pointer to member function, and not static
functions or functors.
The test is copied from tst_QObject::disconnect(), just
changed the syntax of the connection and disconnection
Change-Id: Ia8f819100cb12098e32877522b97b732b1e676a8
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Centralise the specification of the default ssloptions to make the code
clearer and more testable.
Change-Id: I4f4bae72736dd063ee4cd64c6375e82d0600a105
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Partial revert of 94fc875079. All dependent
modules need to be specified in the QT variable, except core and gui, which
are there by default.
Change-Id: Ie8ffed56de03a37da191772fa321ed162e44a50d
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
MSVC cannot decide on an overload for pow().
Change-Id: Ied3fbc0de403774d9f85738852cf671ce42cd1c1
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>