summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* statemachine: Make states exit order spec-compliantKent Hansen2012-08-011-6/+15
| | | | | | | | | | The SCXML spec states that entry order should be equivalent to "document order" and exit order should be "reverse document order". Since QStateMachine uses child order for the entry order, the exit order should be reverse child order. Change-Id: Ia7b05fdd5c9261ccf202f64f8d23f5c88b20a8c3 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Remove usage of deprecated qWaitForWindowShown(QWidget *) method.Friedemann Kleint2012-08-0135-233/+219
| | | | | Change-Id: I445d24a09dbb7abb62a37bd9914284f21a4f08f1 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Make sure that the parsing mode reaches QUrlPrivate::setHostThiago Macieira2012-08-011-1/+26
| | | | | | | | | | | | Ensure that the parsing mode is cascaded down from setAuthority and setUrl so that the hostname parsing does not attempt to decode percent-encoded hostnames when it shouldn't. Take the opportunity to also remove the "Boolean Trap" from QUrlPrivate::setHost. Change-Id: Ia64754c4a4900182700b7af1382aea8410abc7e9 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make QUrl::setScheme only parse in strict mode (no decoding)Thiago Macieira2012-08-011-3/+11
| | | | | | | | | | The URI RFC defines schemes as containing only a very restricted set of characters, none of which require encoding, so don't even try. Testing this behaviour in some web browsers indicate that they do not accept percent-encoded schemes either. Change-Id: I692dd20e1aac7e8a1bcb276cb5113b5802393d38 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix QUrl support for empty usernames and passwordsThiago Macieira2012-08-011-3/+9
| | | | | | | | | | | | | | | If the password is empty (but present), the userinfo component of the URL should end in a colon (":"). QUrl already supported that and it was tested (case "password-empty"). If the username is *also* empty but present, the userinfo component is just the colon (":"). Fix support for that case by checking if we stored the presence flag instead of checking the size of the component. Change-Id: Ie224493a997dbf76b2e44dd6d55fd9674ac83c1c Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix handling of encoded NULs (%00) in QUrl::fromPercentEncodingThiago Macieira2012-08-011-1/+3
| | | | | | | | | | | | | QString::fromUtf8, without an explicit size, (currently) defaults to stopping at the first NUL. That means we need to pass an explicit size. Also take the opportunity to test that QUrl::toPercentEncoding also works with the same data. Change-Id: I79362d67afda624b01ca07b0315b611c4aa3fdda Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: David Faure <faure@kde.org>
* don't change a widget's active state in QWindowsWindow::setWindowStateJoerg Bornemann2012-08-011-4/+0
| | | | | | | | | | | | | QWindow::setWindowState is not supposed to set the window active. The method requestActivateWindow() should be used for that. When switching from and to fullscreen mode we're always passing SWP_NOACTIVATE to SetWindowPos to not change the activation state of the window. This is inverse to the old behaviour, which did not have an effect. Change-Id: I339337935cdad76b3ef252202e92177f37543038 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Add command line options to windowgeometry testAndreas Holzammer2012-08-011-2/+17
| | | | | | | | | | Add -widgetminimized, -widgetmaximized, -widgetfullscreen, -windowminimized, -windowmaximized, -windowfullscreen as command line option to test creation of windows in these modes Change-Id: If192c131c8996d3b67648427e5784da47ffee971 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix reloading of pluginsLars Knoll2012-08-011-0/+24
| | | | | | | | | Unloading and reloading a plugin didn't work correctly, because we didn't reset instance to 0 on unload. Task-number: QTBUG-26098 Change-Id: Ic3e4497f359b1ca455be949dce9cafa9d67d8039 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* fix window activation in tst_qmdiArea::subWindowActivated2Joerg Bornemann2012-07-311-1/+1
| | | | | | | | | | | | | QApplication::setActiveWindow doesn't activate the native window but marks the widget as active inside Qt. We need to use QWidget::activateWindow instead. See docs. Also moved the activation call further down because on Windows a minimized window cannot be activated using the activation-by-focus fake we're currently using. Change-Id: I752f6ada1f463931fa9cfb3c35f42dbec0207bfa Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Implement synchronous WS events by flushing.Friedemann Kleint2012-07-311-4/+2
| | | | | | | | | | | | | | | | | | | | | | | Previously synchronous window system events were implemented by bypassing the queue and processing the event immediately. This is not ideal since the event order is not preserved - there might be "happened before" events waiting in the queue. Add QWindowSystemInterface::flushWindowSystemEvents and change all handleSynchronous* to 1) queue the event 2) call flushWindowSystemEvents. flushWindowSystemEvents is almost identical to the already existing sendWindowSystemEvents with the exception that it does not call QApp::sendPostedEvents. Move the common implementation to a new private function. Task-number: QTBUG-20778 Change-Id: Ie98a83875bc0a14e335e36bed0dd9e0ed4a1dea0 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Stabilize the QHeaderView test.Friedemann Kleint2012-07-311-1/+9
| | | | | | | | | | | | The test has a member QWidget *topLevel which it recreates and shows in init() without waiting for it to be exposed although it is not used in every test case. This apparently interferes with some tests that create separate top levels. Do not show in init(), delete the topLevel. Add wait to the cases where the topLevel is shown. Change-Id: Ib428020b36dc82991d41e68478fd583bdfb004c7 Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* tst_qwidget task reference fixedJoerg Bornemann2012-07-311-1/+1
| | | | | Change-Id: I8d65f5912bfc2daa1e35be33a3c4d986508eebeb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Stabilize QWidget-test alienwidgets on XCB.Friedemann Kleint2012-07-311-1/+1
| | | | | | | Use QTRY_VERIFY for the mappped attribute check. Change-Id: I3cbde9122405bf7067f3702193e80636edc8c5c6 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fixes to the qdom autotestLars Knoll2012-07-313-147/+14
| | | | | | | | | | Don't rely on a black list of codecs for the serialization test. This breaks badly when new codecs get added to Qt (e.g. through ICU). Instead use a white list of known codecs that can encode/decode the test data. Change-Id: I1dc55a25e852198bb935f070a4a21e8369f56268 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* ICU code page conversion supportLars Knoll2012-07-311-12/+13
| | | | | | | | | | | | | Use ICU to do code page conversion instead of the builtin text codecs. With this QTextCodec simply becomes a wrapper around ICU's ucnv_* methods. We only keep our own codecs for UTF-*, ISO-8859-1, ISO-8859-15 for performance reasons, and for TSCII and iscii-* because they aren't supported by ICU. Change-Id: I4fc49eba55cf772b9772c6dac606a47a44346a60 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Ensure that QAtomicPointer of forward-declared classes worksThiago Macieira2012-07-301-0/+17
| | | | | | | | This is working, but let's just be sure by adding a testcase. Change-Id: I8c6b5ded0c7b6c90645dbf70a7ce6c1ba447a284 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Make benchmarks compile without QtWidgetsRohan McGovern2012-07-309-5/+27
| | | | | | | | | | | Ensure benchmarks which need QtWidgets are gracefully disabled when that module is unavailable. Fixed one unnecessary usage of "QT+=widgets". Change-Id: I8031b5dca585749f0f4d22e0637adc3f57f4e418 Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* tests: fixed check for QtOpenGLRohan McGovern2012-07-301-1/+1
| | | | | | | | | | contains(QT_CONFIG,opengl) tells whether Qt itself is able to use OpenGL, which is not the same thing as whether the QtOpenGL API is available. Make the check correct; fixes compilation when Qt is configured with -no-widgets (which also disables QtOpenGL). Change-Id: Iaa296c2b10650971ef4846f8bc6f44761fadcf7c Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* tests: disable qstandarditemmodel test when building without QtWidgetsRohan McGovern2012-07-301-1/+4
| | | | | | | This test uses QTreeView. Change-Id: I6ba56ad6ec3687a5b90d516be10d6f88e248d53d Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* tests: removed QtWidgets dependency from tst_qsignalmapperRohan McGovern2012-07-302-16/+25
| | | | | | | | This test was using some QSpinBox instances to generate signals for testing. Use our own QtTestObject to generate the signals instead. Change-Id: I3714955ae040d541c3b613a478945c38a18be18d Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* fix host vs. makefile directory separator messOswald Buddenhagen2012-07-281-4/+12
| | | | | | | | | | | | | | | | | the system path separator and shell are bound to the host system (system() will use cmd even on mingw with sh.exe in path). the makefiles otoh may depend on what the qmakespec defines. consequently, add $$system_path() and $$system_quote() (for use with system() & $$system()). $$native_path() is renamed to $$shell_path() and should be used with $$shell_quote() to produce command lines in makefiles. $$QMAKE_DIR_SEP needs to be applied to Option::dir_sep right after parsing the spec, so it is available to $$shell_{path,quote}(). Change-Id: If3db4849e7f96068cf03a32348a24f3a72d6292c Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Work on the QWidget-autotest.Friedemann Kleint2012-07-282-269/+335
| | | | | | | | | | | | | | | | | - Introduce smart pointers to delete widgets and resources to ensure tests are not affected by left-over widgets also in case of failure. - Replace deprecated QTest::qWaitForWindowShown() by QTest::qWaitForWindowExposed() and use QVERIFY, remove some hard-coded timeouts. - Set some titles and object names. - Add verbose debug output of event lists in tests childEvents. - Set minimum sizes on widgets to avoid Windows warnings. - Stabilize GDIWidget, trigger on first event only. Change-Id: I64119a2e7113e4a9f0156d00c72ce0935d03bb81 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* QDebug: Add getter/setter for auto-insert-spaces.David Faure2012-07-271-0/+21
| | | | | | | | | | | | This is useful for inserting a string without space-handling, given that dbg.nospace() followed by dbg.space() inserts a space. It's also useful for QDebug operators for custom types, so that they can disable space handling and then restore to whatever it was before (rather than forcing it to space() mode). Change-Id: I9d72e9ffbcbc581ed093168752c29af924405b33 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix crash in QVariant::canConvert().Volker Krause2012-07-271-10/+18
| | | | | | | | | When containing a QObject (or sub-class) pointer and trying to convert to a QObject pointer canConvert() did dereference the pointer without checking for it being null. Change-Id: Ie274e54f2f817f2b6c5df64504f8af6359b8f38d Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Implement implicit constructors for built-in classes.Stephen Kelly2012-07-273-0/+121
| | | | | | Change-Id: I6b0b104bc1da3252d014615c50b81830de42e722 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix position of mouse events generated from touch events.Andrew den Exter2012-07-261-0/+10
| | | | | | | | | | | In touch event terminology the global position is the screenPos, scenePos is the windowPos. Fixes a tst_qdeclarativepincharea test failure in qtquick1. Change-Id: Ie98fe12be8cbedc9b019913b066e7c4bce75278d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
* Stabilize tst_QMenu::tearOff().Friedemann Kleint2012-07-261-3/+1
| | | | | | | Introduce QTRY_VERIFY for frequently failing test. Change-Id: I38a6420574c4dde20fd7fa484681514543bd70cb Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Stabilize tst_QCompleter::QTBUG_14292_filesystem.Friedemann Kleint2012-07-261-4/+92
| | | | | | | | Make sure the test subdirectories are actually visible in the file model before the tests start. Change-Id: If640456bba4362b19d7ad9d9184736c2eb8d3bde Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Base 'FileSystem' test helper class on QTemporaryDir.Friedemann Kleint2012-07-264-70/+70
| | | | | | | | | This avoids test instabilities and prevents test directories from being cluttered with temporary files. Change tests accordingly. Remove unused createLink() method. Change-Id: I843c28ab81c8a476c71c5211a7479b22d3d9fc93 Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* QMetaTypeId2::IsBuiltIn: (new) template meta-function to check for built-in ↵Marc Mutz2012-07-263-0/+39
| | | | | | | | | | | | | | | types This allows to check whether QMetaTypeId2::MetaType exists, and can help turn run-time into compile-time expressions, even without constexpr support, or in situations where constexpr can't be used (because you can't overload on it). This was designed for the QMetaType::registerConversion feature, but it's much more widely applicable. Change-Id: Iafa04add04bcb531b3f7fe3e751c7e91ee6a3bc0 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* QtNetwork: use nullary version of qRegisterMetaType<T>("T")Marc Mutz2012-07-2510-30/+3
| | | | | | | | | | | | | | | | | Using the nullary version has the advantage that multiple calls during a program run are much more efficient, since an inlined atomic is used to store the result. It also ensures that Q_DECLARE_METATYPE(T) has been used, whereas qRegisterMetaType<T>("T") will happily register anything. So I've added the macro where it was missing, or moved it to a central place when it existed hidden. In tst_qnetworkreply, this became a bit tricky, because a private header is conditionally included, so moved the Q_DECLARE_METATYPE() into a conditional section, too. Change-Id: I71484523e4277f4697b7d4b2ddc3505375162727 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove usage of deprecated qWaitForWindowShown(QWidget *) method.Friedemann Kleint2012-07-2516-119/+107
| | | | | | | | Remove usages from autotests with the exception of widgets/kernel, widgets/widgets and widgets/graphicsview. Change-Id: I917b2857ed0cd07a6b3dbcd69244f558086c6586 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* tst_qmetatype: fix two more unused typedefs (GCC 4.8 warning)Marc Mutz2012-07-251-3/+1
| | | | | | | | | Also check the return value of DefaultValueFactory<QMetaType::Void>::create(), the same way it's done in testCreateHelper<QMetaType::Void>(). Change-Id: I3e6d7fca4ea74dbe65009f2eb2c64a1b3a370d68 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QObject: add a macro for conveniently setting the object nameMarc Mutz2012-07-251-8/+8
| | | | | | | | | | | | | | | | | | This is a simplified port of KDTools' KDAB_SET_OBJECT_NAME. It simply assigns the variable name as the objectName of a QObject, uic-style. It uses a small helper function so that it works on references as well as pointer variables. QLabel label; QLabel *pLabel = new QLabel(); Q_SET_OBJECT_NAME(label); Q_SET_OBJECT_NAME(pLabel); Change-Id: I25fec0c90f33249a3ea5d2dd622ab708019fd101 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QtWidgets: use nullary version of qRegisterMetaType<T>("T")Marc Mutz2012-07-251-1/+0
| | | | | | | | | | | | | | | | | | | Using qRegisterMetaType<T>() has the advantage that multiple calls during a program run are much more efficient, since an inlined atomic is used to store the result. It also ensures that Q_DECLARE_METATYPE(T) has been used, whereas qRegisterMetaType<T>("T") will happily register anything. Had to add Q_DECLARE_METATYPE to QFileInfo, for QList<QPair<QString,QFileInfo>> of QFileSystemModel to work with the partial specialisations of Q_DECLARE_METATYPE for QList, QPair. In order to synchronize this change with other modules that did their own Q_DECLARE_METATYPE(QFileInfo), a sync macro is defined that can be tested in other modules, and will later be removed again. Change-Id: I3004664e07e64cd885d5a03a57ff4e4379804aec Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add QSignalSpy::wait() method.David Faure2012-07-251-1/+54
| | | | | | Change-Id: I1f3b49e3dee19bf0b1d2933c6e6ad7972186e0d0 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Deprecate the qWaitForWindowShown(QWindow *) method.Friedemann Kleint2012-07-256-42/+40
| | | | | | | | | | | | | | While the qWaitForWindowShown(QWidget *) is inherited from Qt 4.8, the qWaitForWindowShown(QWindow *) was introduced in Qt 5. As it is identical to qWaitForWindowExposed() and removed already, it can be deprecated in Qt 5. Remove its usages in qtbase. Change-Id: I28788d120ad687a49f02b2b44de6b38a2832fe5c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Split the QGuiVariant test from the Core one.Stephen Kelly2012-07-2554-402/+667
| | | | | | | | | | | This makes development on the meta type system easier because only QtCore must be re-built to run most of the tests. The existing QGuiVariant test needs to be run before pushing anyway, but not so frequently. Change-Id: I1fa66edbd790c957e1a232226847dd550227a477 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Use a large core type for the QVariant::setValue test.Stephen Kelly2012-07-251-2/+4
| | | | | | | | | The type needs to be large enough that QVariantIntegrator<T>::CanUseInternalSpace is true. Change-Id: I311c44bedfebd946e41639975df206c27b6d55ca Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Make qRegisterMetaType constexpr for built-in types.Stephen Kelly2012-07-251-0/+30
| | | | | | | | For consistency with qMetaTypeId, and because we can. Change-Id: I6882a16ef3c0d84539048c9f2c201c4a2b2ca7ad Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Remove obsolete or commented use of Q_DECLARE_METATYPE.Stephen Kelly2012-07-241-5/+0
| | | | | Change-Id: I15bc845801b9f84a9252a0092fbd69f0e1b3f4ea Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Propagate synthesized mouse events in parallel (lock-step) with touchKevin Ottens2012-07-242-13/+173
| | | | | | | | | | | | | | | | | | | | This patch implement the equivalent of 468626e99a90d6ac21cb311cde05c658ccb3b781 in qtdeclarative but for QtWidgets. If a widget doesn't accept a touch event, then QApplication gives it another try by synthesizing a corresponding mouse event. This way QtQuick and QtWidget behave in a similar way, removing the need for platform backends to try to emulate a mouse event from a touch event unconditionally. Also add relevant unit tests and adjust old QApplication ones. Change-Id: Iddbf6d756c4b52931a9d1c314b50d7a31dbcdee9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Replace old typedefs with their built-in equivalents.Stephen Kelly2012-07-241-4/+2
| | | | | Change-Id: I3ecb75ace431b92a13de67aa6426cf570398587f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix typo pallete -> palette.Stephen Kelly2012-07-241-2/+2
| | | | | Change-Id: I17b71bfed22c3692b027556ef2e5d6ece4f3f77e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QAbstractItemView: don't qRegisterMetaType<QModelIndex>Marc Mutz2012-07-243-22/+0
| | | | | | | | | | QModelIndex is a build-in type nowadays and doesn't need to be registered anymore. Also remove them from the tests. Change-Id: I47029972651c045c880cee86fb292116a29493d5 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add tests of the various testlib definition possibilities.Stephen Kelly2012-07-248-0/+206
| | | | | | | | | | | The behavior of QTEST_MAIN depends on whether QT_GUI_LIB or QT_WIDGETS_LIB is defined. It could create a QGuiApplication or QApplication which could cause linking issues if the corresponding library is not linked to. The failure cases are also tested. Change-Id: I61ed0bc760564ef42ce1dbd86c83c06348c860ff Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove the unnecessary qdebug.h includes in the QPoint(F) testsLaszlo Papp2012-07-242-2/+0
| | | | | Change-Id: I5c45af9d498e20b46d6faf8c96de87586eca7b4a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove usage of deprecated qWaitForWindowShown in dialog tests.Friedemann Kleint2012-07-245-32/+34
| | | | | Change-Id: Id3ebe202d65ee682e8e2e3ae107808e9abb6cc15 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* WindowSystemInterface::sendWindowSystemEvents(): Remove unused parameter.Friedemann Kleint2012-07-231-3/+3
| | | | | | | | No need to pass the dispatcher. Get rid of Windows logic to maintain a stack of dispatcher associated with flags. Change-Id: Ic2daad4b6762a46fac3274937effc188af436c9a Reviewed-by: David Faure <faure@kde.org>