Commit Graph

1863 Commits

Author SHA1 Message Date
Eskil Abrahamsen Blomfeldt
d30c446d35 Android: Fix QDataStream test
Include test data on Android.

Change-Id: Ic0890495c0bf8d2e38595585226a03073b043d57
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-09 15:41:34 +01:00
Eskil Abrahamsen Blomfeldt
099db090d5 Android: Fix QTextBoundaryFinder test
Include test data on Android.

Change-Id: I35c17618d84822df126fe3462a00d3d49b1377c8
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-09 15:41:27 +01:00
Eskil Abrahamsen Blomfeldt
7ad75cd8ef Android: Fix QTemporaryFile tests
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>
2015-01-08 10:06:50 +01:00
Marc Mutz
d511aa906c QVersionNumber: test more version numbers
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>
2015-01-08 01:46:41 +01:00
Eskil Abrahamsen Blomfeldt
ce40b8b7ef Android: Fix QCryptographicHash test
Include test data in qrc when building on Android.

Change-Id: I611ca24fe8764eb709b6ce27e814840ea919d4f1
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-06 16:44:38 +01:00
Eskil Abrahamsen Blomfeldt
8057ce61d0 Android: Fix QCommandLineParser test
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>
2015-01-06 16:44:36 +01:00
Eskil Abrahamsen Blomfeldt
4613e1d2c1 Android: Fix QCollator test
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>
2015-01-06 16:44:34 +01:00
Eskil Abrahamsen Blomfeldt
463835b306 Android: Fix QChar test
Include test data in qrc when building on Android.

Change-Id: Id80623324788dac21bd5ddbeef8108f54d6bc8f7
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-06 16:44:32 +01:00
Eskil Abrahamsen Blomfeldt
6a4704cc64 Android: Fix QByteArray test
Include test data in qrc so it can be found on Android.

Change-Id: Iaca8422120f1ef842aafeb0cc209cb9fdd70f05f
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-06 16:44:30 +01:00
Eskil Abrahamsen Blomfeldt
75f0578124 Android: Fix QTranslator tests
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>
2015-01-06 16:44:27 +01:00
Marc Mutz
4560ce4ec6 tst_QLockFile: simulate a crash better
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>
2015-01-04 09:43:25 +01:00
Israel Lins
b60773934d [QDateTime] ISO Time zone designators can be [+-]HH
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>
2014-12-30 23:56:01 +01:00
Eskil Abrahamsen Blomfeldt
244da85d3b Android: Fix QTemporaryDir/File::nonWritableCurrentDir() tests
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>
2014-12-22 09:28:05 +01:00
Eskil Abrahamsen Blomfeldt
4bee095069 Android: Fix QLoggingRegistry test
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>
2014-12-22 09:27:55 +01:00
Eskil Abrahamsen Blomfeldt
4fec0dca87 Android: Disable QLockFile test
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>
2014-12-22 09:27:49 +01:00
Eskil Abrahamsen Blomfeldt
ae55d3ea27 Android: Fix QIODevice tests
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>
2014-12-22 09:27:44 +01:00
Eskil Abrahamsen Blomfeldt
e511d9b9dd Android: Fix QFileSystemWatcher test failures
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>
2014-12-22 09:27:38 +01:00
Eskil Abrahamsen Blomfeldt
616ac8e59c Android: Fix test failure for test QFileInfo::lastRead()
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>
2014-12-22 09:27:31 +01:00
Eskil Abrahamsen Blomfeldt
5681ae74e3 Android: Fix QFileInfo tests
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>
2014-12-22 09:27:27 +01:00
Eskil Abrahamsen Blomfeldt
0dd7bd0c7a Android: Fix QDirIterator tests
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>
2014-12-22 09:26:57 +01:00
Eskil Abrahamsen Blomfeldt
0b16f42565 Android: Fix QDir tests
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>
2014-12-22 09:26:49 +01:00
Eskil Abrahamsen Blomfeldt
999321fecb Android: Stabilize QPauseAnimation test
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>
2014-12-22 09:26:38 +01:00
BogDan Vatra
2073057bde Android: Fix json test.
Add test data to resources.

Change-Id: Ib8a5688e7caab8434b8f0676f53a2a79ec94b264
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2014-12-22 08:32:39 +01:00
Eskil Abrahamsen Blomfeldt
678a283498 Android: Fix QStandardPaths test
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>
2014-12-19 16:00:46 +01:00
Eskil Abrahamsen Blomfeldt
0fb839ac62 Android: Fix QResourceEngine tests
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>
2014-12-19 16:00:41 +01:00
Thiago Macieira
7fad14f4e2 tst_qlogging: add tests for %{pid} and %{threadid}
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>
2014-12-19 01:54:41 +01:00
Thiago Macieira
0cd1ed0883 Fix running tst_qmessagehandler when QT_MESSAGE_PATTERN is set
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>
2014-12-18 22:17:36 +01:00
David Faure
504ab80f6d tst_qsortfilterproxymodel: remove unused member var
(clang warning)

Change-Id: Id751443e03be4f2bd1721cbe9d9a898d9619b29b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-11-28 09:09:02 +01:00
Frederik Gladhorn
3de7382044 Merge remote-tracking branch 'origin/5.4.0' into 5.4
Conflicts:
	dist/changes-5.4.0

7231e1fbe2 went into 5.4 instead of the
5.4.0 branch, thus the conflict.

Change-Id: I70b8597ab52506490dcaf700427183950d42cbd1
2014-11-27 18:12:10 +01:00
David Faure
736ac19156 QAbstractProxyModel: fix canDropMimeData/dropMimeData implementations
The code in 4696e9dbaa 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>
2014-11-24 08:05:43 +01:00
Thiago Macieira
749f4f0e55 Disable the tests that verify that the available space shrunk
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>
2014-11-22 20:02:45 +01:00
Jan-Marek Glogowski
a2f78ea0a1 Fix tst_QEventLoop::processEventsExcludeSocket test
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>
2014-11-21 18:51:17 +01:00
Thiago Macieira
bb07737614 Fix the %{time} printing to *not* default to the process's time
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>
2014-11-21 16:47:35 +01:00
Frederik Gladhorn
245acbf6e8 Merge remote-tracking branch 'origin/5.4.0' into 5.4
Change-Id: I95f235a66ce2e9b1fa435c0f911c6f7e811755f0
2014-11-21 13:44:26 +01:00
Alex Trotsenko
6bded1695b Fix QString::section() behavior on negative and out-of-range indexes
Change-Id: I3bff6ba73b15ee810bb11b2902d11244c3205b2a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-11-20 15:37:18 +01:00
Giuseppe D'Angelo
bec1854cc0 QSortFilterProxyModel: keep the sorting on unrelated changes
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>
2014-11-20 14:58:26 +01:00
Friedemann Kleint
6f66205bac Add Windows-specific notation for WebDAV to QUrl.
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>
2014-11-17 21:47:29 +01:00
Thiago Macieira
adf1b30934 Make QVersionNumber private
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>
2014-11-13 20:04:44 +01:00
Jørgen Lind
1e0516fc69 Add C++11 if available for QVariant autotest
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>
2014-11-13 15:21:07 +01:00
Friedemann Kleint
014785d853 tst_QTimer::singleShotToFunctors: Allocate static event loop on heap.
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>
2014-11-11 06:28:11 +01:00
Marc Mutz
11e09a440b tst_qvariant: automate testing of forward_list
...using the SD-6 __has_include macro.

Change-Id: I629e2ad1c8090aba9e86ab9febf6d09a504219f9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-29 09:18:21 +01:00
Lars Knoll
38c2e3d104 Properly detect UTF-8 BOM markers in ini files
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>
2014-10-29 08:58:31 +01:00
Friedemann Kleint
1abcc1cd3d Hardcode UTF-8 for "unicode" in QTextCodec::codecForHtml().
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>
2014-10-28 12:17:13 +01:00
Kai Koehne
5bfe794aaa Remove trailing '\n' in qFormatLogMessage output
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>
2014-10-27 08:59:02 +01:00
Alexander Volkov
3903aee91b Fix doc about the list of supported codecs
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>
2014-10-24 22:23:58 +02:00
Alexander Volkov
7645b64d89 Add support for "Apple Roman" encoding
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>
2014-10-24 22:23:50 +02:00
Jędrzej Nowacki
8c4deff51c Fix QVariant associative container conversion from built-in types.
Task-number: QTBUG-41403
Change-Id: I9dab0f9450cac11678eb6d20abd2dd08e86e0900
Reviewed-by: Stephen Kelly <steveire@gmail.com>
2014-10-24 16:27:42 +02:00
Morten Johan Sørvig
047f4c4d79 Further limit the sparse file testing on OS X
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>
2014-10-22 23:00:41 +02:00
Tor Arne Vestbø
ae89aa330f logging: Fix qCleanupFuncinfo to not mangle Objective-C message names
Change-Id: I823566ba72668c611d225aa92c4d09a53cabe8fc
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-10-20 13:34:37 +02:00
Marc Mutz
bcda685be9 tst_QPointer: fix memleak
Benign, but easy to avoid by using automatic storage.

Change-Id: I60a1a2e85d8c1b2d91f3f33973374afae8876340
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-19 13:18:23 +02:00