summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Use QPointer instead of QWeakPointer.Stephen Kelly2012-06-055-11/+11
| | | | | | | | The use of QWeakPointer for tracking QObject pointers is to be deprecated. Change-Id: If460ca7f515db77af24030152f4bd56e1a5fae7c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Write test to confirm QStateMachine calls connectNotify().Mitch Curtis2012-06-051-0/+35
| | | | | | | Task-number: QTBUG-16628 Change-Id: I77535fcb9a6ae306df8ccd670ee1bfc32721d66a Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Correctly locate files with relative pathsLars Knoll2012-06-051-2/+0
| | | | | | | | | | | | QUrl("relativefilename").toLocalFile() changed behavior and now returns an empty string if the scheme is not set. Setting the scheme to "file:" in setSource would however break some other assumptions in the code about relative url's. Task-number: QTBUG-22416 Change-Id: I1b3fcbef81f6e356935ec426903989e783ce9a78 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make QIODevice::seek() return false for sequential files.Mitch Curtis2012-06-051-2/+2
| | | | | | | Task-number: QTBUG-18173 Change-Id: Ie3a96d3a6f60995b8ba7823153778869d0c2dc58 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* tst_qtoolbutton: stabilize and improve failure messageRohan McGovern2012-06-051-2/+7
| | | | | | | | | Allow for a little more leeway in timers. Task-number: QTBUG-26004 Change-Id: I59936d0f675b7f734e04b3f5e63631c74ca4f163 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Fix QTemporaryFile::open() failing after remove().Mitch Curtis2012-06-051-0/+20
| | | | | | | | | | | | | If a QTemporaryFile is constructed using a template file path, the path is generated in QTemporaryFileEngine::open() and then filePathIsTemplate is set to false. If remove() and then open() are called on the same QTemporaryFile, the path is not regenerated. This change ensures that if the file path was generated, it will be generated again in the scenario above. Task-number: QTBUG-2557 Change-Id: I718ceb89daa9a9d46fdbe811fecc3d57d6dc08c2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make QString("inf").toFloat() return inf instead of zero.Mitch Curtis2012-06-051-0/+15
| | | | | | | | | | | Currently, QString::toFloat() returns 0 (and sets ok to false) if you try to convert "inf". This is because inf is greater than QT_MAX_FLOAT and there is currently no check to handle inf. Task-number: QTBUG-8629 Change-Id: I498daf4a7a6f880f928461fca628fcaf7d1d6d08 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Improve the QTextBoundaryFinder autotests a lotKonstantin Ritt2012-06-051-256/+394
| | | | | | | The existing tests has been retained, the new ones has been added. Change-Id: I12ae1b4e63dde46f3b14a7c1423c13d5881d4507 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add QDeferredDeleteEventBradley T. Hughes2012-06-051-1/+1
| | | | | | | | | | | Use this to store the loop-level counter needed by QCoreApplication when determining when it is safe to delete an object. This removes the hack to hijack the QEvent::d pointer (even though the pointer is unused). Change-Id: I91c0b1aa00235ec6e13feb30bf928e56d2f80026 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Allow 24:00:00 for ISO dates in QDateTime::fromString().Mitch Curtis2012-06-051-0/+16
| | | | | | | | | | | ISO 8601 section 4.2.3 states that "The end of one calendar day [24:00] coincides with [00:00] at the start of the next calendar day", so fromString() was updated to account for this. Task-number: QTBUG-25387 Change-Id: I391db0da755dbc822ba0820c302a2c10391e1f3b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace QTEST_APPLESS_MAIN with QTEST_MAIN in tests using QProcessRohan McGovern2012-06-053-3/+3
| | | | | | | | | | QProcess requires an application object to be created in order to work correctly on Windows. Task-number: QTBUG-26023 Task-number: QTBUG-26024 Change-Id: Ifa90946262bc7e2a7df6b6aad54e10b54473fc97 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Enter initial state before QStateMachine::started() is emittedKent Hansen2012-06-041-0/+18
| | | | | | | | | | | | | | | The documentation says that started() "is emitted when the state machine has entered its initial state", but the implementation didn't adhere to that. The consequence is that if you e.g. emitted a signal from a slot connected to started(), and that signal was used by a transition from the initial state, the signal would effectively get ignored and the state machine would remain in the initial state. Task-number: QTBUG-24307 Change-Id: Ibbeb627d517eaff821d88e256a949eacf6aae350 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Fix typos in QState sorting functionsKent Hansen2012-06-041-2/+17
| | | | | | | | | | | | | | A QObject can't be a child of itself, so the comparison always returned false. In practice, this was causing the entry/exit order of parallel states to be random. QObject::children() is documented to contain the children in the order in which they were added, so this fix actually achieves deterministic behavior. Task-number: QTBUG-25959 Change-Id: Id3f12d6bfbc249f1d4fed0bafb7d0217093e458e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* tst_languagechange: increased timeout on WindowsRohan McGovern2012-06-041-0/+1
| | | | | | | | | | | This test's runtime significantly varies on separate runs on Windows; runtimes from 10 to 830 seconds have been observed in CI. Increase the timeout to restore CI stability. Task-number: QTBUG-26006 Change-Id: Iba153e65264a177d146b2f3647ec6ba529af7135 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* avoid redundant testsOswald Buddenhagen2012-06-011-6/+2
| | | | | | | | tryRun() already implies tryLink() and tryCompile(), so there is no point in executing the stages separately ... Change-Id: Id7321efaca474e8c5db2bc246ac26323d8a99e58 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Marked expected failures in tst_qtextlayout on WindowsRohan McGovern2012-06-011-0/+14
| | | | | | Task-number: QTBUG-25924 Change-Id: I24a8ab6a695bf76f19e9082e1d8b11d8ec03fc4f Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Add private API for working with meta-methods in signal index rangeKent Hansen2012-06-012-1/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Internally, QObject and QMetaObject already leave out non-signal methods when working with signals. This is possible because the signals always come before other types of meta-method in the meta-object data. Ignoring irrelevant methods is faster and can save memory. QMetaObject provides internal indexed-based connect() and disconnect() functions. However, these functions currently take an absolute method index as the signal specifier, instead of an absolute _signal_ index. Hence, QMetaObject and friends must convert from the method index range to the signal index range. By providing an API that only considers signal indices, clients of the index-based QMetaObject::connect()/disconnect() can provide the proper signal index directly. Similarly, for the qtdeclarative integration (QDeclarativeData hooks) the signal index can be passed directly. This will eliminate most of the conversions back and forth between signal index and method index, and some other redundant work done by qtdeclarative's custom connection implementation. There are some places where the behavior can't be changed; for example, QObject::senderSignalIndex() will still need to return an index in the method range, since that function is public API. Changing QMetaObject::connect()/disconnect() to take an index in the signal range will be done in a separate commit; this commit is only an enabler for porting existing usage of those functions to the new behavior. Change-Id: Icb475b6bbdccc74b4e7ee5bf72b944b47159cebd Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix a bug in the case conversion codeLars Knoll2012-06-011-0/+2
| | | | | | | | | | | Chars that have a case conversion that converts them into several characters can't be handled by QChar::toUpper() etc and should get ignored. The code didn't do that correctly. Change-Id: I281d122e90bf49187b6449088d2fccef2ef75e86 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix the QVector build with C++11 initialiser listsThiago Macieira2012-06-011-2/+2
| | | | | | | | | | | | Initialiser lists were not tested before in the QVector rewrite, so the older malloc call was left behind. Also, std::initializer_list has const iterators returning const data and broke the build in a few places where const qualifiers were missing. Change-Id: I3c04e58361989aa7438621cda63c7df457d7dad8 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Make QVector compile with QT_STRICT_ITERATORS againThiago Macieira2012-06-011-0/+3
| | | | | | | | | | | | Move the iterator classes into QArrayTypedData and add constBegin() and constEnd() to that class. I also had to add an operator T*() to the strict iterators, since there are many places that expect the iterator to behave like a pointer (including in QVector itself). Change-Id: Icc5ed56ad47b013664a48eef9d31b5273aecb4e3 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Make tst_qabstractnetworkcache parallel-safeRohan McGovern2012-06-012-3/+5
| | | | | | | Use a unique QTemporaryDir instead of a fixed path for the test cache. Change-Id: Ib664033a509a6cefd7c323708f80ef595b202178 Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Mark tst_qfreelist as parallel-safeRohan McGovern2012-06-011-0/+1
| | | | | | | This autotest appears to be parallel-safe. Change-Id: I12f9202633941e9339de0709353efb2b41df4fa1 Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Fix crash in QStringBuilder when concatenating data-less QLatin1StringChris Adams2012-06-011-0/+7
| | | | | | | | | Previously, the append functions in QConcatenable in the QStringBuilder dereferenced the data() pointer of the argument QLatin1String without performing null check. Change-Id: I629f19fbce3113f1f80f4272fa7ae34e1dbc6bee Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix tst_qlistwidget::fastScroll test caseMiikka Heikkinen2012-06-011-0/+5
| | | | | | | | | | | tst_qlistwidget::fastScroll fails if the mouse cursor happens to be over the tested widget, because that causes an item to highlight, resulting in unexpected region of widget to be painted. Fixed by forcing the mouse cursor off the widget before the test. Task-number: QTBUG-24299 Change-Id: I8f45541feda44681179d43eda67d970d5fea4e40 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* QPA tablet event supportLaszlo Agocs2012-05-311-0/+58
| | | | | | | | | | Should be sufficient to allow implementing the actual functionality in xcb/cocoa/windows to match the Qt 4 level of tablet event support. Task-number: QTBUG-25864 Change-Id: Iebcca256dfba841d8976b58fda1b76026d3133a3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Make tst_qnetworkdiskcache parallel-safeRohan McGovern2012-05-312-26/+35
| | | | | | | | Use a QTemporaryDir for a unique test cache directory for each process, rather than a fixed path. Change-Id: I64df8422d01282bbc108e942947c1b55368bd941 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Improved stability of tst_qstatemachine, mark as parallel-safeRohan McGovern2012-05-312-1/+2
| | | | | | | | | | | | | | tst_QStateMachine::postEventFromOtherThread() assumed that 10,000 iterations of the event loop in a separate thread could always be completed successfully within the default QTRY_COMPARE timeout. This may be false if the CPU load is already high - such as when running other tests concurrently. Decrease the iteration count. Change-Id: I780523f73c0c16fa0b2ab3201b2b0affdebc198d Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Make tst_qtextstream parallel-safe.Rohan McGovern2012-05-312-8/+21
| | | | | | | | Write to a QTemporaryDir instead of the test's build directory. Change-Id: Ib65a0d58fbdf8caf8f2cb7002aeed1ce34742183 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Marked tst_qtemporaryfile as parallel-safeRohan McGovern2012-05-311-0/+1
| | | | | | | | | | This test failed a parallel stress test, but seemingly only because it writes to its own build directory. This should not interfere with other running autotests. Change-Id: I27a2f31e32a5b8157ef1082cf0e939bcc0c61c70 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Marked tst_qfile as parallel-safeRohan McGovern2012-05-311-0/+1
| | | | | | | | | | This test failed a parallel stress test, but seemingly only because it writes to its own build directory. This should not interfere with other running autotests. Change-Id: I80e548fdb0e915ebe86dcd2205537cb6fee09cff Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Implement QVector with QArrayData interface.Jędrzej Nowacki2012-05-304-125/+1422
| | | | | Change-Id: I109f46892aed2f6024459812d24922b12358814d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Marked tst_qprocess as parallel-safeRohan McGovern2012-05-301-0/+1
| | | | | | | | | | This autotest appears to be parallel-safe. It fails our parallel stress test, but only because it writes to its own build directory. This should not interfere with other autotests. Change-Id: Ie99dde24edc0fda0c8ec4352a6e44abb7cbc54f8 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Fix Qt 5 todo issues for QSizePolicy.Jan-Arve Saether2012-05-303-0/+231
| | | | | | | | | | | | | | * Merge the two public ctors. * Use bitflags instead of shifting bits (more readable). * Add autotest * Use int datatype for the "stretch setters". (values out of bounds are clamped) Streaming to QDataStream will still use the Qt 4 format. Task-number: QTBUG-25100 Change-Id: Iecb1e78cb12717e4d84448484c3ad8ca469d571a Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* QtPrintSupport - Add QPrinterInfo api for more printer detailsJohn Layt2012-05-291-1/+8
| | | | | | | | | | | | | | | A previous commit changed the Mac behaviour for printerName() from returning the CUPS Description to returning the CUPS Name. In case anyone was relying on this for a human-readable name add new api to return the CUPS Description. Also add the Location and Make and Model which will be used in the Unix print dialog instead of directly calling CUPS. Change-Id: I9901bf8d6368466adf111580f5db5a3f01ca9170 Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: John Layt <jlayt@kde.org>
* Set explicit testcase.timeout for slow testsRohan McGovern2012-05-295-0/+5
| | | | | | | | | | | | We'd like to decrease the default timeout for tests in the Qt Project CI so that we waste less time waiting for hanging tests. Tests which genuinely take a long time to run, such as these, should have their timeout explicitly set in their .pro file. Change-Id: I4fe6249e9efa764b230251d73a1115c24411e168 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Make tst_qfiledialog2 closer to parallel-safe.Rohan McGovern2012-05-291-18/+23
| | | | | | | | | | | Use a QTemporaryDir instead of the system-wide temporary directory. The test is still not entirely parallel-safe (at least on X11) due to requiring the shown dialog to have keyboard focus. Change-Id: I628dc6ab52dda49f6957a301eea8944bb9d81453 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Make tst_selftests parallel-safe.Rohan McGovern2012-05-292-3/+18
| | | | | | | | | Use a QTemporaryDir for temporary files, instead of the current working directory. Change-Id: Ifeb2944238f785a1f7beb0dc2a7c1e092d121db5 Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com> Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Mark tst_qsharedpointer as parallel-safe.Rohan McGovern2012-05-291-0/+1
| | | | | | | | | This autotest seems to be parallel-safe. It was not marked as such due to an issue which rarely causes the test to hang on exit on Windows, but that appears unrelated to whether or not the test is run in parallel. Change-Id: I30bac75be3ddc14139594605481eb6af3f6795e7 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Marked tst_qmake as parallel-safeRohan McGovern2012-05-291-0/+1
| | | | | | | | | This autotest fails a parallel-stress test because it writes into its own source/build directory. However, by inspection, it appears not likely to cause issues with any tests other than itself. Change-Id: I13789ba14bab240d34c22c5b77d6407995423afc Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Make tst_qfilesystemmodel parallel-safe.Rohan McGovern2012-05-292-1/+2
| | | | | | | | Changed one testfunction to use the test's own QTemporaryDir instead of the system-wide temporary directory. Change-Id: I6740a7f4ba7f53174cd0730239d8dc088e5111ba Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Make tst_qnetworkreply parallel-safe.Rohan McGovern2012-05-292-2/+3
| | | | | | | | | Ensure we always use a unique filename when writing to test files. The test already contained code for this, but it was not applied in a couple of places. Change-Id: I1e29ee162c390e014688ab46e3658e2a463d203e Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Eliminate QTreeWidget drag crashJiewen Wang2012-05-281-0/+42
| | | | | | | | | | | | | In QTreeViewPrivate::adjustViewOptionsForIndex() wrong index had been used when referencing to array of viewItems. Variable row is set to the index of the QModelIndex, however it is not as same as the index in viewItems[] when there was hidden item in treeWidget. Index of viewItems[] should be used here. Unit test is added as well. Change-Id: Idc7eda979e7d09c5a07bd6dffd92b7abbac10e67 Task-Id: QTBUG-25333 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add CONFIG+=parallel_test to suspected parallel-safe tests.Rohan McGovern2012-05-28171-0/+171
| | | | | | | | | These tests have passed a parallel stress test on all three of Linux, Mac, Windows. Mark them with CONFIG+=parallel_test to allow CI to run them in parallel, saving time. Change-Id: I19fd333c3c645a67374ca998f6c8530dd236b0f8 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Marked tst_qprocess insignificant on macRohan McGovern2012-05-281-0/+1
| | | | | | | | | tst_qprocess::lockupsInStartDetached sometimes locks up on mac. Mark this as a known issue. Task-number: QTBUG-25895 Change-Id: I08b1bcf39f2bf373e74509a06415d9ba514b8993 Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Fixed unused function warning in qtextdocumentfragment test.Mitch Curtis2012-05-281-18/+0
| | | | | Change-Id: I74bb961bf23c4ca1e8e5dc77e870d43fcecc5c09 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* QStatusBar::showMessage will always take new timeoutJiewen Wang2012-05-251-0/+45
| | | | | | | | | | | There is a message check in QStatusBar::showMessage causing the call exits early if the new 'message' is the same as the current message. The check has been removed, and new timeout will always take effect. Unit test is added as well. Change-Id: I3a03c6842835824caba4adc37c3ed834952c4bb2 Task-Id: QTBUG-25492 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* QTBUG-16850: QLineEdit::setSelection removes blank charactersTarja Sundqvist2012-05-251-0/+11
| | | | | | | | | Changed checking of the start position so that it does not call d->control->text() because this removes blank characters when an input mask is used. Thus the selection fails. Instead d->control->end() is used for checking the start position. Task-number: QTBUG-16850 Change-Id: I62992fb81bd47d432bade9f219782d48eb309956 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* QtPrinterInfo: Improve QPrinterInfo TestingJohn Layt2012-05-251-163/+88
| | | | | | | | | | | | | | | | | | | Much of the current QPrinterInfo tests fail due to being dependent on specific physical or network printers being attached. This change removes all printer specific tests and replaces them with generic tests that will use whatever printers are installed. Note if no printers are installed then the tests will still pass. A later change will add virtual printers to test returned results are correct. Windows test code is also required and will come later. This does not yet remove the "insignificant" status from the test, further improvements and code fixes are still required. Change-Id: I60802445924edb126aadf78337a8cb6f2f3b3d37 Reviewed-by: John Layt <jlayt@kde.org>
* Write QList unit tests for movable, complex, etc. types.Mitch Curtis2012-05-241-302/+1063
| | | | | Change-Id: I641ada39f7c84cd221ec1e235cdb0c86270d49fc Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* QtPrintSupport - Modify Platform Plugin QPrinterInfo apiJohn Layt2012-05-241-0/+19
| | | | | | | | | | | | | | Change the way the printsupport plugin creates QPrinterInfo objects, provide platform api to return a named printer, and expose this as static public api in QPrinterInfo. Only the Mac plugin used the old api, the other plugins will have direct support added in separate commits, but will use the default implementation for now. Change-Id: I7d6b6556eb39919cfb15bc0e814afbaf13c5712c Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>