summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup corelib autotestsJason McDonald2011-11-1030-3815/+3790
| | | | | | | Remove literal tabs. Change-Id: I210a0259773cceb20d35ebc80b889e3ebb88b540 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove redundant #defineJason McDonald2011-11-101-7/+4
| | | | | Change-Id: I27a47653d2c41741f39ee1fea6a1fed063279994 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Deleted qtipc autotest from qtbaseJo Asplin2011-11-0928-2886/+0
| | | | | | | | | | The qtipc autotest needs to live in qtscript due to dependencies to that module. This commit is the first of two steps to move qtipc. The second step is a commit in qtscript that adds qtipc there (with a proper reference to the first commit, i.e. this one). Change-Id: I233ee459be76fd1938868c05232ce732cfc913a8 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Add QPolygonF to metatype system.Jędrzej Nowacki2011-11-091-1/+1
| | | | | | | | That was strange that QPolygon was know to QMetaType class but QPolygonF not. Change-Id: I67bb99644b8b1d0fe1aec730619d8048cb78219b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make usage of internal QVariant space.Jędrzej Nowacki2011-11-091-6/+22
| | | | | | | | | | | | | | | | | | | | | | Each QVariant instance has internal storage which may be used for well-know basic types. This patch changes the behavior by delegating type dependent operation to QMetaType class which knows more types than QVariant itself. The patch significantly reduce amount of code in QVariant implementation. There are few side effects of this patch: - better performance: * for Core types when using Gui (QGuiVariant is able to construct Core types) * for small custom types (QVariant::Private::Data is used for all types that has size small enough) - comparing two QVariants can give different result for small custom types (binary comparison instead of pointer comparison) Change-Id: Ic17fa500d6a882110bfba896fd456c8e6c7a63a9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Refactor QMetaType types.Jędrzej Nowacki2011-11-091-75/+112
| | | | | | | | | | | | | | | | QMetaType::Type enum is the main source of type ids. Currently there are many tasks that can be replaced by a smart macro that can iterate over all types. The patch introduces series of FOR_EACH_ macros that may be used for code generation. As the first step the macro was used for Q_DECLARE_BUILTIN_METATYPE to make sure that no type was forgotten. Second step was to use created macros in autotest to improve tests coverage. Change-Id: I34e9ad7bacf02b44b028bc1aad20b1241aacebd3 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove redundant copies of QTRY_COMPARE.Jason McDonald2011-11-092-28/+0
| | | | | | | | QTRY_COMPARE is now part of qtestlib, so there's no need for copies of it. Change-Id: Ied4e7d3b30c1cf16ddcbf8655e4d976e74c2bd8a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QGlobal: Define a default message handlerAurindam Jana2011-11-081-0/+12
| | | | | | | | | | | | | Currently, qInstallMsgHandler() does not return the handle to the default message handler. This patch defines a default message handler. This is returned by qInstallMsgHandler() when called for the first time. A call to qInstallMsgHandler(0) will restore the default message handler as was the case previously. Change-Id: I42f06654d45fb0e633f3c6d912fc8f05c23249aa Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add Q_DECLARE_PRIVATE equivalent for QDir, to be able to subclass itDavid Faure2011-11-081-3/+0
| | | | | | | | Apply the same solution to QFileInfo (no public detach(), but a non-inline d_func instead). Change-Id: I31c4c759f44a0649b97f7884b078b174c9c00f22 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Moved utf8/ and deleted corelib.proJo Asplin2011-11-083-1/+386
| | | | | | | | This change moves utf8/ into corelib, thus allowing corelib.pro to be deleted. Change-Id: Ib1b4e0930ac0e116d9bbc242a6dfb63ae5785d19 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Cleanup corelib autotestsJason McDonald2011-11-0774-1398/+62
| | | | | | | Remove redundant empty constructors, destructors and test functions. Change-Id: Idb51368895e67ec3fc0345a9a5d33d77730c051b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Moved qmetaobjectbuilder test into corelib/kernel/Jo Asplin2011-11-053-0/+1278
| | | | | | | | This commit moves the qmetaobjectbuilder test from test/auto/ into corelib/kernel/ since that matches the location in the Qt source. Change-Id: I0342e8185ce775b0ef71849f365bf54c8fb56da4 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Re-enabled passing tests in tst_qvariantJo Asplin2011-11-042-2/+3
| | | | | | | | | | | To increase the effective test coverage, this patch re-enables the tst_qvariant test case as such, and instead disables only the test functions that are currently failing in CI. Task-number: QTBUG-22453 Change-Id: Ibf0dc3caf50d34084fa50cf76d199e77a42f6e16 Reviewed-by: Olivier Goffart <ogoffart@kde.org>
* QStandardPaths: add DownloadLocation.David Faure2011-11-041-0/+1
| | | | | | | | | Only properly implemented on unix (XDG), falls back to Document location on Mac and Windows, because not easily available with the current API being used by either one. Change-Id: Id269f0e3c4e3a68e19205de96c0b39980fde80ff Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix tst_qstandardpaths: Mac OSX is a unix, but doesn't use XDG.David Faure2011-11-041-5/+9
| | | | | Change-Id: I2b4552a162dc9f993e0587ace6e7e3fb4f96571e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QThread::isFinished should return true from finished()Olivier Goffart2011-11-031-0/+34
| | | | | | | | | | | | | | | | | | | and isRunning() should return false. This restore the Qt 4.7 behaviour In Qt 4.7, the finished() was called with the thread's intenal mutex locked. Which mean that: - Call to isRunning or isFinished called from a slot connected to finish within the thread would deadlock. (Hence no compatibility to keep here) - Call to isRunning or isFinished from a slot connected with QueuedConnection in another thread would lock the mutex until the destructors are finished. and then return as if the thread have finished. Change-Id: I963eccae8f7634aff90cc4bbab6ca886a78e35eb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use C++11 static_assertOlivier Goffart2011-11-021-0/+17
| | | | | | | Change-Id: I75aa2bc209cdc8869e7daa9fd0dd865ccf65a68e Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@kde.org>
* Remove disabled test data from QUrl autotestJason McDonald2011-11-021-6/+0
| | | | | | | | The removed test data was for obex URLs, which are not supported by QUrl. Change-Id: I166130ae936342d415165e46b7943d198de8986b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove test that hasn't been enabled since 2007.Casper van Donderen2011-11-011-69/+0
| | | | | | | Task-number: QTBUG-22444 Change-Id: Id7569cf60cb314511a7d4f38833913c442f3fbba Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Fix broken build.Jędrzej Nowacki2011-11-011-2/+3
| | | | | | | Variadic macros are not supported by C++98 standard. Change-Id: Ib520297e43b654b46925f3ee2735a975ebbe8e35 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_qvariant: add a test QVariant works with not movable typesOlivier Goffart2011-11-011-0/+51
| | | | | | | | | | | Soon, QVariant will use more internal storage. It is important that it still work with not movable types Also, check with type that are movable but cannot be copyed without their copy constructor to be called such as QSharedDataPointer Change-Id: I6d67755476e4822468599bebfa8774ad96a15306 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Remove disabled code from QString autotest.Jason McDonald2011-10-311-49/+0
| | | | | | | | | The removed code was disabled before the tests were imported into the Qt repository in 2006, so its meaning or usefulness is lost in the mists of time. Change-Id: I3108a1a1d86cd135886608f47dcd88bf49f2d3fd Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove disabled code from QRegExp testJason McDonald2011-10-311-6/+0
| | | | | | | | | The removed code was disabled before the tests were imported into the Qt repository in 2006, so its meaning or usefulness is lost in the mists of time. Change-Id: Iccdf5638106b054f02ed73790f7acda1b17b045b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove tests for API that never made it into Qt.Jason McDonald2011-10-312-45/+0
| | | | | Change-Id: If78d82abfb4ff3402eb8f36729bacc3c4d343d0c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove obsolete code from QChar autotest.Jason McDonald2011-10-311-14/+0
| | | | | | | | | QUnicodeTables::ligature() was removed from the API in 2006. The commit that disabled the test also changed the code to call QChar::ligature(), which has never existed. Change-Id: I056c17c178a527b076538fb007404ff0b735ba02 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove obsolete code from qstate autotest.Jason McDonald2011-10-311-145/+0
| | | | | | | | This was originaly the only test function in this test, and should have been deleted when it was replaced by the other test functions. Change-Id: Idc71a5462fd4d19955f9b14389b877be16c62ab5 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Improve QBuffer autotestJason McDonald2011-10-311-3/+2
| | | | | | | | | | The documentation of QIODevice::pos() states: "For sequential devices or closed devices, where there is no concept of a "current position", 0 is returned". The test had a disabled check for a position of -1 before the device is opened. Make the test agree with the documentation. Change-Id: Ide5729bfc825cdb84caf4851574a57d3ef42ccb2 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove debugging code from QFileSystemWatcher testJason McDonald2011-10-311-15/+0
| | | | | | | | | Any test diagnostics that are useful should be part of the regular test output, as the CI system cannot switch on commented-out code when there is a test failure. Change-Id: I201ba754df26ffc30997bead8b822f97913db2b6 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove disabled tests from QUrl test.Jason McDonald2011-10-311-733/+1
| | | | | | | | | | | | Some tests were copied in from KDE's KURL sometime prior to Qt's tests being added to the Qt repository in June 2006. This was presumably done with the intention of making the tests work for QUrl, but that never happened and the copied tests have never been enabled. This commit removes the copied material. Change-Id: Ic35526f0018900bd60d7905646b24c62317b5e47 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove obsolete code from qtconcurrentiteratekernel test.Jason McDonald2011-10-311-44/+0
| | | | | | | The removed code refers to WhileIteration, which does not exist. Change-Id: I4c44bc319ac776d16ce9ba7b5c2938ce1642a3f6 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove obsolete code from qtconcurrentrun test.Jason McDonald2011-10-311-71/+29
| | | | | | | | | The removed code was left over from an unfinished MSVC6 compatibility API (see commit e3e28e7a in the grafted history). That compiler is no longer supported, so this code can be retired. Change-Id: I81bcfa771ae13579f2458eb2d3ebf41c6af8577c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Re-enabled tst_LargeFileJo Asplin2011-10-292-1/+3
| | | | | | | | | | | tst_LargeFile currently seems to pass in a stable way in CI It does have an issue on 64-bit Linux (see QTBUG-21175), so that test function is still disabled (QEXPECT_FAIL'ed) on that platform. Change-Id: I818046f84f2db5eb2155ae1f51f69581029bfaee Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Add QDataStream operators to QMargins, so it can be streamedSteven Ceuppens2011-10-271-0/+26
| | | | | | | | | | * QDataStream format documented * Added Unit test for QDataStream operators * Updated Unit test Change-Id: Idbcfcb0b927e6369e8d31b57693c7aa0d1a154e7 Reviewed-by: Olivier Goffart <ogoffart@kde.org>
* Remove unnecessary QSKIP.Jason McDonald2011-10-271-3/+2
| | | | | Change-Id: Icaa0687d5d0370ede6076cbee9d97d89e338ca17 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove obsolete MSVC workarounds from autotests.Jason McDonald2011-10-273-27/+0
| | | | | | | | Qt5 doesn't support MSVC versions before 2008, so workarounds for earlier versions are no longer required. Change-Id: I429feff99fe61d286637b960d92fd58962f8aefa Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Replace QSKIP with QFAIL in qputenv testJason McDonald2011-10-271-2/+1
| | | | | | | | If qputenv fails, the test should fail rather than skip, particularly as the test is supposed to be testing qputenv. Change-Id: Iabe13d360cabaeffda46fab19f1dd0d4ed8e1eee Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove inappropriate QSKIP in QTextCodec autotest.Jason McDonald2011-10-271-2/+1
| | | | | | | | | | | | There were only two ways the QSKIP could be called: (1) the C++ runtime is broken, or (2) the earlier call to resize the string failed. In both cases there should be a hard test failure. In the former case, a broken C++ runtime calls all of the test results into question. In the latter case, the QByteArray::resize() method has suffered a regression. Change-Id: I5adf942d2eb4d746d2ab31e98571c5d9bdd40890 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove obsolete QSKIP call.Jason McDonald2011-10-271-4/+0
| | | | | | | | The bug referenced in the QSKIP has been marked as resolved, so this QSKIP should no longer be needed. Change-Id: I41dd964827a3df8fb5ebb9674cef9db59c03d432 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Doc: Fixing typoSergio Ahumada2011-10-264-6/+6
| | | | | | | Fix typos I was able to find in `tests/auto' directory. Change-Id: Id0bfcc18301381ac8b1ca8d5af17bd926e5913d4 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Re-enabled testsJo Asplin2011-10-263-3/+0
| | | | | | | | | | | | This commit re-enables tests that are assumed to be ok by now, since they: - Have been passing in CI for a long time recently (more precisely, not failed once in pulse run range 730-829). - Did not have any known issues associated with them. Note that not all of these tests were disabled as a result of QTBUG-21402. Task-number: QTBUG-21402 Change-Id: I80bbf8b351bd9165aa968e98f4dc17e8be6bc7c3 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Re-enabled tst_qsocketnotifierJo Asplin2011-10-261-2/+0
| | | | | | | | tst_qsocketnotifier is fixed by 0e7cecb861c7be73d3ef46b41ad6d1a5691b5e7d Task-number: QTBUG-20982 Change-Id: I97c0bc0f94a04e57f239de99bf3b64451a492434 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* all remaining tests: eliminated usage of qttest_p4.prfRohan McGovern2011-10-251-2/+2
| | | | | | | | | qttest_p4.prf was added as a convenience for Qt's own autotests in Qt4. It enables various crufty undocumented magic, of dubious value. Stop using it, and explicitly enable the things from it which we want. Change-Id: I02fe27b2c1800f929250fa8694ca2976c9661a12 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* corelib: eliminated usage of qttest_p4.prfRohan McGovern2011-10-25125-261/+366
| | | | | | | | | qttest_p4.prf was added as a convenience for Qt's own autotests in Qt4. It enables various crufty undocumented magic, of dubious value. Stop using it, and explicitly enable the things from it which we want. Change-Id: I7c1ffe9c8c294dbdc988e1582e580b1ed3f4593e Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* test: Split `qcontiguouscache' unit and benchmark testsSergio Ahumada2011-10-242-138/+4
| | | | | | | | | | | | | | | Moving three benchmark tests from 'tests/auto' to 'tests/benchmarks'. Also removing 'qttest_p4' usage while we are at it. - void asScrollingList(); - void cacheBenchmark(); - void contiguousCacheBenchmark(); were moved to 'tests/benchmarks/corelib/tools/qcontiguouscache' Task-number: QTQAINFRA-353 Change-Id: Icbdd852f9c14c3df042d2e19abd42af6c645a3cb Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add the missing unittestDavid Faure2011-10-232-0/+294
| | | | | Change-Id: I2384d9de7b9ef409db521087670070bd5afc85ff Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* Check QFileInfo::isExecutable for symlinks, works as intended.David Faure2011-10-231-1/+18
| | | | | Change-Id: I35acce7ba0e111f651864b9d16abf1bac1923f22 Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* QStandardPaths: add Config and GenericData, add methodsDavid Faure2011-10-231-0/+1
| | | | | | | New methods: standardLocations, locate, locateAll. Change-Id: I60bc90f8df53727a72c4b1839ea4d1d88a204e29 Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* Fix QTemporaryFile regressions and new found issuesJoão Abecasis2011-10-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change, the file template is always processed in original QString format. Trying to generate native paths before adding a missing placeholder mask could change the meaning of templates, such as "." and "..", which are now tested to mean "..XXXXXX" and "...XXXXXX", respectively. After ensuring the template includes a placeholder mask, the path is converted to a native *absolute* file path and the mask is sought for again. On Windows, native paths were already absolute. On Symbian, we'd need at least a clean path, as "." and ",," are not natively understood. There is a requirement that the placeholder mask /XXXXXX+/ makes it through this conversion unaltered, which relaxes prior requirements on *nix platforms. On Windows and Symbian the conversion is under Qt's control and not user-configurable. Reviewed-by: Shane Kearns (cherry picked from commit 401722ef9e6fe79bd41f9d5f79668f5c4997c8e6) Conflicts: tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp Change-Id: Iac823881c865adf0931dc4f429c6c1ef135eeb56 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Atomic implementation of create file and obtain handle for Win/SymbianJoão Abecasis2011-10-211-11/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Besides generating a unique name, createFileFromTemplate now also acquires a file handle on all platforms. The file engine's native handle is passed by reference and modified in place. This fixes a long standing security issue on Windows. On Windows and Symbian platforms we directly use the "native" file path when processing the template and generating the unique name. Since the native encoding is known, conversions at this point are safe. Errors other than "file exists" are propagated to Q(Temporary)File, and result in a failure in open(). The changes also unify error handling and should give consistent behaviour across all platforms. Worthy of note, there's a change in behaviour on Windows and Symbian: fileNames returned by QTemporaryFile on Windows and Symbian are always absolute after open has been called. This has to do with how QFileSystemEntry::nativeFilePath works on these platforms. (Test was updated to reflect change in behaviour.) Reviewed-by: Gareth Stockwell Reviewed-by: Shane Kearns (cherry picked from commit ff9b69838ec146aeb43d4af8a03043f9c5f0454d) Conflicts: tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp Change-Id: Ibc9affb321ea4f4b193efc1f7336c9770b43d8df Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Remove SkipMode parameter from QSKIP calls.Jason McDonald2011-10-2123-53/+49
| | | | | | | | | The previous commit removed SkipMode from the testlib APi. This commit removes the parameter from all calls to QSKIP. Task-number: QTBUG-21851, QTBUG-21652 Change-Id: I21c0ee6731c1bc6ac6d962590d9b31d7459dfbc5 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>