summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Do not emit textEdited on inputMask changeJoni Poikelin2015-03-271-0/+11
| | | | | | | Task-number: QTBUG-1266 Change-Id: Ib2f1db15be876c1d6713bd7c28c2b91006b3b2d4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* tst_QDnsLookup: Use a different character from space in TXT multiThiago Macieira2015-03-261-2/+3
| | | | | | | | | | | | | | When in commit db15341d273730298ab5af03b59e9ea1cca782be I added support for testing TXT, I used the space character to make it easy to concatenate the records. Unfortunately, that means it's easy to false- positive the test by creating one record with a single entry containing a space instead of two entries. So use the NULL character instead. Change-Id: Ia0aac2f09e9245339951ffff13c7d239ea83583d Reviewed-by: Jeremy Lainé <jeremy.laine@m4x.org> Reviewed-by: Richard J. Moore <rich@kde.org>
* Update strtoll and strtoull from upstream FreeBSDThiago Macieira2015-03-261-0/+6
| | | | | | | | | | | | | | | There appears to be at least one fix, related to sign- or zero-extension in the call to isspace(). So it's a good idea to update again. This also brings the behavior to match strtoll and strtoull on Linux, including the fact that strtoull will parse negative numbers. For that reason, qstrtoll and qstrtoull are now wrappers that try and keep the behavior that we used to have. This update also changes the code from a 4-clause BSD license (bad) to a 3-clause BSD license (good). Change-Id: I73b01b02ebd1551bf924599d52284ad25cc1def0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Ensure that CSS rules are inherited from the parent tagsAndy Shaw2015-03-253-4/+143
| | | | | | | | | | | | | | | | When CSS is set in a head tag then it was not being inherited by the child tags when the CSS specification indicates that the properties are in fact inherited. This ensures that those properties are inherited and the non inheritable ones are unchanged. A test is added to cover the different situations with inheritance and a fix is done for the QTextDocumentFragment test which was passing despite having incorrect defaults. Task-number: QTBUG-28770 Task-number: QTBUG-34153 Change-Id: I55966240845a885852a04ecb82c61926dea9f800 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix building test qpluginloader/machtest against installed qtbaseFrederik Gladhorn2015-03-251-2/+5
| | | | | | | | | When building the test while qtbase has been installed and the build dir was removed, the include paths were not found in frameworks builds. Change-Id: I32d9e61176a5e19c86095580ddad6914f25ff952 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Fix build of the manual dialog test with Qt 4.Friedemann Kleint2015-03-251-0/+1
| | | | | Change-Id: If2b0ae9842ebc2795168d2c50934b8a87006544b Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* OS X Accessibility: Make checkboxes etc. checkable with VoiceOverBoris Dušek2015-03-253-0/+75
| | | | | | | | | | | | NSAccessibility has no explicit analog for QAccessibleActionInterface::toggleAction(), checking checkboxes/radio buttons is handled by NSAccessibilityPressAction. So ensure exposing the action properly on OS X so that VoiceOver users can check/uncheck checkboxes, select radio buttons etc. Change-Id: Idc8b048de2313a3e875a929516baf3dded9c68cc Task-number: QTBUG-44852 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Add string range tests to qaccessibilitymacBoris Dušek2015-03-251-1/+21
| | | | | Change-Id: I099502d4948194d934ace1fabc5e3ce14f663eb9 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Refactoring of qaccessibilitymac testBoris Dušek2015-03-251-37/+223
| | | | | | | | | | In order to support testing values of more accessibility attributes and parameterized attributed, we provided some "infrastructure" to be able to query them with minimal effort. We also reworked current 6 supported attributes to use this new way. Change-Id: Id0ceb59aa0fe063c9aedad27cffcc3aef0899d7f Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Fix accessibility character rect testsBoris Dušek2015-03-251-3/+6
| | | | | | | | | | | | textEditTest in qaccessibility test was using QTextEdit::setCurrentFont on second pass, but that did not change the font used for text in any way. I don't know what was the purpose. So I changed it into something that made sense to me and actually tests text with a different font on second pass. Also fixed characterRect function in tests to use correct font/format. Change-Id: I843c5b29f8048196ec3405b6717655e77b567dbb Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Fix tst_qaccessibility::textEditTest for some screen resolutionsBoris Dušek2015-03-251-0/+1
| | | | | | | | On a high resolution display the test will potentially create a text edit that introduces line breaks and these make it fail then. Change-Id: I38807a9b3b511478a1742c4422a97c1cb3395a02 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Support all underline types in accessibilityBoris Dušek2015-03-251-6/+7
| | | | | Change-Id: I9eccc66624f5d789cc8778d4376338207beb4a14 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Add tests for detach on setDevicePixelRatio()Morten Johan Sørvig2015-03-242-0/+57
| | | | | | Change-Id: I414ff0b794e0202a7f8c931b59b973cb1e7dc148 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Do not search test binary if QProcess is not supported.Pasi Petäjäjärvi2015-03-231-0/+2
| | | | | | | | Without QProcess support we do not run test which initTestCase is trying to find. Change-Id: Icecaad90f61a019489e372517a6d62372155bd46 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QVarLengthArray: Add initializer_list constructorKai Koehne2015-03-231-0/+62
| | | | | | | | | | | | | | | | | Implement an initializer_list constructor, which was probably just forgotten so far. Technically this is a SC incompatible change, since QVarLengthArray<int> array = {10}; will now create an array with one element 10, instead of an empty array with a reserved size of 10. Anyhow, keeping the inconsistency with the STL / other Qt containers here would certainly do more harm than good in the long run. Task-number: QTBUG-45047 Change-Id: I4675880f93e141181250939942fa32300916b0e3 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Clean-up tst_QCharKonstantin Ritt2015-03-231-297/+218
| | | | | | | | | Since Qt 5.0, static overloads of QChar has a uint parameter only, so there is no more ambiguity between uint<->ushort and thus some tests does not make sense anymore; avoid explicit cast to uint for the others. Change-Id: Ibc7a2ac4de63d3f023a8dbb5e53211ef8521579d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix problems with extended selection after changing the model contentsFrank Reininghaus2015-03-222-0/+122
| | | | | | | | | | | | | | | | | | | | | Storing the position of the first selected item in the view can lead to wrong extended selections if the contents of the model change. Future Shift-clicks will always use the previous position of the first selected item, which may not be correct any more, to calculate the current selection. To fix this problem, a QPersistentModelIndex is used to keep track of the first selected item. A new unit test is added. Moreover, one function of the QTableView unit test is changed such that it shows the view prior to performing the test. Without this change, this test may fail. That the test, which simulates mouse presses without showing the view, worked at all seems to be a coincidence, as pointed out in QTBUG-18009. Task-number: QTBUG-18009 Change-Id: I0d844fbd1a994c279a7c8ee5d9b5b9fccecd25bf Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* MySQL: Fix test so it expects the right integer typeAndy Shaw2015-03-201-3/+3
| | | | | Change-Id: Idd90d7881c6458fac7602bf02dad0f794d3b98c9 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* MySQL: Keep the precision of the field when formatting the valueAndy Shaw2015-03-201-10/+26
| | | | | Change-Id: I4ab08be5112167a617d6d1d109754f2404a9605f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Diaglib: Add gesture events to event filter.Friedemann Kleint2015-03-202-0/+7
| | | | | | | | Task-number: QTBUG-45134 Task-number: QTBUG-45120 Change-Id: I9b2420ec302dfff173fbc8e3173d6ef0fcf095e0 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* Fix tst_largefile QCOMPARE value typesMarko Kangas2015-03-181-6/+6
| | | | | | | | | Added casting to QT_OFF_T type. Otherwise fails on some compilers. Change-Id: I4f1f0c558af7d182a4babf38a7f048b27b3db611 Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make sure remove() doesn't corrupt the json objectLars Knoll2015-03-181-0/+21
| | | | | | | | | When using non latin keys, remove() could cause corruption of the json object. Task-number: QTBUG-42270 Change-Id: I7305e57ebb78630a9bf68bc4f831a6d1646abb79 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix support for iso8859-16 when compiling with ICULars Knoll2015-03-181-0/+8
| | | | | | | | | ICU doesn't support iso8859-16, so we need to fall back to the Qt codec for this encoding. Task-number: QTBUG-45053 Change-Id: I9754cf098c906fe8a75363a3d090029543cd0e35 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix source incompatibility while connecting signals with forward declared ↵Olivier Goffart2015-03-181-1/+20
| | | | | | | | | | | | | | | | | | | arguments QObject::connect tries to determine if the arguments are registered metatypes. This used to work even for arguments that were forward declared. But now, the metatype system tries to call QtPrivate::IsQEnumHelper<T>::Value to know if it is registered. That fails on gcc if T is forward declared. Apparently gcc needs to know the full type of T to pass it in the ellipsis function, even within a sizeof expression. So change the ellipsis expression to a template one. Task-number: QTBUG-44496 Change-Id: I7fa07bd3cde470b134c2ec53b0d581333d16a6f1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove the tests for Ubuntu Oneiric (11.10)Thiago Macieira2015-03-177-17/+0
| | | | | | | | | | | | | | | | | | This system is no longer in the CI rotation and we haven't had reports of the same issues happening on later versions. Either the issues have since been fixed or they were never an issue in Qt in the first place. This commit has the additional benefit of getting rid of the following shell error when qmake was run: sh: line 0: [: =: unary operator expected as /etc/lsb-release hasn't contained DISTRIB_CODENAME for some time and proper quoting was never implemented (not even qtcpsocket.pro). Change-Id: Ia0aac2f09e9245339951ffff13c829e910ee64e9 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com> Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* iOS: Skip tests that don't make sense or don't work on the platformTor Arne Vestbø2015-03-161-1/+1
| | | | | | Change-Id: Id6777bdf430ad8a8e3b432caf5000bea8f7860b6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* QStateMachine: add objectName to objects to ease debugging.Erik Verbruggen2015-03-161-1/+9
| | | | | Change-Id: I3c495cc5bd04c0cac24d4abf827d6acfb35b8433 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* QStateMachine: fix warnings in test.Erik Verbruggen2015-03-161-3/+2
| | | | | | | | - removed an unused field - initialized variable that might be used uninitialized. Change-Id: I7a7a063f025ecc32fa462dd8d5e2485c2ba52eb8 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Skip instead of entirely excluding tests with disabled featuresMarko Kangas2015-03-1616-55/+122
| | | | | | | | | | | | Properly QSKIP tests that use disabled QProcess and symlink features instead of excluding them silently by #ifdef. Other reason is that moc doesn't respect QT_NO_* defines in class definition which causes build issues on some platforms. Change-Id: I041020f7452f7d36c7ec8a5866a4ba5eb23d1f94 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Network tests: don't try to test against disabled network interfacesThiago Macieira2015-03-162-5/+8
| | | | | | | Other parts of tst_qudpsocket.cpp already did this check. Change-Id: Iee8cbc07c4434ce9b560ffff13ca545a03c9596a Reviewed-by: Richard J. Moore <rich@kde.org>
* Fix build of tests on QNX.Rafael Roquetto2015-03-146-69/+101
| | | | | Change-Id: Ib28e42e3eb10e26555fe392c55534f715bee5f8b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* tst_QUrl: Add extra testcasesThiago Macieira2015-03-141-1/+10
| | | | | | | Task-number: QTBUG-44921 Task-number: QTBUG-44920 Change-Id: Iee8cbc07c4434ce9b560ffff13ca303803916c2d Reviewed-by: Richard J. Moore <rich@kde.org>
* Improve rounding in QCosmeticStrokerAllan Sandfeld Jensen2015-03-121-0/+45
| | | | | | | | | | | Fixes the drawn position of end points in drawLine. Based on a patch by Jørgen Lind, and modified so that it caused no test regressions. Task-number: QTBUG-38144 Change-Id: I24aa28480cc6ae09abf91d80378970565a29b254 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Cocoa: Correct mouse event forwarding for popupsMorten Johan Sørvig2015-03-122-0/+156
| | | | | | | | | | | | | | | | | | | | We need to track the active popup globally, having parent windows track child popups is not sufficient since there may be one or more intermediate windows in between the event receiving window and popup window. Add API to QOCocoaIntegration for tracking the global popup window and use it instead of the per-window tracking. Make sure to only close popups on clicks outside the popup only. Add code to QNSView::handleMouseEvent that redirects mouse events to the active popup. Add manual test. Change-Id: Ia3e3fd42d8fddf5c69f0c6879b333ca544521f61 Task-number: QTBUG-43464 Task-number: QTBUG-31937 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Track modifications of white space in QString::simplified().Friedemann Kleint2015-03-121-0/+2
| | | | | | | | | | The existing check fails to detect the case where white space characters other than the space character are replaced by space characters without the length actually changing and returns the original string. Task-number: QTBUG-44936 Change-Id: Ice6faa975f8b41f185c76f6d0d4ff81603e25eb3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_QWindow::initialSize: Use showNormal() instead of show()v5.5.0-alpha1Tor Arne Vestbø2015-03-121-3/+3
| | | | | | | | | | | | | On some platforms show() may result in the window being shown full screen, depending on the defaultWindowState of the platform. If that's the case, the resulting window size does not follow the requested size (though the internal normal geometry should). We need to use showNormal, so that we guarantee that the window state is WindowNoState. Change-Id: Ied080eaca13d759501ea292b5e6b2df4e3b32426 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* CMake: Fix regression with quoted OPTIONS parameterAndré Klitzing2015-03-111-0/+3
| | | | | | | If a parameter contains quotes the check for "-binary" fails. Change-Id: I27148b590d85291a93f1992dfd277fb857bec6e2 Reviewed-by: Stephen Kelly <steveire@gmail.com>
* tst_QDateTime: remove silly test for timezone date too earlyThiago Macieira2015-03-111-7/+5
| | | | | | | | | | Let's not try to to compare our QTimeZone handling with the system one. Our handling goes beyond the range of the POSIX APIs, so that's a recipe for error. Change-Id: Iee8cbc07c4434ce9b560ffff13ca4a4f335bdbae Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* tst_QDateTime: Mark more Windows incorrect transitionsThiago Macieira2015-03-111-0/+12
| | | | | | | | | | | | | | The refactoring from a8c74ddcf78604c9038ba2a2bea81e445e4b3c58 commit exposed more issues in the Windows API. There were already quite a few QEXPECT_FAIL for this, so this isn't new. For example, localtime(1351386000) on the Central European Timezone should be "Sun Oct 28 02:00:00 CET 2012" (the second occurrence of 2 am), but the Windows API returns tm_isdst = 1 (i.e., still in the CEST timezone) and that's incorrect. Change-Id: I1bc63ac99b1d67b55d783f9606e5c59b24223b13 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Fix regression in time zone handlingFrederik Gladhorn2015-03-111-12/+0
| | | | | | | | | | | | In QtScript we use the msecs since epoch conversion (JS date is based on the concept). After a8c74ddcf78604c9038ba2a2bea81e445e4b3c58 the date conversion test in qtscript started to fail. Instead of relying on the code working by chance, simply update the date when setting it with setMSecsSinceEpoch. Task-number: QTBUG-44885 Change-Id: I9f95c9cdccea52e7d1f808f3cb9e18570ef0df13 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QAbstractButton: emit released on focus out or disableFrederik Gladhorn2015-03-101-0/+32
| | | | | | | | | | | | | When pressing a button with the mouse and then moving the focus away, the internal and visual state of the button would get updated, but the released signal would not be emitted. The same goes for disabling the button, although in 99% of the cases, disabling the button will also move the focus, so the first case already takes care of emitting the signal. Task-number: QTBUG-42775 Change-Id: Ib6ba8e0a75f0349b66d1e799b02bd8498db85022 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Remove cruftFrederik Gladhorn2015-03-091-18/+0
| | | | | Change-Id: I8e0bf5b9befb0e9639da15b07072d046c038ea85 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Fix building tests on QNXAllan Sandfeld Jensen2015-03-092-9/+4
| | | | | | | Use qmath and cmath methods instead of math.h methods. Change-Id: I86ee2465c999822bf00a7cefee1642c4c30590a6 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
* QStringAlgorithms::simplified_helper: add missing check for detachedThiago Macieira2015-03-071-0/+9
| | | | | | | | Otherwise, we modify shared strings that happened to be rvalues. Task-number: QTBUG-44706 Change-Id: Ia0aac2f09e9245339951ffff13c85bfc912f03d1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Fix race condition in QDateTime::timeZone() and other methodsThiago Macieira2015-03-071-0/+53
| | | | | | | | | | | | | | | | | | | | When timezone support for QDateTime was added, we decided it was a good idea to delay creating the QTimeZone object and checking that the time is valid in that timezone (including for local time) until the user requested that information. Unfortunately, QExplicitlySharedDataPointer returns a non-const T* in operator->(), which meant we were accidentally modifying the d pointer's contents in const methods, which in turn means those const methods were not thread-safe when operating on the same object. This commit changes the d pointer to QSharedDataPointer, which is safer in this regard and pointed out where the issues with constness were located. Since we can't lazily calculate QTimeZone anymore, we need to do it whenever the date, time or offset changes. Task-number: QTBUG-43703 Change-Id: Ic5d393bfd36e48a193fcffff13b9686ef4ef1454 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Introduce QQuaternion::rotationTo(vecFrom, vecTo)Konstantin Ritt2015-03-071-0/+60
| | | | | | | | | which returns the shortest arc quaternion to rotate vector from to the destination vector to. Change-Id: Ibd7a746789ecdfe6f7fe17e4ac9049f7ac46560d Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* [QQuaternion] Add a way to convert to/from orthonormal axesKonstantin Ritt2015-03-071-28/+95
| | | | | | | | It is just a convenience wrapper around convertion to/from the rotation matrix. Change-Id: I27511b43866827172960b0152f1c7b65da857f6f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add a QHostAddress::toIPv4Address overload taking a bool *okThiago Macieira2015-03-061-0/+48
| | | | | | | | | This allows one to check whether the conversion is successful without checking for the return result, as the value of 0 represents the valid IPv4 address 0.0.0.0. Change-Id: I637fe55583f2255c85b0d955e5886b61494e0c7c Reviewed-by: Richard J. Moore <rich@kde.org>
* QHostAddress: Revert auto-converting of IPv6 v4-mapped addresses to IPv4Thiago Macieira2015-03-061-0/+5
| | | | | | | | | | | | | | | | | | | In 85136496bc8517951dcc3e670d1a46d340819f0d, Shane made QHostAddress automatically convert any IPv6 address that was v4-mapped to IPv4 in QHostAddress. While that is an interesting trick, it prevents us from being specific about what we want. On some OS (like FreeBSD and OS X), the distinction is relevant, so keep it. Moreover, it was inconsistent: it might fail depending on how the QHostAddress was constructed and the order of comparison. [ChangeLog][Important Behavior Changes] QHostAddress will no longer convert IPv6 addresses of type "v4-mapped" to IPv4. To perform this conversion manually, construct another QHostAddress with the result of toIPv4Address(). Change-Id: I06afbc7018539804bb3044ef1fe6a49ac7a5f240 Reviewed-by: Richard J. Moore <rich@kde.org>
* Make QPersistentModelIndex an internal meta-typeGabriel de Dietrich2015-03-062-0/+17
| | | | | | | | | | | It was already a user meta-type, so it only gets promoted to internal. [ChangeLog][QtCore] QPersistentModel index becomes an built-in meta-type, including QVariant support. Change-Id: I63d733d1eb66aa61691e7afce27fe7372a83ac00 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>