Commit Graph

4443 Commits

Author SHA1 Message Date
Morten Johan Sørvig
b942cf0f3b Make tst_QLocale::macDefaultLocale() more robust
The assumption that we can test "en_US" and expect
it to behave a certain way is flawed in that most
of the formatting settings are independently
configurable by the end user.

Make the test more robust while attempting to preserve
as much testing as possible:

Make the decimalPoint/groupSeparator tests check for
a range of possible values. Check that they are not
the same.

Remove the date formatting tests and the firstDayOfWeek()
== Sunday test.

Make the time zone test accept a non zero extended
time zone. ("GMT+2" in addition to "GMT+02".)

Change-Id: Ie1f89793eb785f526c5f6fafbb6726ef8c6cb016
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-07-02 12:55:47 +02:00
Bernd Weimer
8377384e3a Fix some tst_qwidget test cases
Fixed qwidget test cases for platforms that show windows full screen by
default and that don't support WindowMasks. Incorporated QNX/BlackBerry
peculiarities.

Change-Id: I349ecab5cef35c7d9751aa547465f685d620164a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-07-02 10:29:44 +02:00
Morten Johan Sørvig
ddeb907442 Skip unstable autotests in QtBase.
The combination of these unstable tests makes it very
hard to get changes through the CI system due to the
unrelated test failures.

Skip the following test functions:
tst_QIODevice::unget QTBUG-39983 (Mac)
tst_QThreadPool:expiryTimeoutRace QTBUG-3786 (Windows)
tst_QLocalSocket::processConnection QTBUG-39986 (Mac)
tst_QTcpServer::adressReusable QTBUG-39985 (Linux)

Change-Id: I96559bea0d437fd25966b6ccac1ece1490e06241
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-07-02 09:28:34 +02:00
David Faure
9ee27005ee qDebug: fix data race in qt_message_print
The setting of (static) messageHandler to qDefaultMessageHandler if null
was happening in multiple threads simultaneously, so it needs synchronization.

Used an atomic pointer in case qInstallMessageHandler is called from a thread,
but more importantly, initialized the static vars right away.

Improve auto test to ensure that qInstallMessageHandler(0) still sets the
default message handler.

Change-Id: I70335af38c1d28a1cdba1df8a79c6006f227422e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-07-01 20:23:31 +02:00
Friedemann Kleint
813462a0ce tst_qcollator: Exclude failing test cases for non-ICU/Windows.
Change-Id: I17912ddb34337216805259dab9d90eb2c9ac64cc
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-06-30 15:02:06 +02:00
Eskil Abrahamsen Blomfeldt
8638895f6b Android: Fix compilation of qtcpsocket test
No pthread_yield() in the Android NDK.

Change-Id: I5ff77c55f30c172ee7fefb1129bdf475b318449e
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-06-30 11:40:24 +02:00
Eskil Abrahamsen Blomfeldt
190bb186ae Android: Fix compilation of qhostaddress test
The sockaddr_in struct is defined in netinet/in.h header.

Change-Id: I67a3421094c96a5e948968a26723ec8c21f85c93
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-06-30 08:59:45 +02:00
Eskil Abrahamsen Blomfeldt
a57f3ee9bb Android: Fix compilation of qpluginloader test
The almostplugin has an unresolved symbol, and on Android
we compile with -no-undefined.

Change-Id: Ia631193890dfe8e7ac8e58087475164222d876fc
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-06-30 08:59:35 +02:00
Alex Trotsenko
7cc893b216 Fix QRingBuffer::readPointerAtPosition()
Fix condition to allow return a valid pointer when head != 0.

Change-Id: I5215f7dfc44924016c2d9b67ab2d9935b5164d7a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-06-24 18:48:33 +02:00
Peter Hartmann
100ed2e91e network internals: do not try to cache a deleted entry
We were keeping a dangling pointer to a non-existent QIODevice around
which would lead to a crash.

Task-number: QTBUG-17400
Change-Id: Ie374cbb94bb45c9b0fbef46287b3317f60154123
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-06-24 15:07:03 +02:00
Laszlo Agocs
a5f3df04af Simplify mirroring code and add tests for non-aliged 1 bit images
Change-Id: I309714bc52de87c702194a4a82803d383f6ac3b3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-06-23 17:12:13 +02:00
Mitch Curtis
ffdba0459b Correct grammar of missing Q_OBJECT macro warning.
Change-Id: Ifb84220285e38ce6940595035ca9fe012c350b79
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-06-23 11:19:07 +02:00
Friedemann Kleint
37312d2950 tst_qicon: Resolve all files using QFINDTESTDATA().
The local files in availableSizes() were not resolved.
Introduce member variables for the file names, resolve them
in the constructor and add initTestCase() to verify.

Task-number: QTBUG-39287
Change-Id: If841e904700fe76b6c9265124ccba7764911fdc9
Reviewed-by: aavit <eirik.aavitsland@digia.com>
2014-06-22 09:41:06 +02:00
David Faure
884b381576 Fix data race on QLoggingCategory when using qDebug from multiple threads
setEnabled() would race with isEnabled()/isDebugEnabled()/etc.

Change-Id: I2004cba81d5417a634b97f5c2f98d3a4ab71770d
Reviewed-by: David Faure <david.faure@kdab.com>
2014-06-20 21:54:04 +02:00
Allan Sandfeld Jensen
70dd563046 Correct QImage::fill(uint) on RGBA8888 formats
QImage::fill(uint) was incorrectly performing ARGB->RGBA conversion when
called on RGBA8888 formated images.

This patch moves the color conversion to QImage::fill(QColor) where it
belongs so that fill(uint) can behave consistent with documentation and
how it treats other formats.

The fill(uint) method had no automated tests, and this patch adds one.

[ChangeLog][QtGui][QImage] QImage::fill(uint) now fills the given pixel
value unconverted when used on RGBA8888 image, making it consistent with
the documentation and treatment of all other image formats.

Change-Id: I00a9d810c61d350dbdd7c4b9ad09e5ce11896b6d
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-06-20 16:08:28 +02:00
Andy Shaw
47b3ecf3f4 Remove the widget from the stylesheet cache before polishing
If the widget exists in the style rules cache before it polishes for the
first time then it should be removed from styleSheetCache too so that the
latest set stylesheet is used for the polishing.

Task-number: QTBUG-39427
Change-Id: Ic1e7988afe530f16ea9996bae56543ed554d6be9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-06-20 07:10:21 +02:00
Friedemann Kleint
3fd184b663 Use QModelIndex to get the data from underlying model
Change-Id: Ibeb70079afd566c78289168540296b926f36d1af
Initial-patch-by: Irfan Omair <irfan.omair@gmail.com>
Task-number: QTBUG-27597
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-06-19 17:23:30 +02:00
Sergio Ahumada
5721c0811a Merge remote-tracking branch 'origin/stable' into 5.3
Change-Id: Icd073d40ce10ab4733b997036815795dd3fbaac1
2014-06-14 18:11:52 +02:00
Friedemann Kleint
9c80a3be4b Revert "Suppress move/resize events if they are the result of call to move()/resize()."
This reverts commit a1c5198387.

The idea of detecting non-spontaneous events by comparing
against the widget's crect has problems when sequences
of programmatic resizes occur. In  addition, QWindowSystemInterface's
queueing of events is problematic for this.

Task-number: QTBUG-39611
Task-number: QTBUG-32590
Change-Id: I4674d8d5d5d432d938f7226b5790543335665c1f
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-06-13 13:32:45 +02:00
Thiago Macieira
3ccfc351fd QProcess: Handle spurious socket notifications for stdout and stderr
On Unix systems where the GUI event dispatcher uses a notification
system for socket notifiers that is out of band compared to select(),
it's possible for the QSocketNotifier to activate after the pipe has
been read from. When that happened, the ioctl(2) call with FIONREAD
might return 0 bytes available, which we interpreted to mean EOF.

Instead of doing that, always try to read at least one byte and examine
the returned byte count from read(2). If it returns 0, that's a real
EOF; if it returns -1 EWOULDBLOCK, we simply ignore the situation.

That's the case on OS X: the Cocoa event dispatcher uses CFSocket to get
notifications and those use kevent (and, apparently, an auxiliary
thread) instead of an in-thread select() or poll(). That means the event
loop would activate the QSocketNotifier even though there is nothing to
be read.

Task-number: QTBUG-39488
Change-Id: I1a58b5b1db7a47034fb36a78a005ebff96290efb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-06-12 17:54:11 +02:00
Lars Knoll
81ba16cad9 Fix case insensitive comparisons using QCollator
In ICU the strength parameter decides whether a comparison is
case sensitive or not.

Fix mac comparison code. It can't have worked before.

Added some basic automated testing for QCollator.

Change-Id: I2646c464fd22ccd3a93c461fa3dba4bd1d4c7b4b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-06-12 10:26:07 +02:00
Sergio Ahumada
490e79e39e Merge "Merge remote-tracking branch 'origin/stable' into 5.3" into refs/staging/5.3 2014-06-11 23:06:01 +02:00
David Faure
a6d7e09e89 QWidget: fix documentation for isEnabledTo(0)
It is NOT always the same as isEnabled().
Added a unittest to prove it.

Change-Id: I7717126835923e8c091249bfcdf81767c44fb5f7
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-06-11 23:06:01 +02:00
David Faure
11aaff3a57 Add missing detach() in QPixmap::convertFromImage()
Task-number: QTBUG-18519
Change-Id: I5d929cf6eda3f34130314edac95487fb00a95db5
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-06-11 23:06:01 +02:00
David Faure
ebe4aaadb2 tst_qtcpsocket: fix comment, the slot goes to 512
Change-Id: Ia0c5b29d6e02c9fda0b1da4a2779f1cbe9b1d747
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-06-09 10:39:44 +02:00
Morten Johan Sørvig
7eba6d039d Cocoa: Re-implement QCocoaScreen::topLevelAt()
The previous implementation used [NSApp orderedWindows]
which does not return NSPanel subclasses, which is
used by Qt dialogs and pops.

Use [NSWidow windowNumberAtPoint:belowWindowWithWindowNumber]
instead, which hit-tests on all window types. This
can potentially include windows from other processes
and non-Qt windows which needs to be filtered out.

Add EXPECT_FAIL to tst_MacGui::nonModalOrder. The
correct topLevelAt() implementation now exposes that
this test is failing.

Task-number: QTBUG-39322
Change-Id: I81afa3da964e08fe682802220d8fe81e9284205e
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-06-06 23:39:12 +02:00
Friedemann Kleint
a1c5198387 Suppress move/resize events if they are the result of call to move()/resize().
QWidget::resize() or QWidget::move() set the new size/position values
and send events. The spontaneous events generated by the platform
should be ignored in that case.

Task-number: QTBUG-30744
Task-number: QTBUG-38768
Task-number: QTBUG-32590
Change-Id: I9c0ae38842ed76a8a88ca64fdc9bbe106b2766b7
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-06-06 06:30:44 +02:00
Lars Knoll
7df8b1ada4 Properly escape bytearray data outside the ascii range when using a codec
Some codecs can't handle the range outside ascii properly and would then
fail to read the data back in correctly.

Task-number: QTBUG-15543
Change-Id: I4c02921e787a939eeec0c7a11603b5896d756aef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-06-04 23:06:16 +02:00
Friedemann Kleint
a149d2f73e Do not clear default button in QMessageBox::setDetailedText().
Store the value of QMessageBoxPrivate::autoAddOkButton
temporarily when automatically adding the "Show Details..."
button.

Task-number: QTBUG-39334
Change-Id: I173c83893548ee83b3d8ea2743f87686c32657e7
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-06-04 14:43:02 +02:00
Bernd Weimer
ce6c0d2e61 QNX: Fix tst_qfilesystemwatcher
If QNX does not have inotify there is no native engine.

Change-Id: I042efd0b59f916f9e0b55bbe5c7f3fe7bb6914c8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-06-03 17:25:36 +02:00
Jan Kundrát
267ba8b63e QAbstractProxyModel::sibling: treat row/column as offsets within the proxy
Qt5 allows QAIM subclasses to reimplement the sibling() method. Unfortunately,
the default QAbstractProxyModel's reimplementation differs in behavior to what
the Qt4 version was doing. In particular, the Qt4 version used to use the row
and column as positions within the proxy model, while the Qt5 version mistakenly
does this at the level of source model. This is arguably broken; the caller asks
for a sibling of the proxy index, not for a sibling within the proxy model.

This change makes the QAPM::sibling work explicitly in the same way as the Qt4
code behaved.

The reimplementation of QAbstractProxyModel::sibling was introduced in
9dfba89c28. It was subsequently fixed with commit
999109866d not to return indexes from the source
model, but the logic was still different from the Qt4 version.

[ChangeLog][QtCore][QAbstractProxyModel] Fixed QAbstractProxyModel::sibling to
work in the same manner as the Qt4 code used to behave. Previously, Qt5's
implementation would treat the row and column as positions in the source model
instead of a position in the proxy itself.

Followup-to 9dfba89c28 and
999109866d
Change-Id: Ia25027b2ad9e4777ba28de2d2226d48f8cccf587
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-05-29 11:11:02 +02:00
Eskil Abrahamsen Blomfeldt
909b0de5d1 Windows: Fix another crash when creating QRawFont from invalid data
The sanity check added in d16508a285
didn't actually catch the case where the invalid data is large
enough to contain the offset table and table directory. Added sanity
checks to all the code that accesses the font data now, so this
should fix crashes with partial data as well as invalid data.

Task-number: QTBUG-37190
Change-Id: Ie43f10d8cf0b09007783b9b1c4d91bfed8c6b0f0
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-05-28 16:52:04 +02:00
Friedemann Kleint
3478ec2949 Move native subwidgets in QWidget::scroll().
Task-number: QTBUG-38999
Change-Id: Ie22dcf61895bbfc575eaae4d1929516a8749de39
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-05-28 16:52:04 +02:00
Friedemann Kleint
787c0d76a2 Replace hard-coded qWait() by QTRY_COMPARE/VERIFY in widget tests.
Task-number: QTBUG-38890
Change-Id: I9a729430fcd30b782c100bb76d5e287a3b4c1238
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2014-05-26 15:06:12 +02:00
Andy Shaw
5d48eb8bbc Cocoa: Make sure modal windows get correct geometry on show
beginModalSessionForWindow will center the window and ignore
the set geometry. So to workaround this it checks the new value
against the old one and moves it back if need be.

Change-Id: I38bc74c04138992f2e0570fca666414025aeeba8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-05-26 11:16:38 +02:00
Tony Sarajärvi
9f4881297d Mark tst_qfiledialog2 as insignificant due to failing tests
Task-number: QTBUG-39183
Change-Id: I6663d0e4c49e904ffe5d5fdc990073abd4188d9d
Reviewed-by: Simo Fält <simo.falt@digia.com>
2014-05-23 07:05:41 +02:00
Friedemann Kleint
a591c27282 Stabilize and speed up tst_QGraphicsItem::cursor().
Use QTRY_COMPARE instead of hard-coded timeouts, ensure window is
shown.

Change-Id: I4f23144ee14150c4fba9c6fbd8c4ee2da472cc75
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2014-05-22 21:44:01 +02:00
Axel Rasmussen
2983cb9531 Fix broken QPlainTextDocumentLayout after removing chars
This fixes an issue where, if characters were removed from several
blocks in a single edit, the document layout would end up being
corrupted since the document layout manager wouldn't re-layout the
proper number of text blocks.

Task-number: QTBUG-30051
Change-Id: Idf3a6f567120e6a5dbebf1f65f685d374219328a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
2014-05-21 17:30:11 +02:00
Christoph Schleifenbaum
ff31090d07 Cocoa: Do not process ampersands in menus twice.
When syncing between QAction and native NSMenuItems, the ampersands
(mnemonics) were removed twice. This lead to double ampersands being
removed instead of replace with single ones.

Task-number: QTBUG-37933
Change-Id: If1d9cd247b467472647b22b38460b44b03f13d82
Reviewed-by: Liang Qi <liang.qi@digia.com>
2014-05-21 13:59:18 +02:00
Peter Hartmann
c045cb950b Socks5 socket engine test: Disable UDP over Socks test
... because it fails on the new network test server. The Socks5 tests
in QUdpSocket have already been disabled by commit
aa3eaf9d2e .

Task-number: QTBUG-35490
Change-Id: Ib062adb422ff6e5538f14d15a266d79c3bb53956
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
2014-05-21 10:25:36 +02:00
Bernd Weimer
1ea0d59c4a Skip tst_QLockFile::noPermissions
QLockFile "noPermissions" test is not applicable with root
privileges.

Change-Id: I5779da524f24d0f1b9ef519d654856a6200da6bf
Reviewed-by: David Faure <david.faure@kdab.com>
2014-05-19 19:33:15 +02:00
Bernd Weimer
b8f96418ed Skip some qsavefile auto tests
Some of the QSaveFile tests are not applicable with root privileges.

Change-Id: I1a22906c0b14acf144f1849719152dfe9d79f426
Reviewed-by: David Faure <david.faure@kdab.com>
2014-05-19 19:33:15 +02:00
Jędrzej Nowacki
1d7902a0ca Fix crash in QNetworkAccessManager.
Recreating QCoreApplication could cause a crash in QNetworkAccessManager
constructor. That was caused by an invalid shutdown detection introduced
in f273d6fbc0.

Task-number: QTBUG-36897
Change-Id: Ib5bba773a2a4fcde690a3a93680aef551aae3a5b
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-05-19 15:52:58 +02:00
Frederik Gladhorn
94f9c9678a Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable 2014-05-16 14:14:25 +02:00
Bernd Weimer
fa3d264b0b QNX: Fix tst_selftest
GRAPHICS_ROOT and TZ environment variables are needed in child
processes in order to successfully run the auto test selftests.

Change-Id: I7befabd535b4c47b1e75acbe3d6158d0d9b811b3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-05-16 10:20:34 +02:00
Bernd Weimer
1b2614477f Fix accessibility auto test
Prevent crash on platforms that don't support accessibility by skipping
tests.

Change-Id: I42ba44df3200e0abd62797c76a5c538fb1d2757c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-05-14 20:10:03 +02:00
Frederik Gladhorn
cb3348dec9 Merge remote-tracking branch 'origin/release' into stable
Change-Id: If1abbe7810ea43ae750db91066f9f579c79b2289
2014-05-14 12:37:34 +02:00
Eskil Abrahamsen Blomfeldt
d16508a285 Fix crash when loading invalid font data in QRawFont
When passing invalid data to QRawFont, we need to fail gracefully
and mark the font as invalid, instead of crashing. This crashed
because of different missing sanity checks in the Windows
and FontConfig font databases.

[ChangeLog][Text] Fixed crash when trying to load a font from
invalid data.

Task-number: QTBUG-37190
Change-Id: I62c81217ec7d873350b575c9d4ae8e6f0a939540
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-05-14 09:13:38 +02:00
Bernd Weimer
4f83102df0 QNX: Make QDateTime "daylightTransitions" auto test pass
Change-Id: I8c68d15806c6ec39e98dddda86823d9b4e3a3169
Reviewed-by: John Layt <jlayt@kde.org>
2014-05-14 09:12:39 +02:00
Bernd Weimer
87152d3c89 QNX: Fix tst_qfileinfo
Change-Id: Ia97a0c661d675e4f5ba800c32f8368583d58ee20
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-05-14 09:12:16 +02:00