summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Add a unit test to QSharedPointer being deleted by a C++11 lambdaThiago Macieira2012-06-121-0/+32
| | | | | | | | | This already worked, but let's have a test so we can be sure it doesn't regress. Change-Id: I358b436d216e3ec4310f05ccf4f70f9e7aad3281 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make qmetaobject autotest independent of QtWidgetsDebao Zhang2012-06-112-9/+9
| | | | | Change-Id: I4340036a4e6024d9b8d0c7832ad7bfb28ec4bc99 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Line Breaking Algorithm: handle the Object Replacement CharacterKonstantin Ritt2012-06-102-3/+1
| | | | | | | | See http://www.unicode.org/reports/tr14/#CB and http://www.unicode.org/reports/tr14/#LB20 for details Change-Id: Ice0aa2b2ce81f6e39839a353240420436eddd754 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Line Breaking Algorithm: don't break inside numeric expressionsKonstantin Ritt2012-06-101-25/+0
| | | | | Change-Id: I8362663454e4c6604ecb6289ae8009d47c78aeb1 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update the Unicode Text Breaking Algorithm implementation testsKonstantin Ritt2012-06-105-669/+7659
| | | | | | | | | | | * The Line Breaking Algorithm implementation conformance tests has been added; * The Grapheme, Word, and Sentence Breaking Algorithm implementation conformance tests has been updated. Change-Id: Ia1a6eef6272d580964cb23788ddf30dfd5f4a5a3 Note: the Line Break test data contains some extended cases we don't currently support; just skip them for now. Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update the Unicode Text Breaking Algorithm implementationKonstantin Ritt2012-06-101-3/+1
| | | | | | | | | | | | | | | | | | to make it conformant to the Unicode 6.1 specifications #14 and #29. The most important changes are: * The implementation has been reworked from scratch to fix all known bugs; * Separate-out the grapheme and the line breaking implementation to eliminate an overhead due to calculating unnecessary breaks; * Stop using deprecated SG class in favor of resolving pairs of surrogates; * A proper support for SMP code points; * Support for extended grapheme clusters (a drop-in replacement for the legacy grapheme clusters as of Unicode 5.1); * The hardcoded tailoring of UBA has been eliminated which breaks the 7 years-old lineBreaking test. Some later, we'll investigate if such a tailoring is still needed. Change-Id: I9f5867b3cec753b4fc120bc5a7e20f9a73d89370 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update the Unicode related autotestsKonstantin Ritt2012-06-103-76/+922
| | | | | | | | | | | Update NormalizationTest.txt data file with one from UCD 6.1; Add few more QChar::unicodeVersion() testcases; Add some line break class mapping testcases; Add some exceptional case mapping testcases; Add script class mapping test; Change-Id: I164394984abb2b893c8db62fb77e7bd87aa0850b Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make qpointer autotest build without widgetsKent Hansen2012-06-102-1/+12
| | | | | | | Change-Id: Ibd05a49174e7055faa89c48659130a11418b9616 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Debao Zhang <dbzhang800@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use UTF-8 in the QtTest data and benchmark tagsThiago Macieira2012-06-0932-32/+32
| | | | | | | | | | | Future-proofing. Since Qt source code is now mandated to be in UTF-8, it is entirely possible that someone will use non-ASCII in data tags. Though it would be interesting to see how to access them from the Windows command-line. Change-Id: I880fc312432b62143888ff1e1d9abbd54f704601 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QZip: improve reading of zip files, fix some edge cases in writingKonstantin Ritt2012-06-081-1/+1
| | | | | | | | | | This supercede https://codereview.qt-project.org/#change,25111 and fixes some more cases; The autotest crash is fixed as well (but the test itself omitted due to .pro file misconfiguration) Change-Id: I4a3adde18b4f9a8ac9822f700eee71d2a12b9c2c Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
* Fix crash in QTreeWidgetItem::sortChildren when adding new item.Markku Heikkila2012-06-081-0/+33
| | | | | | | | | | | | | | | | | | | This is a cherry-pick of 4f388c383e39b598d997e21bd9a4f16d89bd0625 from February Recursive call is caused if user code calls QtreeWidgetItem()::sortChildren and sorting is enbled in QTreeWidget. First call is from user code and second is caused by timer. When timer expires second call is made. This recursion is prevented with QTreeModel::SkipSorting skipSorting() in QTreeWidgetItem::sortChildren(); Task-number: QTBUG-20345 Change-Id: Ibf73e69274423f31397a9e391bfba7d5c4103a3c Reviewed-by: Markku Tapio Heikkilä <markku.heikkila@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Make qfont autotest build without widgetsKent Hansen2012-06-082-4/+11
| | | | | Change-Id: I2ab344d44cb2aa8c59c1c28f7368784849d4b74d Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make qicon autotest build without widgetsKent Hansen2012-06-082-1/+6
| | | | | Change-Id: Ic6176404076bac956d00d57c99e0bbf0ac78beca Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add Qt::WindowTransparentForInput to Window flags manual test.Friedemann Kleint2012-06-082-0/+7
| | | | | | Change-Id: If27567a93d5a2e910289c680643503d02831d742 Reviewed-by: jian liang <jianliang79@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Allow ISODate string without seconds in QTime::fromString().Mitch Curtis2012-06-081-0/+28
| | | | | | | | | According to ISO 8601 (section 4.2.2.3), seconds can be omitted from a string representing time. Task-number: QTBUG-2813 Change-Id: I2578f290845e46a8f49be489f1d7427984ae7f08 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Shift positions for lineBreakTypeKonstantin Ritt2012-06-071-4/+4
| | | | | | | | | | | | | | | | | | | to keep them consistent with positions for all other flags. This changes the internal behavior so that attributes[0].lineBreakType now means "break opportunity at start of the text (before the first character in the string)" and is always assigned with HB_NoBreak to conform rule LB2 (see http://www.unicode.org/reports/tr14/#LB2). The current implementation is based on the sample implementation from tr14 that aimed to be as simple as possible rather than to be optimal. From now, we can use pieces of the attributes array "as is" without having to adjust some positions. Or we can analize some long text by chunks (e.g. paragraph by paragraph) and consume less memory. This introduces a minor overhead that will be eliminated shortly. Change-Id: Ic873a05a9d5203b1c3d5aff2e4445a3f034c4bd2 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QTextBoundaryFinder: Consider soft hyphen as line breaking opportunityKonstantin Ritt2012-06-071-1/+31
| | | | | | | SoftHyphen enum value was added to specify such a boundary reason Change-Id: I4248909eed6ab8cbca419de4dcf9fe917620a158 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make qtexttable autotest build without widgetsKent Hansen2012-06-072-1/+8
| | | | | Change-Id: Id5f93dee0c4b5978c473838559f586ced35a2981 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make sql autotests build without widgetsKent Hansen2012-06-071-0/+2
| | | | | Change-Id: Icd4d2ef39961e2e0ec5c9e910c74b3e8a35503bf Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make "other" autotests build without widgetsKent Hansen2012-06-071-0/+14
| | | | | Change-Id: I49e73c31b98e43259771c0e265cf13fc167c45f2 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Don't build printsupport autotests when widgets aren't availableKent Hansen2012-06-071-1/+1
| | | | | Change-Id: Ida376a75f376fc0d3696d715648c7229aec301e2 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make animation autotests build without widgetsKent Hansen2012-06-071-0/+3
| | | | | Change-Id: Icb0560a26973921611f697240fbce121fff518e9 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove widgets dependency from qdatastream autotestKent Hansen2012-06-072-1/+2
| | | | | | Change-Id: I30ce3ce2d5a0badc7a846256825b4deea8c0856a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make qprocess autotest build without widgetsKent Hansen2012-06-072-0/+5
| | | | | Change-Id: I0a428852222accbea8446ba1c284f1c44b9d4bf3 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove widgets dependency from qstringlistmodel autotestKent Hansen2012-06-072-3/+2
| | | | | Change-Id: I9678f9ee3fd8b01648cf2524452145568cf6fb4f Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make itemmodels autotest build without widgetsKent Hansen2012-06-071-1/+3
| | | | | Change-Id: I7ff1a575c111452397c3461842c15bb01105cf95 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make qstatemachine autotest build without widgetsKent Hansen2012-06-072-3/+16
| | | | | Change-Id: I3a58cb1cbe0c86aca6e533187e85c166bf0f8957 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make qpixmap autotest build without widgetsKent Hansen2012-06-072-2/+11
| | | | | Change-Id: Iabf1e6815a2af79d9da84c0e2bb9c2de52cb698f Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make qpicture autotest build without widgetsKent Hansen2012-06-072-1/+8
| | | | | Change-Id: Id2047dace7b3087f1c7b83545f5e122ab936d33c Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make qmovie autotest build without widgetsKent Hansen2012-06-072-1/+10
| | | | | Change-Id: Ie53b183e99de08c3cc35f4932b7aabf4bf5b0940 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make gui tests build when widgets aren't availableKent Hansen2012-06-071-0/+4
| | | | | Change-Id: I5b75116d148f84ae2f96dd6b573d14952c4b601c Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Make qpainter autotest build without widgetsKent Hansen2012-06-072-2/+31
| | | | | Change-Id: I4e05871e44f7a69aaa9cd5d876c249c7dd9d86e8 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Make qtextdocumentlayout autotest build without widgetsKent Hansen2012-06-072-1/+8
| | | | | Change-Id: Ib767f9cac5fc3274ed16e87f0c4da68102147645 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make qtextobject autotest build without widgetsKent Hansen2012-06-072-1/+8
| | | | | Change-Id: I9ea79b62d22faeccc07d8c21a0d8f032b40abef0 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Check LANGUAGE as well in QSystemLocale::fallbackLocaleMike FABIAN2012-06-061-1/+1
| | | | | | | | | | | | Because QSystemLocale::fallbackLocale() is about UI languages, it makes sense to check LANGUAGE as well if appropriate. Adapt tst_qlocale.cpp accordingly. Suggested by Oswald Buddenhagen. Change-Id: Ib2c9674081809e3251be4e34456b05210eebc010 Reviewed-by: Oswald Buddenhagen Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* statemachine: Make delayed event posting work from secondary threadKent Hansen2012-06-061-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | postDelayedEvent() and cancelDelayedEvent() are marked as thread-safe in the documentation. Unfortunately, they didn't actually work when called from another thread; they just produced some warnings: QObject::startTimer: timers cannot be started from another thread QObject::killTimer: timers cannot be stopped from another thread As the warnings indicate, the issue was that postDelayedEvent() (cancelDelayedEvent()) unconditionally called QObject::startTimer() (stopTimer()), i.e. without considering which thread the function was called from. If the function is called from a different thread, the actual starting/stopping of the associated timer is now done from the correct thread, by asynchronously calling a private slot on the state machine. This also means that the raw timer id can no longer be used as the id of the delayed event, since a valid event id must be returned before the timer has started. The state machine now manages those ids itself (using a QFreeList, just like startTimer() and killTimer() do), and also keeps a mapping from timer id to event id once the timer has been started. This is inherently more complex than before, but at least the API should work as advertised/intended now. Task-number: QTBUG-17975 Change-Id: I3a866d01dca23174c8841112af50b87141df0943 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Remove insignificant_test for tst_qwindow on Mac OS XBradley T. Hughes2012-06-062-6/+6
| | | | | | | | | | | | | | tst_QWindow::positioning() still fails on Mac OS X, and it does so in several places. Skip this test for now as it causes isActive() to fail as well. With positioning() QSKIP()ed, all the other test functions pass: Totals: 19 passed, 0 failed, 1 skipped ********* Finished testing of tst_QWindow ********* Task-number: QTBUG-23059 Change-Id: I58d036120c0121f515813cd20955ab3b82f81fe1 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Cocoa: do not send multiple window activation eventsBradley T. Hughes2012-06-061-3/+0
| | | | | | | | | | | | | | When switching the active window within the same application, Cocoa sends us an NSWindowDidResignKeyNotification for the old activated window, then an NSWindowDidBecomeKeyNotificationfor the newly activated window. Our handling of this would first set Qt's active window to zero, then immediately reset it afterwards. Avoid this by checking the key window when handling the deactivation event, and don't set the active window to zero if a new window has become active. Task-number: QTBUG-24322 Change-Id: I8719fc501049eeaaebb75e9ea03261b2209458b6 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Added QScreen::setOrientationUpdateMask().Samuel Rødal2012-06-061-0/+13
| | | | | | | | | | | | It might be too expensive to always have an accelerometer sensor running, so introduce API so that the application has to explictly ask to get the orientation updates it's interested in. Change-Id: Ib7dc5ad8807718409f744ebef53f4476aa05175d Reviewed-by: Ian Monroe <ian.monroe@nokia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com> Reviewed-by: Kevin Ottens <kevin.ottens.qnx@kdab.com>
* Fixed QJsonObject::find()Denis Dzyubenko2012-06-061-0/+10
| | | | | | | | | | The function returns mutable iterator on the object that can later be passed to e.g. erase(), hence it should detach() to be consistent with QJsonObject::begin() which also detaches. Change-Id: Id79e8e012fd5469e06b68fbc9eecb7c6848ce9c1 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* 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>