summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io
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>
* test: Remove QSKIP from tst_QSettings::dontReorderIniKeysNeedlessly()Sergio Ahumada2012-10-311-5/+3
| | | | | Change-Id: I7b804592398869278e9a0fec982c235c41f2c3d7 Reviewed-by: Caroline Chao <caroline.chao@digia.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>
* 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>
* 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>
* test: Remove QSKIP from tst_QSettings::fileName()Sergio Ahumada2012-10-241-4/+5
| | | | | Change-Id: I24ed2d182faff989f62f192246ebf95ca492c10d Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* test: Fix tst_QDir.equalityOperator()Sergio Ahumada2012-10-241-1/+1
| | | | | | | | On Fedora 17 /sbin/ is a symlink now, so this test fails there. Using /usr/ instead. Change-Id: Ie35902fc093101191bdbf33324e20835d1da1528 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* normalise signal/slot signatures [QtCore tests]Marc Mutz2012-10-222-13/+13
| | | | | | | | | | Normalise all signal/slot signatures in tests/*/corelib, except in tst_QObject, where they might be test data. Change-Id: Id4e101f285b1676bb583b0afae06d235e599e24b Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* test: Moving tst_QProcess::echoTest_performance()Sergio Ahumada2012-10-195-115/+0
| | | | | | | | | tst_QProcess::echoTest_performance() is not an unit test but a performance test, so moving it from 'tests/auto/corelib/io/qprocess' to 'tests/benchmarks/corelib/io/qprocess' Change-Id: I796788534eafc5ca3b8d86c0ec46998285fd4b8f Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Test: remove QSKIP from tst_QTextStream::stillOpenWhenAtEndCaroline Chao2012-10-181-3/+5
| | | | | | | Instead omit the whole test when Q_OS_WINCE is defined. Change-Id: Ifd09048687db95913f39a64cffb42a743af8fa81 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Test: remove QSKIP in tst_QDataStream::stream_QIconCaroline Chao2012-10-181-5/+5
| | | | | | | Instead omit the whole test when Q_OS_WINCE is defined. Change-Id: Ic69accb138121d2b39f068cef181da13b18e46ee Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Test: remove QSKIP in tst_fileCaroline Chao2012-10-181-7/+10
| | | | | | | Instead omit the whole tests when appropriate. Change-Id: I5eae127a497e290c5e4ba1a81a8f325c300471c1 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Test: remove QSKIP in tst_QDir::dotAndDotDotCaroline Chao2012-10-181-4/+5
| | | | | | | Instead omit the omit the whole test when Q_OS_WINCE is defined. Change-Id: I8c0f12c63bbc4567edb3a8626ab060d5ce38f3cd Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Test: remove QSKIP in tst_QDirIterator::hiddenDirs_hiddenFilesCaroline Chao2012-10-161-8/+8
| | | | | | | Instead omit the whole test when Q_OS_WIN is defined. Change-Id: I08060168edb2353f4960129b1c0654fea165ca6c Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Test: remove QSKIP in tst_QDataStream::stream_QPixmapCaroline Chao2012-10-161-5/+8
| | | | | | | Instead omit the whole test when Q_OS_WINCE is defined. Change-Id: I356af3ea145012142b3cf2af0b5d813d4be07a25 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Test: remove QSKIP from tst_LargeFile::mapOffsetOverflowCaroline Chao2012-10-161-4/+5
| | | | | | | | Instead omit the whole test when Q_OS_MAC is defined. Change-Id: I7d35c99ecd69b3c5bb8f8590342edd9665300709 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Test: remove QSKIP from tst_qstextstreamCaroline Chao2012-10-161-9/+11
| | | | | | | Instead omit the whole tests when Q_OS_WINCE is defined. Change-Id: Idb15d622c9e1dbe4c8ec6a43c34a88e7fef2a384 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Test: remove QSKIP from tst_QProcessEnvironment::putenvCaroline Chao2012-10-161-4/+5
| | | | | | | Instead omit the whole test when Q_OS_WINCE is defined. Change-Id: I19e35b837709c92e0202c6a96d113367bc6c92c2 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* tst_qfile: remove QSKIP's -> omit whole test cases insteadSergey Hambardzumyan2012-10-151-32/+14
| | | | | | Change-Id: Ibc01790992e839e3afde4b52682cb155c7f3f5f8 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Re-revert "Delay creation of the process manager"Thiago Macieira2012-10-153-0/+90
| | | | | | | | | | | | | | | This reverts commit daba2c507ad42c66dafa6a29cffa94e9641e0c58, re-applying commit d9c06bf25210b3d0b31ee6126e57bcb82c292da1, because the change was accidentally brought back in commit eae8fb85997d82ecec0743ba3e470681129bff41. There's a potential deadlock when a QProcess is created while a QCoreApplication is instantiated but never executed, or if the main thread waits() for the child thread. Task-number: QTBUG-27260 Change-Id: I9e0fdc0341b3063de90979377bac35f2a827b260 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Auto tests: revise cursor dependant testsJ-P Nurmi2012-10-131-9/+17
| | | | | | | | | | | | | | | | | | Cursor dependant auto tests are currently skipped in various ways. Some are checking PlatformQuirks::haveMouseCursor() that tries to detect if the desktop environment is MeeGo, using obsolete Q_WS_X11. Some are skipped if QT_NO_CURSOR or Q_OS_WINCE is defined and some are actually missing the approriate guards. => unify by defining QTEST_NO_CURSOR in qtest-config.h when appropriate ie. for platforms that have no regular mouse cursor support or when QT_NO_CURSOR is defined. Task-number: QTBUG-22551 Change-Id: I9a1e0e3156617945ae46226c79268955454c8a9a Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Fix Windows: QStandardPath::findExecutable() to check suffixes.Friedemann Kleint2012-10-081-26/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | Append the Windows executables suffixes from the PATHEXT environment variable. The previous code had a bug since the 'break' statement bailed out of the inner loop only. Factor search code out into a separate functions, avoiding repeated invocations of list.constEnd() and variable assignments in the old code. Add a static function that is called on Unix and on Windows for executable names with a suffix. Call another function applying a candidate list of suffixes in case an executable name without a suffix is passed. Lower case the extensions from PATHEXT, streamline code. Split up the test, add a _data() slot for clarity. Task-number: QTBUG-27457 Change-Id: I2bf34de52aeadddd3b937ad1e22191c3c850fd26 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Overhaul a little the QUrl error reporting.Thiago Macieira2012-10-021-11/+16
| | | | | | | | | | | | | | | | | | | | | | Keep the original QString that triggered the parsing error, instead of just one QChar. This provides more powerful error messages, like: Invalid IPv6 address; source was "http://[:::]"; scheme = "http", host = "" (QUrl cannot keep invalid hostnames) Invalid port or port number out of range; source was "http://example.com:abc"; scheme = "http", host = "example.com" (QUrl cannot keep a non-numeric port number) Invalid path (character '%' not permitted); source was "foo:/path%?"; scheme = "foo", path = "/path%25%1F" (the tolerant parser runs first, so the faulty component is fixed) This stores the error state in a special structure which is not allocated under normal conditions, keeping the memory consumption down. On 32-bit systems, QUrlPrivate does not increase in size; on 64-bit systems, it grows by 8 bytes. Change-Id: I93d798d43401dfeb9fca7b6eed7ea758da10136b Reviewed-by: David Faure <faure@kde.org>
* Update some error messages in QUrl::errorString()Thiago Macieira2012-10-021-8/+12
| | | | | | | | | Make both invalid hostname messages start with "Invalid hostname". And split the empty port error from the invalid port one. Change-Id: I870d1ed6fb07ec494f553871a37ed167141ffc06 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Remove the annoying qWarning when QUrl::setPort is out of rangeThiago Macieira2012-10-021-3/+0
| | | | | | | | | | That's what we have QUrl::errorString() for. This will become evident especially now that QUrl::toString() / toEncoded() return empty if there are errors. Change-Id: I64a84e9c6ee57c0fc38cc0c58f5286ddc1248d1f Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: David Faure <faure@kde.org>
* Make QUrl::toString() / toEncoded() return empty for invalid URLsThiago Macieira2012-10-021-4/+43
| | | | | Change-Id: I6ebb4ad2901a9bacb09fb81082202f37ebbc2e97 Reviewed-by: David Faure <faure@kde.org>
* Add two compound URL invalidity cases for isValid()Thiago Macieira2012-10-021-14/+32
| | | | | | | | | | | | | | These two errors can only happen if one calls setPath() explicitly. They cannot happen for parsed URLs, which is why they are only caught with isValid(). It's not possible to set the error condition in setPath() either because they depend on the presence / absence of the authority and scheme. Also update all the unit tests that set a path not starting with a slash and were just "freeloaders" on the previous behaviour. Change-Id: Ice58cd4589a850452d7573a5b19667bbab2fb43e Reviewed-by: David Faure <faure@kde.org>
* QProcess.tests: adding test for channel forwardingThomas Hartmann2012-10-024-0/+89
| | | | | | | | | | This tests QProcess::setProcessChannelMode(). The tests verifies if testForwarding really forwards the output of testProcessEcho (spawned by testForwarding). Change-Id: Ifc4164569256aeaeab0edef42116986272362c01 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Rename createLocalFile to createNativeFile & deprecate createLocalFileAndy Shaw2012-10-024-1/+44
| | | | | | | | | | | | | | | | | | As it was confusing to use the term local file when referring to a file that was accessible using native APIs and not just a file that was on a hard disk somewhere already the function name has been changed. By renaming it to createNativeFile we keep it consistant with QFileInfo which has an isNativeFile() function too. Test also added. Task-number: QTBUG-3169 Change-Id: I410e7ed28133d68fd312c6c0faf3f7191460d7ce Reviewed-by: João Abecasis <joao@abecasis.name> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QWinOverlappedIoNotifier test for multiple I/O operations addedJoerg Bornemann2012-10-021-20/+102
| | | | | | | | | | | tst_QWinOverlappedIoNotifier::multipleOperations starts asynchronous read and write operations on the same named pipe handle. The received notifications must contain the right byte count and OVERLAPPED pointer corresponding to the I/O operation. Change-Id: I6f3fa5cf3ca6d62fcb9bc7073d28611fcfa7d98a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
* QWinOverlappedIoNotifier: multiple I/O operations on the same handleJoerg Bornemann2012-10-021-4/+4
| | | | | | | | | | | | | When doing multiple I/O operations on the same handle, we get notified for every operations. These must be distinguished by comparing the pointer to the OVERLAPPED struct. We now pass the OVERLAPPED pointer via the notified signal and let the receiver decide if it wants to handle this notification. Change-Id: I4efe70f39c6ae5282b949f2f4b21f6e7dd3df785 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* remove no-op test from tst_qfileJoerg Bornemann2012-09-271-23/+0
| | | | | | | | | | According to the repo history the tailFile was introduced with the S60 port but the functionality it's testing was never implemented. Task-number: QTBUG-22341 Change-Id: I16e8e43bbd799f05f8b136925cb0add0b918289e Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Test: tst_QFile::writeLargeDataBlock() unstable failure as XFAILCaroline Chao2012-09-261-2/+10
| | | | | | | | | | | | While the large data block can be written to a file, the test is also showing instability while reading back the written block. Adding another expected failure to address this instability. Task-number: QTBUG-26906 Change-Id: I9704d441cf2bd6d7ef0f9023240ea61bb89561b6 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Test: tst_QFile::writeLargeDataBlock() unstable failure as XFAILCaroline Chao2012-09-251-1/+1
| | | | | | | | | | The current check is not enough to catch the unstable failure. Update the test to catch the failure in all cases. Task-number: QTBUG-26906 Change-Id: I2e37a1f6513df768cd410df7c91a9fd843150e57 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Fix default-constructed QFileSystemEntryJoão Abecasis2012-09-251-0/+41
| | | | | | | | | | | | | | Member variables for lastSeparator, first and lastDotInFileName are now initialized to -1 (non-existing), where the previous value of zero would mean a separator/dot at that position and resulted in path() returning '/', instead of '.'. Tests were expanded for better coverage of empty state and default-constructed instances. Change-Id: Ie27547886b52224d38b5be0b4f920c9927fd440f Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Test: Enabled tst_QFile::invalidFileCaroline Chao2012-09-241-2/+1
| | | | | | | | | | | | The test is not hanging on Windows anymore. On Windows, add an expected failure for the failing case. Task-number: QTBUG-22801 Task-number: QTBUG-27306 Change-Id: Iede95766504f3e8a278a4554a5967ca333aae3bf Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2254-1316/+1316
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* remove mentions of borland from project filesOswald Buddenhagen2012-09-192-2/+2
| | | | | Change-Id: I3049b24ae287bee50aca1de06664a2309df69edf Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Blackberry: fix tst_QFileInfo::fileTimes()Rafael Roquetto2012-09-141-1/+5
| | | | | | | | | | | The Blackberry OS uses a filesystem with the noatime option, which returns a "wrong" access time. Change-Id: I04cdb899699e819a36e0917e30d750067b33388d Reviewed-by: Tobias Koenig Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Peter Hartmann <phartmann@rim.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* tests: Don't omit the body of a test function with QT_BUILD_INTERNALSergio Ahumada2012-09-144-44/+64
| | | | | | | | | | Changing it outside of the test function definition to avoid running empty/inapplicable test functions. Change-Id: I713560cde7f715696984ed082d682900f5f1bcdd Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Caroline Chao <caroline.chao@nokia.com>
* Fixed: QFileInfo::lastModified() returning wrong value.Markku Heikkila2012-09-131-0/+10
| | | | | | | | | | | | | | | Fixed so that empty QDateTime is returned for non existing file. Fixed also created() and lastRead() to return empty QDateTime for non existing file. QFileSystemEngine::fillMetaData() returned true for non existing files. This was also corrected. Task-number: QTBUG-25811 Change-Id: I523eb99e4405b4b813b2950f85cc646239181d07 Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Christian Stromme <christian.stromme@nokia.com>
* Blackberry: fix tst_QFileInfo::isWritable()Rafael Roquetto2012-09-131-1/+4
| | | | | | | | | This test checks the access permissions for '/etc/passwd', however the filesystem on Blackberry is always read-only Change-Id: I9299531397d4467287541b04184540ad6e2eae72 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Use true and false in preference to TRUE and FALSESergio Ahumada2012-09-051-1/+1
| | | | | | | | The TRUE and FALSE macros are obsolete and should be replaced with true and false (all lower case) respectively. Change-Id: Iee352e8173500683e6319be0abbf5bacf29016e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* test: Mark tst_QFile::writeLargeDataBlock() unstable failure as XFAILSergio Ahumada2012-08-311-1/+11
| | | | | | | | The test has one unstable failure on Windows, so mark this with QEXPECT_FAIL Task-number: QTBUG-26906 Change-Id: I2f6c63ddefecacd224d93f83e6951e961a02a051 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Make tests/auto/corelib compile on Windows CEKevin Funk2012-08-303-2/+4
| | | | | Change-Id: I71987d40ae69d95f645c4c7d26d50add4c799327 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* QUrl: port thread-safety autotest from Qt4.David Faure2012-08-262-1/+92
| | | | | | | | This detected the same missing detach()s in QUrl::resolve. Everything else works, no need for a mutex in Qt5's QUrl. Change-Id: I0da51b7b0c6b810d314a26d4b638383cd17de12b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove unused inotify includes in the filesystem watcher testThomas McGuire2012-08-231-8/+0
| | | | | | Change-Id: I346ef6ccf7b09390bef6d35c82ecee6dee1711fc Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix decoding of QByteArray in the deprecated "encoded" setters in QUrlThiago Macieira2012-08-202-0/+45
| | | | | | | | | | | | | | The asymmetry is intentional: the getters can use toLatin1() because the called functions, with a QUrl::FullyEncoded parameter, return ASCII only. This gives a small performance improvement over the need to run the UTF-8 encoder. However, the data passed to setters could contain non-ASCII binary data, in addition to the percent-encoded data. We can't use fromUtf8 because it's binary and we can't use toPercentEncoded because it already encoded. Change-Id: I5ecdb49be5af51ac86fd9764eb3a6aa96385f512 Reviewed-by: David Faure <faure@kde.org>
* tst_qurlinternal: use qurl_p.h instead of declaring the functionsThiago Macieira2012-08-201-9/+1
| | | | | | | | Just in case someone (like me) changes the function signatures or adds new functions. Change-Id: I1025fea012d95ffe89acaf799aa58fd2b0babc80 Reviewed-by: David Faure <faure@kde.org>