summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* fix error handling bug in QWindowsPipeReaderJoerg Bornemann2012-11-021-1/+0
| | | | | | | | | | | | If ReadFile returns with an error then we must set our internal state accordingly. QWindowsPipeReader::readSequenceStarted must be set to false. If ReadFile fails, we're not within a read sequence. Also, we must handle the ERROR_BROKEN_PIPE error. Task-number: QTBUG-25342 Change-Id: Ic9247f170fa9cc47fa7e45d0f47ccfedac06a593 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* fix tst_QProcess::batFiles for shadow buildsJoerg Bornemann2012-11-021-2/+2
| | | | | Change-Id: If7a9c9aa6ba16b7744d8ef8a66b43e40f375b5e7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Fix the gregorian date <-> julian day calculations in QDateJon Severinsson2012-11-021-11/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code is just plain wrong for negative julian days. Replaced with plain math from The Calendar FAQ [1], which is correct for all julian days, provided you use mathematical integer division (round to negative infinity) rather than c++11 integer division (round to zero). [1] http://www.tondering.dk/claus/cal/julperiod.php While the conversion code works for up to around JD +/- (2^63/4), we only use an int for the year in the API, so this patch limits minJd() and maxJd() to 1 Jan (2^31) BC and 31 Dec (2^31-1) AD, respectively. Note that while the new conversion code looks like it would be more expensive than the old, gcc will in fact be able to optimize it to be slightly faster (probably because x86 hardware implements round to negative infinity, and so GCC manages to optimize floordiv to a single instruction, compared to the three instuctions needed for operator/). In the following test application, run with a release mode Qt and redirecting stderr to /dev/null, I measured an improvement from 6.81s +/- 0.08s to 6.26s +/- 0.16s user time over five runs on an otherwise idle x86_64 system. int main(int, char *[]) { int year, month, day; qint64 jd; for (qint64 i = Q_INT64_C(-1048576) ; i < Q_INT64_C(1048576); ++i) { QDate::fromJulianDay(i).getDate(&year, &month, &day); jd = QDate(year, month, day).toJulianDay(); qDebug() << jd << year << month << day; } } Change-Id: Ifd0dd01f0027f260401f7f9b4f1201d2b7a3b087 Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Introduced QWindow properties {min/max}imum{Width/Height}Samuel Rødal2012-11-021-0/+53
| | | | | | | These are useful when QWindow is exposed to QML. Change-Id: I7ec49ef365183e2c784605889e8ea22c2ef34781 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Improve QDateTime test coverage.Mitch Curtis2012-11-021-129/+262
| | | | | Change-Id: Ic521d9d2ffb1b8e3b14d9cebdeb3dc7a5e08580e Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Expose IAccessibleTable2 to non-conformant screen readersJan Arve Saether2012-11-021-1/+81
| | | | | | | This seems to be the established practice. Change-Id: I75a65d722a026ab0eb1805688743f46aba406e6c Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* SSL certificate printing: Fix auto test for OpenSSL 1.0.1 version.Janne Anttila2012-11-022-8/+59
| | | | | | | | Different OpenSSL versions produce slightly different output when dumping a certificate. Change-Id: Ida98b24422302e287641be074d6740ca292cf203 Reviewed-by: Richard J. Moore <rich@kde.org>
* Compile fix for tst_qstylesheetstyle.cpphjk2012-11-011-1/+1
| | | | | | | There was a semicolon missing. Change-Id: Id2eb843604907acf952d7d238f80ba8a7010ccd1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Strip trailing whitespace in itemviews.Stephen Kelly2012-11-014-33/+33
| | | | | | | | | | | Using git ls-files -z | xargs -0 sed -i 's/ \+$//' in the relevant directories. Change-Id: I861ef9952fb32ed2db9ec8b67864ec7d0d61f0f2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix for leak in QFutureChristian Strømme2012-11-012-8/+65
| | | | | | | | | | | To avoid leaking when converting a QFuture<T> to a QFuture<void> we need to have a separate ref. counter for QFuture<T>. When the last QFuture<T> goes out of scope, we need to clean out the result data. Task-number: QTBUG-27224 Change-Id: I965a64a11fffbb191ab979cdd030a9aafd4436c2 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* move QSystemSemaphore autotest from qtscript to qtbaseOliver Wolff2012-11-015-0/+411
| | | | | | | | | | As the script dependency for that autotest is not really needed it should be moved to qtbase. Task-number: QTBUG-27705 Change-Id: I4ce0d34aca97cadd79b157b0f7c90c406bed4295 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Add manual test for dialogs.Friedemann Kleint2012-10-315-1/+559
| | | | | | | | | Implemented for QFileDialog, currently. Task-number: QTBUG-27621 Change-Id: I0c9b7628aa92e3fbca6f737448a7c469893764f1 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* test: Remove QSKIP from tst_QSettings::dontReorderIniKeysNeedlessly()Sergio Ahumada2012-10-311-5/+3
| | | | | Change-Id: I7b804592398869278e9a0fec982c235c41f2c3d7 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* test: Moving tst_QMimeDatabase::inheritsPerformance() testSergio Ahumada2012-10-316-33/+97
| | | | | | | | | | tst_QMimeDatabase::inheritsPerformance() is not an unit test but a performance test, so moving it from 'tests/auto/corelib/mimetypes/qmimedatabase' to 'tests/benchmarks/corelib/mimetypes/qmimedatabase' Change-Id: I59e84f61559023659f101666683870f2ca1d2034 Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Use qt-project.org in tst_hostinfo - qt.nokia.com changed IP address.Janne Anttila2012-10-311-7/+7
| | | | | | | | | qt.nokia.com is also going to disapper in future, so I think it is better to use qt-project.org. Change-Id: Ice550fe657a33609472b8e4b8630d7649f9c9fb5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Generate instances of types in the CMake tests.Stephen Kelly2012-10-314-84/+32
| | | | | | | | | | | | | | | | All modules currently have a test_modules CMake test. The new module_includes test has very similar requirements, and can obsolete the hand-maintained test_modules tests in all modules. After all test_modules have been removed in other repos, the module_includes test can be renamed to that name. The types chosen need to have a constructor which can be invoked with no arguments. QtConcurrent has no public classes which fit that description so it is still tested separately Change-Id: Id7929cd32b3112c293cbf5e6964cc894a697f9b1 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QNX: Use inotify on QNX systems that support itThomas McGuire2012-10-301-0/+5
| | | | | | | Change-Id: Ia9bf8d3c202b17746036e203268ef6229aaa900d Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Send leave to most recently entered window when modal dialog is shown.Miikka Heikkinen2012-10-301-4/+65
| | | | | | | | | | | | | | | If a modal dialog was shown as a response to button click, the button retained its hover highlight, because it didn't get leave event. Fixed by tracking the most recently entered window and sending a leave to it when modal dialog is shown that blocks it. Also modified tst_QGuiApplication::modalWindow() autotest to check for enters and leaves. Task-number: QTBUG-27644 Change-Id: I387647e18a762a39d523e3df31221b9583a39f9d Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Only use the user set page margins for custom paperAndy Shaw2012-10-301-0/+59
| | | | | | | | | | | | | | When the QPrinter is initalized then it will set up page margins based on the default paper size. If the paper size is changed to be a custom one then it should disregard the margins for the default paper size. If the page margins are set explicitly beforehand then it will use these page margins. Change-Id: Ic535c3a80b8b217dbd5eb5f4fb2cbc0ab1354563 Reviewed-by: Titta Heikkala <titta.heikkala@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* test: Remove QSKIP from tst_QByteArray::literals()Sergio Ahumada2012-10-301-4/+5
| | | | | Change-Id: I07b53cd12790d2161964dd09c5a69fe8aff7c90d Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* test: Remove QSKIP from ↵Sergio Ahumada2012-10-301-3/+5
| | | | | | | tst_QPainter::drawText_subPixelPositionsInRaster_qtbug5053() Change-Id: I1aa329323767a3e849beca8fe41e39dbe98de4ee Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* test: Remove QSKIP from tst_QListView::setCurrentIndexAfterAppendRowCrashSergio Ahumada2012-10-301-4/+5
| | | | | Change-Id: I8d48722b412895e43aa8a522354c5d67d83c19dd Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Check for both A and P when converting QDateTime to string.Mitch Curtis2012-10-301-2/+4
| | | | | | | | | | hasUnquotedAP currently only checks for an a or A, which is wrong according to both the toString documentation and the comments for hasUnquotedAP. Change-Id: I03015734b846fe761085cf8f8fca2b29210cff97 Reviewed-by: Jon Severinsson <jon@severinsson.net> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* QMap - improve QMap stl-map ctorThorbjørn Lund Martsum2012-10-292-0/+40
| | | | | | | | | | We can insert directly on the most left-most Node. We always enforce an insert here (unlike the insert call), but that is not a problem since the keys in a std::map are unique. Change-Id: Ib409b90ffc57a5a43dab4a4b08d34f6fdabd057f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QFontEngineMulti: Fix possible crash in stringToCMap()Konstantin Ritt2012-10-292-1/+35
| | | | | | | | | in case when the layout is partially initialized. We shouldn't access any data except of indices if GlyphIndicesOnly flag has been passed in. Change-Id: I264689b498e0f9de8b5c040d47dbae4f6ef391c4 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Do the actual removal of the Soft Keys API and related codeJan Arve Saether2012-10-294-95/+18
| | | | | | | | | | | | | | | | | | | In addition to the actual removal of the softkeys API in QAction, this commit removes some enums related to the softkeys feature: Qt::WA_MergeSoftkeys Qt::WA_MergeSoftkeysRecursively It also removes some "zombie" enums: Qt::WindowSoftkeysVisibleHint = 0x40000000, Qt::WindowSoftkeysRespondHint = 0x80000000, (The only implementation that used these were removed when qapplication_s60.cpp and qwidget_s60.cpp were removed.) Change-Id: Ib6fc6d543def4757383d5f19256199d9d190c614 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Janne Anttila <janne.anttila@digia.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Test: refactor tst_QProcessCaroline Chao2012-10-292-164/+142
| | | | | | | | | | | | Remove QSKIP and instead omit the whole tests when appropriate. Remove QSKIP from crashTest, crashTest2 and exitStatus on Windows, the tests are now passing. Add a guard in testForwarding to check if QT_NO_PROCESS is defined. Change-Id: Icba4d773315e3bf87764a381742168b51cf169c0 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Test: remove QSKIP in tst_QEventLoop::throwInExec()Caroline Chao2012-10-291-10/+10
| | | | | | | | | Instead omit the whole test when appropriate. Change-Id: I60c34b020f6e25e865bbe0182395d4fc6419f65e Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* test: Update task number for QAccesibilityLinux autotest.Sergio Ahumada2012-10-291-1/+1
| | | | | | | | | | Reference tasks with detailed information of failures rather than generic task for blacklisted tests. Task-number: QTBUG-27732 Change-Id: I0f0f500d255ea8748dd98d066deeaf1dfcdb7ec8 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Fix qfile:invalidFile() test.Friedemann Kleint2012-10-291-4/+33
| | | | | | | | | | The test expects 'fail:invalid' to be an invalid file, which it no longer is on Windows 7. It also assumes that f: is an invalid drive. Fix by picking a drive that does not exist. Task-number: QTBUG-27306 Change-Id: I9d9b36c50fc31d2561d3c4eec66f65d96084f0d7 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Implement QAccessibleLineEdit::characterRect()Jan-Arve Saether2012-10-281-0/+16
| | | | | | | | | | | | It was probably not implemented because it needed to access private APIs. However, accessing those from this a11y plugin is unproblematic. Forward-ported from Qt 4.8 with change d2fb64d52fc6ec229d775f829a9a0cb3d251aad3 (and then slightly improved) Change-Id: Ifa2d48c152fd75fc1fff49a05369787a7db3b902 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Clean up index handling in itemviews accessibility.Frederik Gladhorn2012-10-271-17/+45
| | | | | Change-Id: Icc017c7df9cb0dc4bf17e5168c1e3acda6af7523 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Make table test use smart pointers for interfaces.Frederik Gladhorn2012-10-271-28/+18
| | | | | Change-Id: I9669da2ef398f12c4d6d584e7032dea13b148a81 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* QMap 5.0 - keep track of leftmost node (BIC)Thorbjørn Lund Martsum2012-10-272-1/+110
| | | | | | | | | | | | | | | | | | | | | This suggestion keeps track of the most left node. The point is that constBegin() becomes a lot faster. That speeds up iteration a bit, and makes it O(1) to get the first element. The penalty in insert and remove is very small. On large trees it seems to be less than 1%. It should be noticed that constBegin() is a very common hint on my planned change to 5.1, and this opperation will without this patch cost 2 x log N. One when the user calls the hint with begin - and one where it is compared with begin. Other std::maps has a very fast begin(). E.g http://www.cplusplus.com/reference/stl/map/begin/ (begin with constant time) Change-Id: I221f6755aa8bd16a5189771c5bc8ae56c8ee0fb4 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QMap - use hint on insert in QMap::toStdMapThorbjørn Lund Martsum2012-10-271-0/+12
| | | | | | | | | Giving the std-map a hint (normally) improves insert performance. There seems to be no reason not to provide this hint. Change-Id: I4344607ebf54574a3ae9666d87a41a3c14762361 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* test: Remove dead code from tst_QPixmapSergio Ahumada2012-10-271-6/+1
| | | | | | Change-Id: I1945a0f431364f47a43cf7f600ad38fdba5f4a08 Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* test: Don't fail if the network test server is not set upSergio Ahumada2012-10-261-1/+2
| | | | | | | Leftover from 704a4e4747b2c42e262d9b4bd440ff365ab92a35 Change-Id: I437da91be31259a748303bd7cf20ff0c8bcf53b4 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* QComboBox: new signal currentTextChangedMark Brand2012-10-261-0/+55
| | | | | | | | | | | Adds NOTIFY to currentText property. Test included. Change-Id: I3e92b585ad6697891d61537c82f6ab9e8beb1a00 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QComboBox: fix use in QDataWidgetMapper/QItemDelegateMark Brand2012-10-262-2/+56
| | | | | | | | | | | | | | | | | | | | | | | QItemDelegate and QDataWidgetMapper use the WRITE method on the USER property to set a value in a widget. This did not work for QComboBox whose USER property currentText lacked a WRITE method. This change adds the missing setter and flags it as the WRITE method. The setter setCurrentText() simply calls setEditText() if the combo box is editable. Otherwise, if there is a matching text in the list, currentIndex is set to the corresponding index. Test included. Follow-up to 816c5540179362500dfc175b77f05abf3ef25233 which restored currentText as the USER property. Task-number: QTBUG-26501 Change-Id: I5f2f999e60b09728ca03ead4e28fe36d1f3ee189 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add a CMake macro to test module includesStephen Kelly2012-10-261-0/+23
| | | | | | | | | | | | | | | | | The variations of includes which should work are tested. For example, in the case of testing the QtCore module and QObject include, the following includes are generated and compiled: #include <QObject> #include <QtCore/QObject> #include <QtCore> #include <QtCore/QtCore> As the private include directories are not available to the compiler, this also tests that private headers are not included from public ones. Change-Id: Id03d0fe290c9691e0f7515015892991d1701ab72 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix syncing of visibility and enabled for menus on CocoaAndy Shaw2012-10-261-7/+67
| | | | | | | | | | | Fixed menu handling on Cocoa so if a menu is enabled/disabled or made visible or not then it will keep this in sync with the appropriate native menu entry. Change-Id: If269185fcf065fb1b2f60d6ef8c27c107eb4509f Reviewed-by: Pasi Matilainen <pasi.matilainen@digia.com> Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* Adjust autotest files for raster engine to new default penaavit2012-10-267-141/+209
| | | | | | | | | Fix those test scripts that assumed cosmetic default pen, and improve testing coverage of cosmetic vs non-cosmetic pens in general. Ref. I04d910e9700baf7f13a8aac07a3633014bb9283e Change-Id: I2bb3525c21a8e9c8dd1f16e7dcd225195df43c1b Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fix a crash in QFileDialog when selecting an invalid name filter.Friedemann Kleint2012-10-261-1/+46
| | | | | | | | | | | When nameDetailsVisible is set to false and an invalid/empty string is passed to selectNameFilter(), the regexp used to strip the filter off the suffixes returns empty and a crash occurs. Change-Id: I926ea49514ff25a103977d8121fca1cf83d647f5 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Properly check for widget's visibility in doublespinbox autotestOliver Wolff2012-10-261-2/+2
| | | | | Change-Id: If9e08ab5c84090729537e2a060257564c62fda9a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* correct spelling in commentMark Brand2012-10-251-1/+1
| | | | | Change-Id: I6ffa96ac9cda0701c99f839804f400a167fcf9a7 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* test: Remove QSKIP from tst_QFileDialog2Sergio Ahumada2012-10-251-3/+7
| | | | | | | | In task227930_correctNavigationKeyboardBehavior() Task-number: QTBUG-23602 Change-Id: I07f40dbc3840c232e09ff1327f00e3fd9c16c22f Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* test: Remove tst_QPixmap::grabWindow() functionSergio Ahumada2012-10-251-31/+0
| | | | | | | | | QPixmap::grabWindow() was deprecated by 41914453d38d01b9b69e16ccee69444d1a304bf7 Task-number: QTBUG-20863 Change-Id: I7e675c124cd96cf1815b65e57f3fba19e5065066 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Test: remove QSKIP from tst_qstringCaroline Chao2012-10-251-40/+36
| | | | | | | | | | | | | | | | | Instead omit the whole tests when appropriate. In particular: - When Q_CC_HPACC is defined the tests fromStdString and toStdString are crashing. Omit the tests in this configuration since the compiler is not supported. - Clean the localeAwareCompare() by removing the code where Q_OS_WIN is defined but not Q_OS_WINCE. System and user locale cannot be set on Q_OS_WIN other than Win CE and some code could never be reached. Change-Id: I72ae3246bf8c2a73d14cce45dde14bcb8001d8b3 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Fix qmake's pro file cache to interact correctly with write_fileSimon Hausmann2012-10-252-0/+26
| | | | | | | | | When writing a file with write_file() we have to inform the pro file parser cache to discard the file if it's existant in the cache, to ensure that calling include() after write_file() always works. Change-Id: I7d09269a57de55ca30b0e11dd40770de9f919f64 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Core/kernel: Make some signals private.Stephen Kelly2012-10-252-5/+6
| | | | | | | | | | | | | | | | | | | | | | There are more opportunities in QtCore and the rest of Qt to make signals private instead of public. This is a test-dart to see if there is any reason not to do this. It would be nice to make QObject::destroyed private, but as it has a default argument it would be source incompatible to anyone connecting to the SIGNAL(destroyed()) instead of SIGNAL(destroyed(QObject*)). Currently the function-pointer-based connect syntax does not accept a functor (or lambda) with a different number of arguments than the signal. Olivier says a fix for that might come in 5.1, but for now the qfiledialog2 test is changed to not use that anymore. Also, the function pointer for a private signal can not be assigned to a local variable, so the qmetamethod test is changed to not do so anymore. Change-Id: Iaf776b822f9ba364f2c184df0c6b23811da56e44 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>