summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Add DST-change test for a date derived via .toLocalTime().Edward Welbourne2016-01-261-0/+24
| | | | | | | | | Uses a time derived via .toUTC() to ensure the .toLocalTime() comes out at the time we expect. Task-number: QTBUG-49008 Change-Id: I2005127929c7eab1b7a3cbaba8d21df8c9585d17 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Test .addDays() and .addMonths() are sensible around DST changes.Edward Welbourne2016-01-261-2/+40
| | | | | | Task-number: QTBUG-49008 Change-Id: Ie3bf9dfeb67c96b18320e18c14b9680f03cb98e9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Diaglib: Improve output of widgets.Friedemann Kleint2016-01-264-4/+44
| | | | | | | | | - Make it possible to pass an optional root widget to dumpAllWidgets(). - Add option to output size constraints of widgets/windows. - Output normal geometry of top levels. Change-Id: Ib48809d070c5721fe4688a2ad39cb99f286618de Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Autotest: make tst_QDateTime pass when LC_TIME != en_USThiago Macieira2016-01-221-9/+6
| | | | | | | | | | | QDateTime::toString for Qt::TextDate unconditionally uses the system locale (because QDate::shortDayName and QDate::shortMonthName do). Setting the default QLocale has no effect. If you ask me, those two QDate methods are buggy, but they are documented that way. Change-Id: I408dcb81ba654c929f25ffff1427366b04da5a43 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Hide better the private API QTextCursor constructorsThiago Macieira2016-01-222-3/+4
| | | | | | | | | | | | Both constructors were taking a pointer, so they participated in overload resolution along with QTextDocument and QTextFrame pointers. Instead, make them take references and move them to the private section of QTextCursor. That necessitated adding a method to QTextCursorPrivate to access that private constructor from non-friend classes. Change-Id: I7e6338336dd6468ead24ffff1410e3bc534d77dd Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* winrt: msvc2015: refactor file handlingMaurice Kalinowski2016-01-2120-29/+171
| | | | | | | | | | | msvc2015 reintroduced a couple of functions from the win32 API towards WinRT. Enable usage of those and simplify the file system engine. Furthermore update the autotests. Change-Id: I9eafffba0ddfd05917c184c4a6b9e166f86d71d9 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* Autotest: remove the check that broadcast = ip | ~netmaskThiago Macieira2016-01-211-7/+0
| | | | | | | | | | | | | It's possible to configure an interface so that it isn't the case. I have no idea if this is a valid scenario, but the unit test shouldn't enforce that. ip addr can report: inet 192.168.1.1/32 brd 192.168.1.255 scope global vlan0 valid_lft forever preferred_lft forever Change-Id: I8de47ed6c7be4847b99bffff141c337575760bd9 Reviewed-by: Richard J. Moore <rich@kde.org>
* Merge "Merge remote-tracking branch 'origin/5.5' into 5.6" into refs/staging/5.6Jani Heikkinen2016-01-2115-83/+231
|\
| * Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2016-01-1915-83/+231
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/common/atomic64/atomic64.cpp configure src/3rdparty/forkfd/forkfd.c src/corelib/io/forkfd_qt.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp tools/configure/configureapp.cpp Change-Id: Ic6168d82e51a0ef1862c3a63bee6722e8f138414
| | * Fix UB in tst_QObject::disconnectDoesNotLeakFunctor()Marc Mutz2016-01-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If CountedStruct is passed a GetSenderObject object, it will attempt to call a member on it from within its own destructor. That works usually quite well, but in this test case, which tests for function object leaks when a connection is torn down because the sender object is destroyed, the destruction of the CountedStruct happens when all connections are severed in ~QObject. At that point, what used to be a GetSenderObject instance no longer is one and the call into one of its member functions invokes undefined behavior. Fix by making QObject::sender() public by a using declaration instead of a wrapper function. Found by UBSan: tests/auto/corelib/kernel/qobject/tst_qobject.cpp:6007:104: runtime error: member call on address 0x7ffc6e7538b0 which does not point to an object of type 'GetSenderObject' 0x7ffc6e7538b0: note: object is of type 'QObject' Change-Id: Ia973140037b3c1b5a670a8a3949d09b956f40349 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Fix UB in tst_QSharedPointer::basics()Marc Mutz2016-01-071-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Binding a reference to the nullptr is undefined behavior. Just skip that particular test when 'ptr' is null. Found by UBSan: tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp:258:32: runtime error: reference binding to null pointer of type 'struct Data' Change-Id: I125588b9d269a6f76716d660d03142f409513885 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Fix UB in tst_QDialog::showExtension()Marc Mutz2016-01-071-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't cast a QDialog to a subclass it is not. Fix by creating it as the required subclass in the first place. Found by UBSan: tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp:203:20: runtime error: downcast of address 0x2b5f5000ad40 which does not point to an object of type 'DummyDialog' tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp:203:46: runtime error: member call on address 0x2b5f5000ad40 which does not point to an object of type 'DummyDialog' Change-Id: I63ae7e782bda6a78d11af5c2bc2f7d88aacd0ac0 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| | * Fix UB in tst_QObject::noDeclarativeParentChangedOnDestruction()Marc Mutz2016-01-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If QObjectPrivate::declarativeData is set, it is in various places in Qt expected to point to a QAbstractDeclarativeDataImpl, from which ownedByQml1 is unconditionally read. In noDeclarativeParentChangedOnDestruction(), the declarativeData pointer is, however, set to a local QAbstractDeclarativeData instance, which, being an empty class, has size 1 and alignment 1. Depending on the compiler's idea of bit field order, this code either read uninitialized data from the dummy object, or else some random stack memory outside any (valid) object. What caught UBSan's attention, though, was the difference in alignment between the two classes: src/corelib/kernel/qobject.cpp:917:9: runtime error: member access within misaligned address 0x7fffc9cf706f for type 'struct QAbstractDeclarativeDataImpl', which requires 4 byte alignment Fix by providing a properly initialized object of the correct type. Change-Id: Iae83a949ee5a7bc98df13e35ea614c063085fa13 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | * Fix UB in tst_QMetaTypeMarc Mutz2016-01-061-43/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't pass around meta-type IDs in QMetaType::Type variables. It leads to reading values from an enum variable that are invalid. Fix by passing the IDs around as int. Found by UBSan: tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp:408:5: runtime error: load of value 4028, which is not a valid value for type 'Type' Change-Id: Idd106ee3d7960fe3d8fefc0fc5830fc22d38a513 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Fix UB in tst_QIODevice::getSetCheck()Marc Mutz2016-01-061-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reinterpret cast from a QTcpSocket → QAbstractSocket → QIODevice to MyIODevice → QIODevice was undefined. Fix by simply instantiating a MyIODevice, which must then inherit from QTcpSocket, of course. Instead of fixing the class name in the overridden setOpenMode() method, simply make the base class' implementation public with a using declaration. Found by UBSan: qtbase/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp:84:22: runtime error: member call on address 0x7ffcca2d23f0 which does not point to an object of type 'MyIODevice' 0x7ffcca2d23f0: note: object is of type 'QTcpSocket' Change-Id: I939b3548949b9b5765df4a6cc81875e169fd69dd Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Allow socket events processing with a foreign event loop on WindowsAlex Trotsenko2016-01-053-2/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While a native dialog is open, the application message queue is handled by the native event loop which is external to Qt. In this case, QEventDispatcherWin32::processEvents() does not run and socket notifiers will not be activated. So, this patch moves the notifier activation code into the window procedure, which enables socket event processing with native dialogs. Task-number: QTBUG-49782 Task-number: QTBUG-48901 Change-Id: Icbdd96b2e80c50b73505f4fe74957575b83d6cf1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| | * QStateMachine: fix ignore high-priority events.Masaru Ueki2016-01-051-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | When a high-priority event is posted in overrided 'QStateMachine::beginSelectTransitions', the event may be remained in event queue, and be not dispatched until another event posted. Change-Id: Ifda288d9c00ac7985e426b9cc02bda382ebaac35 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
| | * Revert "Fix global coordinate mapping for child widgets in QGraphicsView."Friedemann Kleint2016-01-051-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 56aad2ad6074237537fecf10d0cda0f3872e7f71. QWidget::mapFromGlobal() does not work correctly when the widget is a child widget of another widget embedded into a QGraphicsView with a transformation (scaling/rotation). It starts applying offsets going up the widget tree (just as mapToGlobal) until it hits the embedded widget not taking into account the transformation. It would need to go in from to top to bottom or better be reimplemented such that a QTransform for mapping coordinates from/to global is determined which is then applied in reverse. Task-number: QTBUG-50030 Task-number: QTBUG-50136 Change-Id: Iadeb891d793be1938c64942bfbf38d541a281c33 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * QAbstractSocket: do not enable read notifications on TCP in bind()Alex Trotsenko2015-12-241-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In bind+connect scenario, rejected connection can trigger a read notification while the socket is opened. But unlike UDP, reading from the socket engine or emitting a readyRead() signal is not allowed for the TCP socket in bound or connecting state. To make a bind+connect scenario work properly, disable the read notifications until a connection is established. Task-number: QTBUG-50124 Change-Id: I7b3d015b0f6021fb9ff9f83560478aa5545f41f5 Reviewed-by: Richard J. Moore <rich@kde.org>
| | * QWidgetWindow: The alien widget should be from the window's hierarchyGabriel de Dietrich2015-12-211-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | This partially reverts commit 025d6a778ceb377e688f1. Change-Id: I7b964b0d598abe46137c22177fe2b5dcca5bb812 Task-number: QTBUG-49831 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
| | * Fix timeout calculations using qt_subtract_from_timeoutJoerg Bornemann2015-12-211-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | Commit ed0c0070 introduced qt_subtract_from_timeout but used it incorrectly in several places. Change-Id: I80ea16088707929a45d5a61ec6f3370f8e63d1cd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | * Fix utf8->utf16 BOM/ZWNBSP decoding.Erik Verbruggen2015-12-211-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the byte sequence for a BOM occurs in the middle of a utf8 stream, it is a ZWNBSP. When a ZWNBSP occurs in the middle of a utf8 character sequence, and the SIMD conversion does some work (meaning: the length is at least 16 characters long), it would not recognize the fact some charactes were already decoded. So the conversion would then strip the ZWNBSP out, thinking it's a BOM. The non-SIMD conversion did not have this problem: the very first character conversion would already set the headerdone flag. Change-Id: I39aacf607e2e068107106254021a8042d164f628 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Fix a crash when calling QOpenGLTexture::setData with a null QImage.Juha Turunen2015-12-111-1/+14
| | | | | | | | | | | | | | | Change-Id: Idf8ae00cff6929114b38dcb003c259c83a11dbaa Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | | Expand springForward_data() to cover a few more time-zones.Edward Welbourne2016-01-201-3/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | The important one is EET, for the benefit of our CI system; but other European zones and the USA's coastal zones likely have enough hackers in them to make this worth checking. Change-Id: Idcc703bce29808e1a0a6279680cc8d3cbed38dac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Be fussier about setting tst_QDateTime's globals.Edward Welbourne2016-01-201-14/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Time zones change on the whim of politicians. Consequently, we can seem to be in CET/CEST or on UTC (because we tested sample dates when our zone coincided) when we aren't (i.e. we're in a materially different zone at the time probed by some particular test). Make the initialization of the globals that test this more robust against governmental meddling and document the unfixable problem with Algeria: a DST transition *on the epoch*. Change-Id: I17c5c81d339b80af12f4ffab367e28052dd6c2fa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Nomenclature corrections relating to CET.Edward Welbourne2016-01-201-37/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are several European time zones; the only one relevant to the tests here is CET. They won't work with WET, GMT or EET. So name them and related variables for CET, not for Europe. CET's summer-time isn't called CST; and the (existing) spring forward test works only in CET/CEST, not elsewhere in Europe. Change-Id: I55c7544bf792de7495700b749b935ec534831d8b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Fix toDisplayString(QUrl::PreferLocalFile) on WinKevin Funk2016-01-201-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using QUrl::PreferLocalFile we do want to strip the leading slash, as toLocalFile() would do as well. Behavior change by means of an example: QUrl url(QUrl::fromLocalFile("C:/file.txt") url.toLocalFile() --> "C:/file.txt" Before: url.toDisplayString(QUrl::PreferLocalFile) --> "/C:/file.txt" After: url.toDisplayString(QUrl::PreferLocalFile) --> "C:/file.txt" Task-number: QTBUG-41729 Change-Id: I7d425541f6077ebcf3fcf46feeb7e0f03a0d7fe2 Reviewed-by: Dominik Haumann <dhaumann@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | tst_qtextcocumentlayout::blockVisibility - make the test more robustTimur Pocheptsov2016-01-191-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | The test inserts strings "0" ... "9" into the text document, takes the half of resulting document's size, makes half of lines invisible and compares sizes. On OS X 10.11 after inserting "4" the width changes, so making "4" invisible also reduces the width and QCOMPARE(currentSize, previosHalfSize) fails. Instead of digits, insert the same string "A" 10 times. Change-Id: Ie88a0442703f98949cea9bcdb694cecee59695f3 Task-number: QTBUG-49848 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | CMake: Don't attempt gui-tests if Qt is built with -no-guiStephen Kelly2016-01-181-1/+3
| | | | | | | | | | Change-Id: I5f327fa1b0c7827535a4b00ca7d0d4281b1eec7b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | QHttpSocketEngine: ensure pending EOF triggers a notificationAlex Trotsenko2016-01-181-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | When the remote peer closed the connection, a read notification needs to always be emitted, otherwise the higher layer does not get the disconnected signal. From the other side, underlying QAbstractSocket object could temporarily disable notifications from the engine at any time. To avoid possible blocking of the socket, take a pending EOF into account when the read notifications are re-enabled. Change-Id: Iac9d4e2f790530be3500baf5a2000f1f63df5cc2 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* | [Android]: Java uses some deprecated locale codes so account for theseAndy Shaw2016-01-131-1/+2
| | | | | | | | | | | | | | | | | | | | There are three deprecated language codes that Java still uses for the locale so we need to account for these inside QLocale by mapping them to the right language. Task-number: QTBUG-49632 Change-Id: Ib66b3f2763e085f7384228f2490b048bb56be259 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Fix reentrancy regression in QShortcutMap after c7e5e1d9eTor Arne Vestbø2016-01-121-2/+21
| | | | | | | | | | | | | | | | | | | | | | When closing a popup dialog using a shortcut, when the popup was originally opened using a shortcut, the closing-shortcut would interfere with the state of the first shortcut, and we ended up sending a key event for the original shortcut. Task-number: QTBUG-50360 Change-Id: I62e5ddb9ca43b28519ede629775bc0d7598dccc4 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Don't pretend we know what DST to use for an offset date.Edward Welbourne2016-01-121-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QDateTime::addDate() and friends sanitize their end-state, they were using the DST status of their start-state (if known) to control it. This lead to misguided results and, in particular, inconsistent results given that a raw-constructed QDateTime comes into being ignorant of its DST, while a .toLocalTime() one knows its DST. Furthermore, the code to do this was triplicated, tricky and poorly explained. So pull it out into a local static function and explain what it's doing, and why, more clearly and only once. Task-number: QTBUG-49008 Change-Id: Ia4bb3c5e9267fff8bb963ea705267998218ed623 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Revert "QString: preserve embedded NULs when converting from QByteArray"Marc Mutz2016-01-121-2/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This partially reverts commit e486d69133178ccce7c75cf48201ab28efb20e44. It broke too many users, even though all of them deserved to be broken. The new functionality will be provided by differently-named functions, where possible (problem: equality operators). I did not revert the fix for the off-by-one error in tst_qtextdocumentfragment.cpp. I also didn't revert the change in the inequality relational operators, since for all strings s1, s2 and s2' where s2' is s2 truncated at the first NUL, s1 < s2 ⟺ s1 < s2' (since NUL < c for any c != 0), and, trivially, for ≤, >, ≥, too. This does not hold for = and ≠, of course, since "foo\0bar" ≠ "foo". [ChangeLog][Important Behavior Changes][EDITORIAL] Reverted: All conversions from QByteArray to QString now preserve embedded NULs... Change-Id: If4b47048b39ae5be6ed08e6d91809626a67ea7f5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Doc: mention that Qt::AA_X11InitThreads isn't used anymoreDavid Faure2016-01-111-1/+0
| | | | | | | | | | | | | | | | Whether or not to call XInitThreads() doesn't apply since Qt-5.0's switch to XCB. Change-Id: I5f1e5e664a251c98af6357c87fc9a6bb03a46ce3 Reviewed-by: Martin Smith <martin.smith@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | CMake: Ensure that -fPIC is passed in tests.Kevin Funk2016-01-112-0/+4
| | | | | | | | | | | | | | | | CMake newer than 2.8.12 automatically adds the appropriate flag, but CI still runs 2.8.11. Change-Id: Ie61375f2feb54a92c9d8f0ed6ad5227a67343bc5 Reviewed-by: Stephen Kelly <ske@ableton.com>
* | Diaglib: Fix and extend dumping of native windows (Windows).Friedemann Kleint2016-01-111-8/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | When recursing over the windows, the code did not take into account that EnumChildWindow enumerates grand children as well. Exclude those by checking for the direct parent in the recursion so that the hierarchy is printed correctly. Add more information about class and module and rearrange the output a bit so that the window title is more prominent. Task-number: QTBUG-50206 Change-Id: Iffb12c44eda9d09da5eb14a8405aee52ed3aa849 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | Make DST-transition test more general.Edward Welbourne2016-01-111-17/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Widen its interval (to work in more TZs) and test spring as well as autumn. Anywhere that does have a DST transition probably has it between August and December; and there's no benefit to using a narrow window. There's also no sense skipping the test if we don't know there's a DST transition: the test should still work, it just won't be testing anything (about DST transitions). Combine date and time checks into date-time checks, so that, when one of them fails, QCOMPARE lets us know how the other changed, too. Task-number: QTBUG-49008 Change-Id: I145b939ffef0dd0b54fd0e3cdf72a159c57ec00b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QVariant: make sure two floating points compare equal if they are equalThiago Macieira2016-01-111-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Not just fuzzily equal. The fuzzy comparison fails for infinities, since the expression p1 - p2 where p1 = p2 = infinity is NaN. And NaN comparisons are always false. As a nice side-effect, we don't do the more expensive computation of a multiplication if the two numbers really are equal. Task-number: QTBUG-50036 Change-Id: I11f559ef75544c50b3f8ffff1420cec7c7273295 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Revert "dbus: Add method serial() and replySerial() to class DBusMessage."Thiago Macieira2016-01-111-7/+0
| | | | | | | | | | | | | | | | | | This reverts commit 618e2cc081e09d9222418bd933876224675a7530. The original commit has a section of code that I failed to review properly and is of questionable functionality. Change-Id: I61c53d7b8b2aa7c3312292b017a18aba7da11bc5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | CMake: Make all tests link to Qt librariesKevin Funk2016-01-093-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed as of commit v5.6.0-beta1~483 (Add an automatic use of the ELF-versioned QtCore symbol, 2015-10-20). Even if a translation unit only contains #include <QtCore/QString> int main(int,char**) { return 0; } it must link to QtCore which provides the qt_version_tag symbol. Change-Id: I827c0a7403320e7e5b384d8608face20fcecdaea Reviewed-by: Stephen Kelly <ske@ableton.com>
* | QDate: fix calculation of the week number for the last days of 2020Thiago Macieira2016-01-091-10/+31
| | | | | | | | | | | | | | | | | | | | Off-by-one error: we should have calculated whether the current year is leap, not the next year. This affected any 53-week leap years. Task-number: QTBUG-50273 Change-Id: I134ce5db2f82468585ffffff14264cb9f12998fd Reviewed-by: Martin Klapetek <mklapetek@kde.org> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | don't rely on transitive dependenciesOswald Buddenhagen2016-01-085-0/+8
| | | | | | | | | | | | Change-Id: Ide872b452e02ebefb3eeb51464c8d59e8bf58bc4 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Prospective fix for running cmake tests with -no-widgetsSimon Hausmann2016-01-071-1/+1
| | | | | | | | | | | | | | Don't try to run test_interface when Qt is configured without QtWidgets. Change-Id: If6c376c250215c1d639b06881d16c0141091f288 Reviewed-by: Stephen Kelly <ske@ableton.com>
* | dbus: Add method serial() and replySerial() to class DBusMessage.Ralf Habacker2016-01-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch includes setup of class member 'msg' in QDBusMessagePrivate::toDBusMessage() to be able to get the serial after message sending. Testcases for comparing the 'reply serial to' with the 'serial' are included. Task-number: QTBUG-44490 Change-Id: Iae7c48f5b0c70a6c5ae500904072b38b46dfd876 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Diaglib: Output more information about QWindow.Friedemann Kleint2016-01-061-0/+13
| | | | | | | | | | | | | | | | | | Output surface class/type, screen name and scaling factors. Task-number: QTBUG-50206 Change-Id: I88d3494962b29985cd9e492c1761361b73e0172e Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | Blacklist failing tst_QFile tests (OS X)Timur Pocheptsov2016-01-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | openStandardStreamsFileDescriptors and openStandardStreamsBufferedStreams fail on OS X: lseek somehow works on sequential streams (standard streams) but QFile has pos() == 0 (since it's sequential). Change-Id: I6a6161c012a91de189f59c533880fb8fe7a66d37 Task-number: QTBUG-49841 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
* | winrt: Use winsock2 API for hostname resolution on WinRT/WinPhoneOliver Wolff2016-01-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That API has been available for WinRT and Windows Phone for some time now. By using it to get the machine name and for hostname resolution we can get rid of some winrt-only code and use qhostinfo_win.cpp on WinRT and Windows phone as well. Additionally the required capability was added to tst_qhostinfo so that this auto test can be run without any manual editing. Change-Id: I63fa5521bf8cdb0c919bd5a0100ea977c865622a Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* | tst_Gesture - fix failing tests on OS X 10.11Timur Pocheptsov2016-01-051-19/+37
| | | | | | | | | | | | | | | | | | | | | | | | This test seems to be quite broken on OS X: qWaitForWindowExposed returns too early (while no window is on screen) so gestures can not be dispatched QApplication::topLevelAt(pt) - returns null. Use qWait + isExposed combo instead (similar to qWaitForWindowExposed, but there is no isExposed test before the loop). Change-Id: I85fbd773ccce0ca92b2dceb1749d67ef767aa0cf Task-number: QTBUG-49849 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | Make use of preprocessor easier to understand.Edward Welbourne2016-01-041-17/+17
| | | | | | | | | | | | | | | | The #if had a condition that was needlessly hard to understand; and was widely separated from its #else clause. Change-Id: I43f4282993f4f2e8c4b5ad07dc2c2e06a6b95aa9 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>