summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io
Commit message (Collapse)AuthorAgeFilesLines
* bail out early in QWinOverlappedIoNotifier::waitForNotifiedJoerg Bornemann2013-07-051-1/+0
| | | | | | | | Calling waitForNotified on an uninitialized notifier will print a warning and return false. The autotest has been adjusted. Change-Id: I85e18d6d0a8a5462e1a5d451613add941d89b5fb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Use case insensitive matching for hashes QFileSystemWatcher/Win.Friedemann Kleint2013-07-041-5/+16
| | | | | | | | | | | Do not lower case file names to generate hash keys since QString::toLower() converts some characters with context which the Windows file system will not. Task-number: QTBUG-31341 Change-Id: I285bfedef3c1ca9d59083229e61974dd378c72ae Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* remove wait calls in tst_QProcess::simpleStartJoerg Bornemann2013-07-021-9/+1
| | | | | | | | | Instead of calling different wait functions on different platforms, we use QTRY_COMPARE to check the process state. Change-Id: I6489cabce9e63f9c8b1036f3cccbf35b52df72e7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
* QUrl test: ensure that hostnames with bad non-IDN domains are caught tooThiago Macieira2013-07-021-1/+4
| | | | | | | | | Leading and double dots are bad, but trailing dots are fine. The ASCII part of a hostname is supposed to be LDH (letters, digits, hyphen) only, but we accept '_' (underscore) as an exception too. Change-Id: I79957ddec4da78a0e2357fe50c8687db03e1c99e Reviewed-by: David Faure (KDE) <faure@kde.org>
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-06-202-5/+22
|\ | | | | | | Change-Id: I94bb158562ae6b80a87b40139d7302ea7b9b9aa8
| * fix QFileSystemEngine::createDirectory race conditionv5.1.0-rc1Shawn Rutledge2013-06-141-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During a call to QDir::mkpath(), the same path could be created by another process, in which case the OS mkdir will fail with EEXIST. But the docs for mkpath() state that it's not an error if it already exists, whereas for mkdir() it is an error. So QFileSystemEngine::createDirectory should accept the EEXIST error silently if it occurs while creating the sequence of parent directories and the final leaf directory, but should fail if EEXIST happens when it was called from QDir::mkdir(), which is when the createParents parameter is false. We assume the operating system mkdir() and CreateDirectory() are atomic, so there should be no race condition in QDir::mkdir(). It's not necessary for mkpath() to call stat() at each level, only to check whether an existing entry is a directory or a file. Also added to the autotest to verify that if the path is an existing file, creating a dir with the same name will fail in either mkdir or mkpath. Task-number: QTBUG-30046 Change-Id: I926352f10654fdf3b322c8685bb85ad8b8844874 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
| * Let QTemporaryDir::stressTest() run in temporary directory.Friedemann Kleint2013-06-121-4/+5
| | | | | | | | | | | | | | Task-number: QTBUG-31618 Change-Id: I60aaa4f57710816cd0e22ea9b097c7e85466fd0c Reviewed-by: David Faure (KDE) <faure@kde.org>
* | tst_QUrl: check that prohibited characters in hostnames are not validThiago Macieira2013-06-081-0/+15
| | | | | | | | | | | | | | | | qt_nameprep is tested by tst_qurlinternal. We just need to be sure that QUrl handles them correctly. Change-Id: Ic563004870d2cf2fa7a31ce49fff7280d5ffb5f3 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | QUrl stringprep: fix handling of U+0080: it's prohibitedThiago Macieira2013-06-081-0/+5
| | | | | | | | | | | | | | | | Edge case: a > that should have been >=. Without it, we never ran the rest of the IDN nameprepping. Change-Id: I2276d660de3a70d0c561bb18816820d9a0f47e77 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | QUrl stringprep: fix handling of prohibited charactersThiago Macieira2013-06-081-27/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC 3454 says about prohibited characters (section 2, "Preparation Overview"): 3) Prohibit -- Check for any characters that are not allowed in the output. If any are found, return an error. This is described in section 5. In other words, we mustn't simply strip the output of prohibited characters. We must generate an error if they are present. We do that by clearing the data. We already had tests for prohibited output, but they were indistinguishable from being stripped. So instead add some extra characters so that we can tell whether the label was cleared. Change-Id: I2d95217c27be5e2d54deed0036cb009e3b7f4886 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Unix: fix tst_QFile when run as rootRafael Roquetto2013-06-071-0/+7
|/ | | | | | | | Because tests are usually run as root on some setups, it does not make sense to test for the right permissions of a readonly file. Change-Id: I484f88722d3a9ce7123edc0fb57acae528fa194e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revert QDateTime serialisation to pre-Qt 5 behaviour.Mitch Curtis2013-05-081-1/+2
| | | | | | | | | | | | | | In Qt 5, I managed to break the guarantee that a deserialised local datetime is the same time of day (potentially different UTC time), regardless of which timezone it was serialised in. This happened after I fixed QTBUG-4057 with If650e7960dca7b6ab44b8233410a6369c41df73a, which serialised datetimes as UTC. This patch reverts QDateTime serialisation to pre-Qt 5 behaviour to restore the guarantee and consequently re-opens QTBUG-4057. Change-Id: Iea877f7ed886f530b928067789b53534e89fe8cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QProcess/Win: drain output pipes on process finishJoerg Bornemann2013-05-071-0/+34
| | | | | | | | | | | | If a process dies before all output is read into the internal buffer of QProcess, we might lose data. Therefore we must drain the output pipes like we already do in the synchronous wait functions. Task-number: QTBUG-30843 Change-Id: I8bbc5265275c9ebd33218ba600267ae87d93ed61 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Fix tst_qfile build for WEC7.Janne Anttila2013-04-171-1/+3
| | | | | | | | | Windows Embedded Compact does not have drive letters like desktop Windows => do not try to build drive letter related test code for WEC7. Change-Id: I2c3659220a001510c0555e2dd773b4dd68e9c2cc Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Make QBuffer::bytesAvailable() workThiago Macieira2013-04-161-1/+22
| | | | | | | | | | | | | We don't need to keep an internal QBuffer position, we can just use the one from QIODevice::pos(). It will keep track of goings ahead and backwards for us, plus it will make the default bytesAvailable() work out-of-the-box too. This error was reported on IRC. Change-Id: I8559e8ee56edaa01ca8732c1f1012082ebe3a3f2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* tst_qdataurl: Remove QT_DISABLE_DEPRECATED_BEFORE=0Debao Zhang2013-04-121-2/+0
| | | | | Change-Id: I6f2e45bbc6d31cac4d9b8c735650f7985865109c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSaveFile: allow saving to a writable file in a non-writable directoryDavid Faure2013-04-051-9/+76
| | | | | | | | | | The only way to make this possible is to disable the atomic-rename-from-temp-file behavior. This is not done by default, but only if the application allows this to happen. https://bugs.kde.org/show_bug.cgi?id=312415 Change-Id: I71ce54ae1f7f50ab5e8379f04c0ede74ebe3136d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Ensure QTemporaryFile can create files when an identical dir exists.Mitch Curtis2013-03-231-0/+35
| | | | | | | | | | | | | | | | | | When QTemporaryFile attempts to create a new file in createFileFromTemplate, it fails if the filename exists and is a directory. Windows returns error code 5 (ERROR_ACCESS_DENIED) in this case - rather than ERROR_FILE_EXISTS - which is not handled. This patch handles ERROR_ACCESS_DENIED in addition to the already handled ERROR_FILE_EXISTS, meaning that QTemporaryFile will continue to look for unique names when a directory with the same name exists. Task-number: QTBUG-30058 Change-Id: I42339887d7f5483e3dc6a03a9da15111c350da8f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* tst_qlockfile: increase delay on Windows.David Faure2013-03-191-1/+1
| | | | | | | | | OpenProcess + WaitForSingleObject is supposed to fail after the process exits, but this seems to take some time until Windows notices. Change-Id: I942a9b4a458c23fc4ac33b28386e28821128e991 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-166-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Compile fix when fileno does not return intPaul Olav Tvete2013-03-121-1/+1
| | | | | | | | This broke the build on Android where fileno returns a short. Change-Id: Ic8d32380078faeedcd22e785a912fede28251156 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Fix warning about float truncation in tst_qdatastream.Friedemann Kleint2013-03-061-1/+1
| | | | | Change-Id: I8e6af7e6534272d1385020212ad7348d9d74b38d Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-03-062-0/+20
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-03-052-0/+20
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure qmake/generators/mac/pbuilder_pbx.cpp src/corelib/kernel/qtimerinfo_unix.cpp src/plugins/platforms/cocoa/qcocoabackingstore.mm src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/xcb/qglxintegration.cpp Change-Id: I8d125fe498f5304874e6976b53f588d3e98a66ac
| | * QStandardPaths: Use forward slash consistently.Friedemann Kleint2013-02-271-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-29249 Change-Id: I027f9ae18544dc47e1378214244487c8a5ae704c Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Fix qfile autotest on qnxFabian Bumberger2013-02-251-0/+6
| | | | | | | | | | | | | | | | | | | | | This fixes the compilation of the qfile autotest on qnx. Change-Id: Iab099e8b754a4341152e338ff6e3d22a83c625e3 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
* | | Make QProcess startable with open()Corentin Jabot2013-03-051-0/+20
|/ / | | | | | | | | | | | | | | | | | | Add setProgram() and setArguments() methods to the QProcess api. Add a convenient start(QIODevice::OpenMode) method. Move the implementation of QProcess::start() to QProcess::open() unifying the QProcess api with other QIODevice subclasses. Change-Id: Id1af57da05f750fe8d526d391589c05ee8037bca Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Long live QLockFileDavid Faure2013-03-056-0/+474
| | | | | | | | | | | | | | | | | | | | | | Locking between processes, implemented with open(O_EXCL) on Unix and CreateFile(CREATE_NEW) on Windows. Supports detecting stale lock files and deleting them. Advisory locking is used to prevent deletion of files that are still in use. Change-Id: Id00ee2a4e77a29483d869037c7047c59cb909339 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Remove excess brace added by accidentThiago Macieira2013-03-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Added in 53dc49ffc8c2e9e84d80b3e0bbef948e99172f9a. io.pro:44: Excess closing brace. Change-Id: Ia3810a5a2668d96ab4604831e8ca5b49c7562956 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* | QUrl: update top level domains that may contain non-ASCII charactersPeter Hartmann2013-03-022-1/+34
| | | | | | | | | | | | | | | | | | Most notably, .com and .net now may contain non-ASCII characters. list has been generated from http://www.mozilla.org/projects/security/tld-idn-policy-list.html Change-Id: Idc3191dc782bc4173ccb19b4bc81f4f061ca7999 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | tst_qfile: remove unused variableDavid Faure2013-02-271-5/+0
| | | | | | | | | | Change-Id: I3c827b8a372158815cf234a548a85cf6165c189e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | tst_qfileinfo: Fix invalid preprocessor directive.Friedemann Kleint2013-02-261-1/+1
| | | | | | | | | | | | | | Introduced by 5ec342fefdb00406d3bf6f3943d4b235b9094cc9 . Change-Id: I28f9e093567ef1abf3898146e7183a90888262ad Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | Check for network module when building according auto testsOliver Wolff2013-02-191-0/+7
| | | | | | | | | | Change-Id: I68013bf8e07be8d202b3253f997d4f4db05335a4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Fix QFileInfo autotest for VxWorks.Pasi Petäjäjärvi2013-02-191-4/+10
| | | | | | | | | | | | | | No users/groups/symlinks on VxWorks. Change-Id: I524a568202db2478b070b16a63ae425224c3aaa0 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | Fix QFile autotest for VxWorksPasi Petäjäjärvi2013-02-191-2/+12
| | | | | | | | | | | | | | | | No users/file permissions. Open function in VxWorks DKM requires always three parameters. Change-Id: I93fb075d82aa57e210e224bfe4ede40def82c275 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | Fix QSettings autotest for VxWorksPasi Petäjäjärvi2013-02-191-0/+2
| | | | | | | | | | | | | | No users/groups on VxWorks. Change-Id: I88912c93fa59dc7c00bdbb973fc34ecd631b3316 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-144-46/+54
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/concurrent/doc/qtconcurrent.qdocconf src/corelib/doc/qtcore.qdocconf src/corelib/global/qglobal.h src/dbus/doc/qtdbus.qdocconf src/dbus/qdbusmessage.h src/gui/doc/qtgui.qdocconf src/gui/image/qimagereader.cpp src/network/doc/qtnetwork.qdocconf src/opengl/doc/qtopengl.qdocconf src/opengl/qgl.h src/plugins/platforms/windows/qwindowswindow.cpp src/printsupport/doc/qtprintsupport.qdocconf src/sql/doc/qtsql.qdocconf src/testlib/doc/qttestlib.qdocconf src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf src/widgets/doc/qtwidgets.qdocconf src/xml/doc/qtxml.qdocconf Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
| * tests: Fix some more old references and links to NokiaSergio Ahumada2013-02-012-44/+44
| | | | | | | | | | | | | | Task-number: QTBUG-28156 Change-Id: Ifb768b167203c901c5e42ce58c9aaf3db2739320 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| * Make the null pointer dereference a volatile oneThiago Macieira2013-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This is to ensure that the compiler won't optimise it out of existence. Clang says it will do it: testProcessCrash/main.cpp:50:5: warning: indirection of non-volatile null pointer will be deleted, not trap [-Wnull-dereference] *(char*)0 = 0; ^~~~~~~~~ Change-Id: Iac7771046442f869e205e8789fffdd6443d58e67 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
| * Forward-port tests on invalid port numbers from Qt 4Thiago Macieira2013-01-281-0/+8
| | | | | | | | | | | | | | | | | | These tests were added to Qt 4 on commit a17fc85b51a6bdcfa33dcff183d2b7efd667fb92 Task-number: QTBUG-28985 Change-Id: I3cf595384f14272197dcfb85943213c8f8ddeba0 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
| * Fix minor typos in docs, printed messages & commentsSze Howe Koh2013-01-281-1/+1
| | | | | | | | | | | | | | Missing apostrophes Change-Id: I3ef5e9d494fb7a37f8e6075f24cd3a274e572c23 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| * Check existence of QProcess feature before using it on Qt autotests.Pasi Petäjäjärvi2013-01-282-6/+7
| | | | | | | | | | | | | | | | VxWorks does not have QProcess support. Change-Id: I917b769f967e9d71ec5025aae788f3e237b07aeb Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> (cherry picked from commit 416e73a0fcaf31f7c32ba7dcd214b62e6060123c)
* | qprocess autotests don't need QtGuiDavid Faure2013-02-097-0/+7
| | | | | | | | | | | | | | | | (this isn't true of -all- corelib/ autotests though, e.g. tst_qdatastream uses QBitmap) Change-Id: I314fda5d85d45cb5eece8da74156989b83cf0299 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QUrl effective TLDs: update table and split into chunks of 64KPeter Hartmann2013-02-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | The table is there to know which domains are allowed to set cookies and which are not. There are more than 2000 new entries since the list has last been generated. The split to 64K chunks was made because this is the hard limit for strings in Visual Studio. Change-Id: I511aec062af673555e9a69442c055f75bdcd1606 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-01-291-0/+8
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-281-0/+8
| |\| | | | | | | | | | Change-Id: I12b4d8b99bdccae53b1a978cd6eb8f4ac6fb3c76
| | * Fixed checking HOME variable return value using isEmpty()Pasi Petäjäjärvi2013-01-251-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return value of the QFile::decodeName(qgetenv("HOME")); is never null if HOME environment variable is not set. So need to check the return value using isEmpty() instead. Task-number: QTBUG-28912 Change-Id: Ic57b1978d63e99b056cde35ca8cb9d2a07ff8ce8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | | Fix MinGW-Warnings in tst_qwinoverlappedionotifier.Friedemann Kleint2013-01-281-5/+8
| | | | | | | | | | | | | | | | | | | | | Change-Id: I66c4e274c8b686d8a69476ad10751008f256e5a2 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | | Fix warning about redefinition of _WIN32_WINNT.Friedemann Kleint2013-01-281-1/+0
|/ / | | | | | | | | | | | | This is redefined by qt_windows.h Change-Id: I6a8cb06c93c4055b166f1a214cba981d61680b9c Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-01-2352-52/+52
|\ \ | | | | | | | | | refs/staging/dev