summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Make QDBusConnection and QDBusServer return an error on default objectsThiago Macieira2015-01-061-4/+4
| | | | | | | | | | The error of "Not connected". This incidentally solves a crash when QDBusServer().lastError() is called but libdbus-1 couldn't be found. Change-Id: Id93f447d00c0aa6660d4528c4bbce5998d9186a8 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Autotest: fix a race condition in verifying a peer D-Bus connectedThiago Macieira2015-01-066-14/+52
| | | | | | | | | | | | | | | On the unit test side, everything is sequential: we first ask for the connection, verify that it is connected, then ask the remote side via the session bus if it is connected. Unfortunately, the remote site may handle things in a different order: it may handle the incoming function call to "isConnected" before doing accept(2) on the listening socket. So, instead, make the local side block until the connection is received on the other side. On the remote, we don't block, instead we use the feature of delayed replies. Change-Id: Ie386938b8b39dd94a9d7e5913668125fb4a3c7da Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Android: Fix QCryptographicHash testEskil Abrahamsen Blomfeldt2015-01-062-0/+11
| | | | | | | Include test data in qrc when building on Android. Change-Id: I611ca24fe8764eb709b6ce27e814840ea919d4f1 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix QCommandLineParser testEskil Abrahamsen Blomfeldt2015-01-061-0/+9
| | | | | | | | | Skip the tests that require building and deploying an external command line application, since that's not how we do things on Android, and it's really not very relevant for that platform. Change-Id: I2c1985687e25fb0cf124b1d57c8ba60e37d2ff96 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix QCollator testEskil Abrahamsen Blomfeldt2015-01-061-0/+5
| | | | | | | | On Android the POSIX implementation of QCollator is used, and this does not support setting other locales than the default. Change-Id: I25d23949341fc555e8be4f6836ae68cc8813cc46 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix QChar testEskil Abrahamsen Blomfeldt2015-01-062-0/+10
| | | | | | | Include test data in qrc when building on Android. Change-Id: Id80623324788dac21bd5ddbeef8108f54d6bc8f7 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix QByteArray testEskil Abrahamsen Blomfeldt2015-01-062-0/+10
| | | | | | | Include test data in qrc so it can be found on Android. Change-Id: Iaca8422120f1ef842aafeb0cc209cb9fdd70f05f Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix QTranslator testsEskil Abrahamsen Blomfeldt2015-01-063-1/+30
| | | | | | | | Bundle test data in qrc on Android. Extract it, as the tests expect to find it in the file system. Change-Id: I251eca3c23141a608b1cbac5ee0b7164c068f9b4 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Check XML output and optionally stop on fail.BogDan Vatra2015-01-061-0/+41
| | | | | | | | The failures will be printed in red color. Use -f param to stop on fail. Change-Id: Ife58f9264a9ac859d739842c6d1359acde807ce7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* JPEG: Fix reading of EXIF orientation.Friedemann Kleint2015-01-062-9/+24
| | | | | | | | | | | The orientation is unsigned short, read it as such. In JPEG-files created by Ricoh/Pentax cameras, the data is saved in Motorola format. Reading the wrong data size will produce invalid values when converting the byte order. Change-Id: I8f7c5dc5bfc10c02e090d3654aaefa047229a962 Task-number: QTBUG-43563 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Don't bind to QHostAddress::Any if we want to do IPv4 multicast opsThiago Macieira2015-01-051-3/+3
| | | | | | | | Linux gracefully allows us to do that and treat the v6 socket as if it were v4. Other OS (notably OS X) aren't so forgiving. Change-Id: I13dd3274be2a4b13e8b1eef93cbc2dd17b648f96 Reviewed-by: Richard J. Moore <rich@kde.org>
* tst_QLockFile: simulate a crash betterMarc Mutz2015-01-041-4/+4
| | | | | | | | | | | Instead of leaking the QLockFile instance, which causes leak-checkers to emit false positives, simply call exit(), which doesn't run the destructors, yet doesn't lead to leak-checker warnings. Change-Id: Ia61010671e5218ae412e2bcf873e66255a2c5a99 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Autotest: Forward stderr of the sub-processesThiago Macieira2015-01-025-1/+4
| | | | | | | So we can get the output when running with QDBUS_DEBUG=1. Change-Id: I6a6b8e0d82727c522914fb90a7ce594c86307d8f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Autotest: Be nicer when asking the sub-processes to exitThiago Macieira2015-01-028-17/+32
| | | | | | | | | | Instead of killing them outright (and note that terminate() doesn't work on Windows), ask them nicely to exit on their own. This way, if we run them in valgrind, valgrind gets a chance to print the leak check output and summary. Change-Id: Ib6cc8d4560ff0bf255f94980eb220e97592c00f0 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Added ROUND test for PostgreSQLIsrael Lins2014-12-301-13/+17
| | | | | | | The ROUND function for PostgreSQL only accept NUMERIC field as argument Change-Id: I0c3753bfe4167cd47158e21b407cca8771816104 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* [QDateTime] ISO Time zone designators can be [+-]HHIsrael Lins2014-12-301-0/+8
| | | | | | | | | Added support on QDateTime::fromString to read correctly dates on ISO format with Time zone designators at format [+-]HH Change-Id: Ied5c3b7950aee3d0879af0e05398081395c18df5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Added timezone support for datetime fields in PSQLJulien Blanc2014-12-302-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds correct timezone support in PSQL plugin. Prior to this patch, no timezone support was provided, so only the following case worked : * using local time in both client application and postgresql server * datetime were using second precision This patch tries to take care that postgresql has two different datatypes for date time, respectively : * timestamp with time zone * timestamp without time zone Both are internally stored as UTC values, but are not parsed the same. * timestamp with time zone assumes that there is a time zone information and will parse date time accordingly, and then, convert into UTC before storing them * timestamp without time zone assumes that there is no time zone information and will silently ignore any, unless the datetime is explicitly specified as having a time zone, in case it will convert it into UTC before storing it Both are retrieved as local time values, with the following difference * timestamp with time zone includes the timezone information (2014-02-12 10:20:12+0100 for example) * timestamp without time zone does not include it The patch does the following : * parse the date retrieved by postgresql server using QDateTime functions, which work correctly * always convert the date to UTC before giving it to postgresql * force time zone so that timezone information is taken into account by postgresql * also adds the milliseconds when storing QDateTime values The following configurations are tested to work : * client and server using same timezone, timestamp with or without tz * client and server using different timezone, timestamp with tz The following configuration will *not* work : * client and server using different timezones, timestamp without tz Because data will be converted to local time by the postgresql server, so when returned it will be different from what had been serialized. Prior to this patch, it gave the illusion to work because since TZ information was lost, time was stored as local time from postgresql. Lots of inconsistencies occurred, though, in case client tz changes... I don't expect this to be an issue since having different TZ in server and client and *not* handling this is a broken setup anyway. Almost based on changes proposed by julien.blanc@nmc-company.fr [ChangeLog][QtSql] Added timezone support for datetime fields in PSQL Task-number: QTBUG-36211 Change-Id: I5650a5ef60cb3f14f0ab619825612831c7e90c12 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* tst_QUdpSocket: Fix inverted logic in getting a non-"any" addressThiago Macieira2014-12-281-23/+18
| | | | | | | | We want to use "localhost" if the server's address is "any", as some OS can't send datagrams to "any" (e.g., OS X and FreeBSD). Change-Id: I1004bc2282e7f930cdb7ed394aa9f4b5a1cfcf82 Reviewed-by: Richard J. Moore <rich@kde.org>
* Don't hardcode port numbers in tst_QUdpSocket wherever possibleThiago Macieira2014-12-281-10/+15
| | | | | | | | On my Mac Mini, port 5000 is in use, which means the broadcasting test fails. Change-Id: Ifb0883263e277f388342430349ea7315d42f324a Reviewed-by: Richard J. Moore <rich@kde.org>
* Fix silly QSKIP for IPv6 in tst_QUdpSocket::multicastThiago Macieira2014-12-281-1/+1
| | | | | | | | It was unconditional. Someone forgot to check for IPv6 support before skipping IPv6 tests. Change-Id: I7b11528ad02560f0db9defde3c64f76f48a6c1f8 Reviewed-by: Richard J. Moore <rich@kde.org>
* Silence warning in tst_QUdpSocket::multicast for Any+IPv4Thiago Macieira2014-12-241-1/+7
| | | | | | | | | | QUdpSocket doesn't support binding to QHostAddress::Any and then joining an IPv4 multicat group since QHostAddress::Any is really an IPv6 socket with v6only = false. The test did check this case, but failed to ignore the warning. Change-Id: I62d782408319a6e566e0ff1a6081b706ac1f669c Reviewed-by: Richard J. Moore <rich@kde.org>
* Fix tst_QUdpSocket::multicastLeaveAfterCloseThiago Macieira2014-12-241-3/+6
| | | | | | | | | With IPv6, you cannot bind to a multicast address. You need to bind to a local address only. The previous tests either checked this or didn't check the result of bind(). Change-Id: Ief70887d8988fc1bc4394cf6ff34b5d560e5748e Reviewed-by: Richard J. Moore <rich@kde.org>
* Stabilize tst_QUdpSocket::broadcastingThiago Macieira2014-12-241-1/+1
| | | | | | | | | Sending 100*8 packets of each type of message is WAY overkill. That's a stress test without limiting. My Linux system starts reporting EAGAIN on the socket, so reduce the amount of data sent. Change-Id: I153f44cf3b91d37526dac580b400114cc80b1769 Reviewed-by: Richard J. Moore <rich@kde.org>
* Don't try to send broadcasts over IPv6Thiago Macieira2014-12-241-4/+7
| | | | | | | | | | IPv6 has no such thing, so don't try to bind to an IPv6 address to send broadcasts (even though that works) and it's a poor idea to bind to IPv6 to receive broadcasts. Moreover, skip any IPv6 network addresses (broadcast() is invalid). Change-Id: I2829b042c000158565adfd92db682f37d67dacae Reviewed-by: Richard J. Moore <rich@kde.org>
* Suppress silly shell warning during qmake of qtcpsocket.proThiago Macieira2014-12-241-1/+1
| | | | | | | | If you don't have /etc/lsb-release, you'd get sh: line 0: [: =: unary operator expected Change-Id: Idb5c79f799879e4d32cd640ef74fb388227f831e Reviewed-by: Richard J. Moore <rich@kde.org>
* Autotest: Disable multicast testing with proxiesThiago Macieira2014-12-241-10/+1
| | | | | | | | | It doesn't make sense because there is no command to ask the proxy server to join a multicast group. At best, we could write a datagram via proxy without joining, but we definitely can't receive. Change-Id: Icc6b54572a053fb7821dfca1f4111f2046ff8686 Reviewed-by: Richard J. Moore <rich@kde.org>
* Temporarily disable the QtDBus tests if the session bus isn't availableThiago Macieira2014-12-231-1/+10
| | | | | | | | | | This is a temporary measure while the Qt CI system is updated to have the correct D-Bus configuration. Once it is fixed, this commit should be reverted, so that we don't run into the situation in which the tests aren't getting run on some configurations and we never know about it. Change-Id: I7192d4d95a60dcb63acfa6cc90bfdc58592b0664 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Android: Fix QTemporaryDir/File::nonWritableCurrentDir() testsEskil Abrahamsen Blomfeldt2014-12-222-0/+9
| | | | | | | | The /home path doesn't exist on Android, so it doesn't work as a non-writable current dir. Instead we use /data on Android. Change-Id: Ib779f60822da1bef421a16a00c1030245a8c5b90 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix QLoggingRegistry testEskil Abrahamsen Blomfeldt2014-12-222-0/+10
| | | | | | | | The qtlogging.ini file needs to be detectable by QFINDTESTDATA, so we put it in a qrc file on Android. Change-Id: I5fb0217098c56f2b2e99ab8d1642c4a7904b18d1 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Disable QLockFile testEskil Abrahamsen Blomfeldt2014-12-221-1/+3
| | | | | | | | | | This test requires building a console application first, deploying this as part of the APK and then being able to execute the bundled file from the main application. Since IPC is a limited use case on Android, we just skip this test instead. Change-Id: Ie68e495ff64b69e7027924291a411b5de0e2da76 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix QIODevice testsEskil Abrahamsen Blomfeldt2014-12-223-0/+14
| | | | | | | | | | Test requires that tst_qiodevice.cpp is available on file system, but since we're not able to deploy directly to the file system on Android and since we want to actually test file system access, we bundle it in qrc and copy it out during initialization. Change-Id: Ida2b5bf6f1dcd43bc740a2b9380352bab5eb6c62 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix QFileSystemWatcher test failuresEskil Abrahamsen Blomfeldt2014-12-221-0/+4
| | | | | | | | | Some of the tests expect QDir::homePath() and QDir::currentPath() to be different, so we just set the current path to something other than QDir::homePath(). Change-Id: Ib048d323f4745369821765230b995a73b8a97145 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix test failure for test QFileInfo::lastRead()Eskil Abrahamsen Blomfeldt2014-12-221-0/+4
| | | | | | | | | This test may not be possible on Android, since the file system can be mounted with noatime or relatime which means read access will not be registered. Change-Id: I40f587e1a1f131ee06f0e3700e908ccaa19c83ce Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix QFileInfo testsEskil Abrahamsen Blomfeldt2014-12-223-1/+36
| | | | | | | | | Since there's no way to deploy files directly to the file file system on Android, we put them in a qrc file and extract them on startup. Change-Id: I6a42aa5e0372bfd9fb2f7ccfea964c9c3c2e45d8 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix QDirIterator testsEskil Abrahamsen Blomfeldt2014-12-221-0/+26
| | | | | | | | | | This test requires that the resources are also available in the file system. Since it's not possible to deploy directly to the file system using Android, we extract the files on startup instead. Change-Id: I1d1fe7d62c4c618a89713e3a7d1903e42bfb10b8 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix QDir testsEskil Abrahamsen Blomfeldt2014-12-223-0/+77
| | | | | | | | | | | | | | | | There's no way to install files automatically into the file system on Android, so to test QDir on the file system, we have to bundle the files in qrc and then copy them into the file system on startup. This adds some complexity, but at least it will detect regressions. We also need to make sure the current directory is the same as the data path, since the test assumes this, and /usr/ does not exist on Android, so we have to use a different path to find the root path. Change-Id: I18d79b5ed99a0afff573beb30c61745c403f8991 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Stabilize QPauseAnimation testEskil Abrahamsen Blomfeldt2014-12-221-34/+38
| | | | | | | | | | | This will arbitrarily fail at certain points. Adjusting the timeouts helps, but it's very unpredictable, so it's better to do what we do on Windows and just expect-fail the results that we get. Change-Id: Ie6033c73539c2dd69115b06096919e173f097367 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix qicoimageformat test.BogDan Vatra2014-12-222-0/+19
| | | | | | | Add all test data to resources. Change-Id: Id42a4c033b75409f65cb4d56ebf1161336b93832 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Android: Fix qmovie test.BogDan Vatra2014-12-221-0/+2
| | | | | | | We must add all test data to resources. Change-Id: Ic12f8fce9afb965aff32e7141516c8d223e64491 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Android: Fix qicon test.BogDan Vatra2014-12-221-0/+1
| | | | | | | We must add all test data to resources. Change-Id: I7f9e7650156b174b7c16270d86b78e9408dff254 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Android: Fix json test.BogDan Vatra2014-12-222-2/+12
| | | | | | | Add test data to resources. Change-Id: Ib8a5688e7caab8434b8f0676f53a2a79ec94b264 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Remove old test script & project.BogDan Vatra2014-12-209-1614/+0
| | | | | Change-Id: Ia31959228e188a3f9d2fe3a95c7381a3f4e5d1fb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Autotest: Fix a race condition in launching the QtDBus sub-processesThiago Macieira2014-12-2010-14/+11
| | | | | | | | | | | | Wait for the subprocess to print "ready" before assuming that it is ready to receive calls. waitForStarted() will return as soon as the child is running, but it may not have registered on D-Bus yet. This also solves the synchronization problem more elegantly than how tst_qdbusmarshall.cpp was trying to do it. Change-Id: I548dfba2677cc5a34ba50f4310c4d5baa98093b2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix handling of subprocesses for QtDBus unit tests on WindowsThiago Macieira2014-12-2014-25/+43
| | | | | | | | | The executables are not in the same dir as on Unix, so we need to use QFINDTESTDATA to find them. The DESTDIR setting prevents qmake from placing the executables in a "debug/" subdir. Change-Id: I1d6d10e6f6f109f55fd9809dcf83da0386f38772 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Don't kill the subprocess in tst_qdbusabstractinterfaceThiago Macieira2014-12-201-17/+25
| | | | | | | | | | | Rohan was right in e88f9a92b7ab05ea9bc25083de7dee1b67dd673e to stabilize the test and reset the state, but killing the subprocess is overkill. All we need is to reset the state in both applications, which includes disconnecting and reconnecting to the peer, to discard any sent but not yet received messages. Change-Id: Ie01392e6e63bd70ef8345217d3fc641ed63c7aba Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Autotest: Make the peer executables report error if they failedThiago Macieira2014-12-203-3/+9
| | | | | | | | | QDBusServer::address() will return an empty QString, which caused the tests to fail later with no apparent reason. Change-Id: I86f448dfc67a6cdb27ecda2d490f335766cfaf4f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove the hardcoding of Unix socket paths for QtDBusThiago Macieira2014-12-204-15/+12
| | | | | | | | | | | | | | | | | | | This allows the tests to be run on Windows too by using TCP socket connections instead of requiring Unix sockets. The tests shouldn't have hardcoded the path, which came from QDBusServer anyway. Now the tests simply defer to QDBusServer. This is a slight behavior change for Windows, but not one that should matter since anyone who was using the default constructor resulted in a QDBusServer that failed to listen. [ChangeLog][QtDBus][QDBusServer] Fixed a bug that made QDBusServer's default constructor try to bind to a Unix socket on non-Unix systems. Now QDBusServer will attempt to bind to a TCP socket instead. Change-Id: I2a126019671c2d90257e739ed3aff7938d1fe946 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* tst_qdbusconnection_no_bus: Fix build on WindowsThiago Macieira2014-12-201-2/+2
| | | | | | | There's no setenv, so use qputenv instead. Change-Id: I357ff6d0e3d67e199661a9d87c720fc4e0131755 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove unnecessary adding of test rows in the QtDBus type benchmarkThiago Macieira2014-12-201-20/+15
| | | | | | | | No need to loop twice to add the "native" entries, since they are added by the helper function anyway. Change-Id: I9caabc6fc4973a90b483840815769b1351947a89 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* QScrollBar: emit valueChanged once even if a slot takes too much timePavel Krebs2014-12-191-0/+40
| | | | | | | | | | | | Put also processing of control activation into initial timer check for possibly pending mouse release event. [ChangeLog][QtWidgets][QScrollBar] Fixed a bug where the valueChanged() signal was emitted twice if a connected slot took too much time. Task-number: QTBUG-42871 Change-Id: I7bad5279ef84463a033b55256d241d4445374081 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>