summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Android: Fix QDataStream testEskil Abrahamsen Blomfeldt2015-01-092-0/+10
| | | | | | | | Include test data on Android. Change-Id: Ic0890495c0bf8d2e38595585226a03073b043d57 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com> Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix QTextBoundaryFinder testEskil Abrahamsen Blomfeldt2015-01-092-0/+13
| | | | | | | Include test data on Android. Change-Id: I35c17618d84822df126fe3462a00d3d49b1377c8 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix QTemporaryFile testsEskil Abrahamsen Blomfeldt2015-01-083-9/+48
| | | | | | | | | | | Fixed a few instances of files that should be deployed to the file system. The way we do this on Android is via qrc. We also need a special case for the resources/test.txt, because QFINDTESTDATA will find this in qrc, but that's not the one we are looking for. Change-Id: I7097e8b7795b3a8fd483adad090208f295478412 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* QVersionNumber: test more version numbersMarc Mutz2015-01-081-0/+60
| | | | | | | | | | | QVersionNumber will gain a small-version-number optimization, which stores sequences of less than 4 (32bit) or 8 (64bit) 8-bit signed segments inside the class instead of a QVector. Make sure the tests cover those cases, too. Change-Id: If1d875c75d284908756b305f767a7218cab5226f Reviewed-by: Keith Gardner <kreios4004@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* 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>
* 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>
* [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>
* 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 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>
* Android: Fix QStandardPaths testEskil Abrahamsen Blomfeldt2014-12-191-1/+1
| | | | | | | | | | | QStandardPaths::writableLocation() is documented to return the empty string if no matching writable location can be determined. This is the case for e.g. FontsLocation and ApplicationsLocation on Android. We need to still accept this as a valid response. Change-Id: I2824e9dcfd41b1c24dbf3896b7ae9b5260e9accd Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix QResourceEngine testsEskil Abrahamsen Blomfeldt2014-12-193-8/+71
| | | | | | | | | | The test expects all the files to reside in the file system, both for loading the runtime resources and for comparisons. Since we can't deploy directly to the file system on Android, we go via qrc and extract the files on startup instead. Change-Id: I17ff8985cb17dbfc45f0fb692ca46558bb5c5cdc Reviewed-by: BogDan Vatra <bogdan@kde.org>
* tst_qlogging: add tests for %{pid} and %{threadid}Thiago Macieira2014-12-191-0/+9
| | | | | | | | | | Since those are unpredictable, there's little we can match, besides the "0x" for the QThread pointer. For the PID, at least we can compare it to the value from QProcess. Change-Id: I89420306863b95c82be761baabd733a7f17eba5e Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Fix running tst_qmessagehandler when QT_MESSAGE_PATTERN is setThiago Macieira2014-12-181-0/+9
| | | | | | | | | This test fails if the environment has the variable set. Change-Id: Ibd54ff3e6e22a885341898889088ac56e84282b1 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* tst_qsortfilterproxymodel: remove unused member varDavid Faure2014-11-281-2/+1
| | | | | | | (clang warning) Change-Id: Id751443e03be4f2bd1721cbe9d9a898d9619b29b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4.0' into 5.4Frederik Gladhorn2014-11-271-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: dist/changes-5.4.0 7231e1fbe24102f2a93b34dfa70e3dca884440d2 went into 5.4 instead of the 5.4.0 branch, thus the conflict. Change-Id: I70b8597ab52506490dcaf700427183950d42cbd1
| * Fix the %{time} printing to *not* default to the process's timeThiago Macieira2014-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | The default should be the actual time of day. Showing the process's time is the optional case. In the future, we'll provide a way to showing the monotonic reference time ("boot") and we should improve the detection of actual application runtime. Change-Id: I41936d77ab9fad2073dc0ce1c97cabe57ec39f16 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | QAbstractProxyModel: fix canDropMimeData/dropMimeData implementationsDavid Faure2014-11-241-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code in 4696e9dbaa4 was incorrect. It is perfectly valid to call these methods with row=-1 column=1 parent=some_index, this is exactly what happens in QListView and QTableView. Child row/column is only for trees. Move the coordinate mapping from QSortFilterProxyModel into a new mapDropCoordinatesToSource internal method, used by QAbstractProxyModel. Task-number: QTBUG-39549 Change-Id: I3312210473d84b639cbe4c01f70ea36437db3e91 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Stephen Kelly <steveire@gmail.com>
* | Disable the tests that verify that the available space shrunkThiago Macieira2014-11-221-0/+10
| | | | | | | | | | | | | | | | | | Somehow, it doesn't shrink with btrfs, even if you write 1 MB of non- null data. This does not seem to be a bug in QStorageInfo. strace confirms that there is a second statvfs call happening. Change-Id: I9ed99d27d25e191916278e6b8faeae132469fc63 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Fix tst_QEventLoop::processEventsExcludeSocket testJan-Marek Glogowski2014-11-211-9/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The testcase always returns the expected result, independently of the QEventLoop::ExcludeSocketNotifiers flag to processEvents. In Qt4 the same test uses an intermediate QEventLoop and already runs it before the QEventLoop::ExcludeSocketNotifiers: QEventLoop loop; // allow the TCP/IP stack time to loopback the data, // so our socket is ready to read QTimer::singleShot(200, &loop, SLOT(quit())); loop.exec(QEventLoop::ExcludeSocketNotifiers); This fixes and improves the test by connecting, processing and checking the bytesWritten signal for the pending connection socket. Change-Id: I1b1d2b7b83910c87ba3fe48e29ac9fd585ac62ad Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.4.0' into 5.4Frederik Gladhorn2014-11-212-2/+2
|\| | | | | | | Change-Id: I95f235a66ce2e9b1fa435c0f911c6f7e811755f0
| * Make QVersionNumber privateThiago Macieira2014-11-132-2/+2
| | | | | | | | | | | | | | | | | | | | We're not ready. [ChangeLog][EDITORIAL] Remove all mentions of QVersionNumber. Change-Id: I03ad95992982eb3177f982c1eeddb6a6bc29336c Reviewed-by: Keith Gardner <kreios4004@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix QString::section() behavior on negative and out-of-range indexesAlex Trotsenko2014-11-201-0/+22
| | | | | | | | | | Change-Id: I3bff6ba73b15ee810bb11b2902d11244c3205b2a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QSortFilterProxyModel: keep the sorting on unrelated changesGiuseppe D'Angelo2014-11-201-0/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whenever the source model of a QSortFilterProxyModel changes, and the changes involve the sorted column, the implementation removes the changed rows from the mapping, sorts them, and inserts them back; in case of identical items, the rows are inserted at the end of the block of equal rows. The problem is that if the change doesn't actually happen on the roles that are used for sorting, then we shuffle the rows, terribly confusing the user. The typical case is a model with identical checkable rows: (un)checking one row will move it at the end. So, instead of trying to be smart with the removal/sort/insert sorted, simply resort everything under the changed parent index. Since the sorting used is stable, this keeps the items in the same positions. Task-number: QTBUG-1548 Change-Id: Id0e61bd49da53b0a3e8aefa6b6893ac41179dc6f Reviewed-by: David Faure <david.faure@kdab.com>
* | Add Windows-specific notation for WebDAV to QUrl.Friedemann Kleint2014-11-171-0/+9
| | | | | | | | | | | | | | | | | | | | | | Convert a Windows-specific WebDAV specification "//host@SSL/path" into URL's with scheme set to "webdavs" and back to local file (Windows only). Task-number: QTBUG-42346 Change-Id: I12663243848ea7b2d3f208743e837e9de14a93eb Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add C++11 if available for QVariant autotestJørgen Lind2014-11-131-0/+1
| | | | | | | | | | | | | | | | | | gcc 4.9 has the __has_include feature which enables the TEST_FORWARD_LIST and includes the forward_list header. This in turn checks that the c++11 flags are enabled, or throws an error. Change-Id: I44aa58e47c2f9ba6f14cb5a68d24da4a76698e5f Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | tst_QTimer::singleShotToFunctors: Allocate static event loop on heap.Friedemann Kleint2014-11-111-5/+14
|/ | | | | | | | | | | Fix warning: QEventLoop: Cannot be used without QApplication and occasional crashes on Windows. Task-number: QTBUG-26406 Change-Id: Ia8b2a4e3d375d1e43f0e66fe64a39af5f9cf4d60 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Dario Freddi <dario.freddi@ispirata.com>
* tst_qvariant: automate testing of forward_listMarc Mutz2014-10-291-6/+6
| | | | | | | ...using the SD-6 __has_include macro. Change-Id: I629e2ad1c8090aba9e86ab9febf6d09a504219f9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Properly detect UTF-8 BOM markers in ini filesLars Knoll2014-10-293-8/+23
| | | | | | | | | If we detect a utf8 BOM mark at the beginning of the .ini file, skip the marker and set the iniCodec to utf8. Task-number: QTBUG-23381 Change-Id: I1b37fc4f1638a48e4f3ee71ab165e2989bc592f1 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Hardcode UTF-8 for "unicode" in QTextCodec::codecForHtml().Friedemann Kleint2014-10-281-0/+4
| | | | | | | | | | ICU would return a utf-16 (endian dependent) codec for unicode which is very rarely what people want. In most cases, unicode is encoded in utf8 these days, so return a utf8 codec for it. Task-number: QTBUG-41998 Change-Id: I51ee758d520702b263a8b2011787eb1f3455ed96 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove trailing '\n' in qFormatLogMessage outputKai Koehne2014-10-271-6/+6
| | | | | | | | | | | | | | | Do not automatically add a \n to all messages formatted by qFormatLogMessage. Some backends require a final newline, some don't, so it's best to only append it where it's actually needed. The returned string will be null if the pattern is empty. This allows to differentiate between the case that the pattern just didn't apply (empty line is printed), and the case that qSetMessagePattern(QString()) have been called (nothing is printed). Change-Id: I17fde997a4074f58f82de6dea129948155c322d6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Fix doc about the list of supported codecsAlexander Volkov2014-10-241-7/+2
| | | | | | | | | | | | | Replace "Apple Roman" by "Macintosh" which is registered by IANA: http://tools.ietf.org/html/rfc1345. Replace unsupported "GB18030-0" by "GB18030". Remove "JIS X 0201" and "JIS X 0208" as they are supported as parts of other Japanese encodings but not directly. Add "HP-ROMAN8" which is supported by both Qt and ICU. Also clean the codecs test. Change-Id: Iaf8e8ff1900d3f92ea0e0df75c60fe1534de23ac Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add support for "Apple Roman" encodingAlexander Volkov2014-10-241-0/+1
| | | | | | | | Substitute this encoding by "macintosh" when Qt is built with ICU. It is for compatibility with Qt 4.x. Change-Id: I70c51cba7d473ac81e25862736cb71a2f6894055 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix QVariant associative container conversion from built-in types.Jędrzej Nowacki2014-10-241-0/+45
| | | | | | Task-number: QTBUG-41403 Change-Id: I9dab0f9450cac11678eb6d20abd2dd08e86e0900 Reviewed-by: Stephen Kelly <steveire@gmail.com>
* Further limit the sparse file testing on OS XMorten Johan Sørvig2014-10-221-1/+1
| | | | | | | | | At 4GiB the CI test system still spends a considerable amount of time testing this. Tune the size down to 16 MiB. Change-Id: I417aa6829fcc734e5de4d7d34e503190f6b291e5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* logging: Fix qCleanupFuncinfo to not mangle Objective-C message namesTor Arne Vestbø2014-10-201-0/+16
| | | | | | Change-Id: I823566ba72668c611d225aa92c4d09a53cabe8fc Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* tst_QPointer: fix memleakMarc Mutz2014-10-191-1/+2
| | | | | | | Benign, but easy to avoid by using automatic storage. Change-Id: I60a1a2e85d8c1b2d91f3f33973374afae8876340 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>