summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io
Commit message (Collapse)AuthorAgeFilesLines
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-0153-0/+53
| | | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I8129c3ef3cb58541c95a32d083850d9e7f768927 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make sure that the parsing mode reaches QUrlPrivate::setHostThiago Macieira2012-08-011-1/+26
| | | | | | | | | | | | Ensure that the parsing mode is cascaded down from setAuthority and setUrl so that the hostname parsing does not attempt to decode percent-encoded hostnames when it shouldn't. Take the opportunity to also remove the "Boolean Trap" from QUrlPrivate::setHost. Change-Id: Ia64754c4a4900182700b7af1382aea8410abc7e9 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make QUrl::setScheme only parse in strict mode (no decoding)Thiago Macieira2012-08-011-3/+11
| | | | | | | | | | The URI RFC defines schemes as containing only a very restricted set of characters, none of which require encoding, so don't even try. Testing this behaviour in some web browsers indicate that they do not accept percent-encoded schemes either. Change-Id: I692dd20e1aac7e8a1bcb276cb5113b5802393d38 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix QUrl support for empty usernames and passwordsThiago Macieira2012-08-011-3/+9
| | | | | | | | | | | | | | | If the password is empty (but present), the userinfo component of the URL should end in a colon (":"). QUrl already supported that and it was tested (case "password-empty"). If the username is *also* empty but present, the userinfo component is just the colon (":"). Fix support for that case by checking if we stored the presence flag instead of checking the size of the component. Change-Id: Ie224493a997dbf76b2e44dd6d55fd9674ac83c1c Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix handling of encoded NULs (%00) in QUrl::fromPercentEncodingThiago Macieira2012-08-011-1/+3
| | | | | | | | | | | | | QString::fromUtf8, without an explicit size, (currently) defaults to stopping at the first NUL. That means we need to pass an explicit size. Also take the opportunity to test that QUrl::toPercentEncoding also works with the same data. Change-Id: I79362d67afda624b01ca07b0315b611c4aa3fdda Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: David Faure <faure@kde.org>
* QDebug: Add getter/setter for auto-insert-spaces.David Faure2012-07-271-0/+21
| | | | | | | | | | | | This is useful for inserting a string without space-handling, given that dbg.nospace() followed by dbg.space() inserts a space. It's also useful for QDebug operators for custom types, so that they can disable space handling and then restore to whatever it was before (rather than forcing it to space() mode). Change-Id: I9d72e9ffbcbc581ed093168752c29af924405b33 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Base 'FileSystem' test helper class on QTemporaryDir.Friedemann Kleint2012-07-262-19/+21
| | | | | | | | | This avoids test instabilities and prevents test directories from being cluttered with temporary files. Change tests accordingly. Remove unused createLink() method. Change-Id: I843c28ab81c8a476c71c5211a7479b22d3d9fc93 Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* Windows: Do not return short path names for QDir::tempPath().Friedemann Kleint2012-07-171-0/+2
| | | | | | | | WinAPI GetTempPath() sometimes returns short names for C:/Users/<user>/AppData/Local/Temp. Change-Id: I33f991acc06e652ccd484d36a5a384eb776f8395 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* fix object file name clashOswald Buddenhagen2012-07-163-0/+3
| | | | | | | under extremely rare circumstances this would have actually failed Change-Id: I4132d0f82e9f924e92e9e96f6d34451c94a67201 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix small problems with tst_QProcessThiago Macieira2012-07-121-3/+4
| | | | | | | | | | | | | | Remember to register the metatype where we use it, so we don't depend on another test being run previously. And skip the setWorkingDirectory test completely on Unix. I don't know why it needs to be skipped, but if we're not going to verify anything, don't even try to do anything. This saves us one memory leak at least. Change-Id: I22e151cc3fa7b4e976972aca8978b88b263d9bee Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* test: subtract qurlinternal.pro when private_tests are not enabledSergio Ahumada2012-07-101-1/+2
| | | | | | | | | | This test used requires(contains(QT_CONFIG,private_tests)) in its .pro file, but did not subtract itself from its parent project SUBDIRS when private_tests weren't enabled. Change-Id: Idcd0893c4804a8217e4dd33ba9838ff67e996f58 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Avoid load(testcase) for installing test helper appsRohan McGovern2012-07-041-6/+6
| | | | | | | | | | | | Make test projects declare TEST_HELPER_INSTALLS rather than calling a function exported by testcase.prf. load(testcase) may be unsafe, as testcase.prf should be processed after default_post.prf. Fixes silent disabling of various autotests. Change-Id: I56b35ffd653a637ad5ab18d64dd1a1edadfac59f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com>
* Fixed several unit tests to work in shadow buildsKurt Korbatits2012-06-292-0/+2
| | | | | | | | - qlogging, qthreadstorage, qnetworkreply, qapplication, qfile, qprocess Added app_bundle and debug_and_release_target to CONFIG Change-Id: I6212902c449520dc016da9590149a423069cc38c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix QIODevice warning when running rcc.Mitch Curtis2012-06-261-0/+44
| | | | | | | | | | | | | | | | | | When opening a QFile on stdout, for example, we must not call seek as it is a sequential device. This has been flagged as a warning since commit Ie3a96d3a and has resulted in spurious warnings being emitted. In the case of opening a QFile in Append mode, QIODevice::open already sets the position marker, so calling seek is redundant. This is also true for the file engine's open function (called through openExternalFile()), which also ensures the handle or descriptor is repositioned appropriately. Task-number: QTBUG-26104 Change-Id: I71040c399efe54e7538f54433368b432e959e08d Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Add missing subdirs (the new QUrl unit tests were not compiled and run)David Faure2012-06-262-0/+3
| | | | | | Change-Id: I1b39d92b8a14d5aeca957180858e1980a534894b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Skip 3 test methods if the test server isn't set up.David Faure2012-06-232-3/+8
| | | | | | | | This makes things easier for developers touching QtCore and running all QtCore unit tests. Change-Id: I7aa832a6a1be07d90cacad2eecb2364285ff3818 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fix qdiriterator autotest build for WEC7.Janne Anttila2012-06-211-1/+1
| | | | | | Change-Id: I18b1bdd79905761eff7a5ddbe1c6538c33624a1f Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
* Fix qfile autotest build for WEC7Janne Anttila2012-06-212-3/+5
| | | | | | Change-Id: I6c4b4c91ea841ccb91ad685510caaecaf51baced Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fix tst_qfile opening of stdin/out/err: don't assumeThiago Macieira2012-06-181-29/+38
| | | | | | | | | | The standard streams can be redirected to a file, so don't assume anything, but try to get the actual size and position from the OS and from the C library (stdout is usually buffered, so the result of lseek might be different from ftell). Change-Id: Ice4a0aa21726671928f56a13cc07cc0e4b52091d Reviewed-by: Richard J. Moore <rich@kde.org>
* 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>
* 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 tst_qtextstream parallel-safe.Rohan McGovern2012-05-312-8/+21
| | | | | | | | Write to a QTemporaryDir instead of the test's build directory. Change-Id: Ib65a0d58fbdf8caf8f2cb7002aeed1ce34742183 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Marked tst_qtemporaryfile as parallel-safeRohan McGovern2012-05-311-0/+1
| | | | | | | | | | This test failed a parallel stress test, but seemingly only because it writes to its own build directory. This should not interfere with other running autotests. Change-Id: I27a2f31e32a5b8157ef1082cf0e939bcc0c61c70 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Marked tst_qfile as parallel-safeRohan McGovern2012-05-311-0/+1
| | | | | | | | | | This test failed a parallel stress test, but seemingly only because it writes to its own build directory. This should not interfere with other running autotests. Change-Id: I80e548fdb0e915ebe86dcd2205537cb6fee09cff Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Marked tst_qprocess as parallel-safeRohan McGovern2012-05-301-0/+1
| | | | | | | | | | This autotest appears to be parallel-safe. It fails our parallel stress test, but only because it writes to its own build directory. This should not interfere with other autotests. Change-Id: Ie99dde24edc0fda0c8ec4352a6e44abb7cbc54f8 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Marked tst_qprocess insignificant on macRohan McGovern2012-05-281-0/+1
| | | | | | | | | tst_qprocess::lockupsInStartDetached sometimes locks up on mac. Mark this as a known issue. Task-number: QTBUG-25895 Change-Id: I08b1bcf39f2bf373e74509a06415d9ba514b8993 Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Fix handling of invalid urls in QDataStream << QUrlDavid Faure2012-05-231-0/+34
| | | | | | | | | | | When given an invalid url, the output shouldn't be a valid url. KDE's kurltest detected this regression compared to Qt4, where all invalid urls were empty in toString() -- but we don't want that, to give as much feedback as possible to the user. Change-Id: Ie53e6e1c0a1d4bb9e12b820220dfb7e2f7753959 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Removed CONFIG+=parallel_test from suspected parallel-unsafe tests [2]Rohan McGovern2012-05-231-1/+1
| | | | | | | | | These tests have failed a parallel stress test and may contribute to instability in test runs. Change-Id: Ibbbe01f7d9550b953fc9fbd6ed52fc99fdb5f5d7 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Add the QUrl::FullyDecoded flag to the component formattingThiago Macieira2012-05-222-0/+28
| | | | | | | | | | | | | | | | | | This allows the QUrl component getters to return fully decoded data, like they did in Qt 4. This is necessary for some use-cases where the component like the user name, password or path are used outside the context of a URL. In those contexts, the percent-encoded data makes no sense, and the loss of data of what could be represented in a URL is acceptable. Also take the opportunity to expand the documentation of those getter methods, explaining what the options argument does. Discussed-on: http://lists.qt-project.org/pipermail/development/2012-May/003811.html Change-Id: I89f743cde78c02f169c88314bff0768714341419 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Add QUrl::ParsingMode to the component setters in QUrlThiago Macieira2012-05-221-0/+198
| | | | | | | | | | | | | | This allows one to instruct QUrl to ignore the percent-encodings and interpret the data exactly as provided. This is useful in certain use-cases where the data comes from a non-URL context. The strict-mode checking of the components is not implemented yet. Currently, the behaviour is equal to that of TolerantMode. Discussed-on: http://lists.qt-project.org/pipermail/development/2012-May/003811.html Change-Id: Ia5abe045a8ce7f9b50cbce3b5a7e3735e068d03a Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Port away from QUrl::MostDecodedThiago Macieira2012-05-223-22/+26
| | | | | | | | | | | Since we're about to introduce QUrl::FullyDecoded, this QUrl::MostDecoded value would be confusing. Replace its uses with what was intended at the point in question. Change-Id: Iefd87bc33d37bace507c5cb0f206fa902e08e2df Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fix the idempotent recoding tests in tst_QUrlInternalThiago Macieira2012-05-221-3/+28
| | | | | | | | | | | | This was trying all the possibilities by brute force, but it turns out that some combinations are not valid so they should not be tested. What's more, it was using old values of the flags, so this was actually testing nothing. Change-Id: I6c2f5230d240fc23418df2d3a1ca905dbc47dd10 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Removed CONFIG+=parallel_test from suspected parallel-unsafe testsRohan McGovern2012-05-228-9/+7
| | | | | | | | These tests have failed a parallel stress test and may contribute to instability in test runs. Change-Id: I2c4456ad7d3846c2262a0ba714ab8f0c9a05c597 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Fix QFile::permissions for long filenamesShane Kearns2012-05-161-7/+59
| | | | | | | | | | When qt_ntfs_permission_lookup is used, QFile::permissions failed for files with long filenames. Also created a test case for this API, which revealed another bug. Task-number: QTBUG-25629 Change-Id: I73b7676a9d059c0e782b3f701b2e6bbc92f671ed Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
* Fix cases where functions are called with a drive and no slashAndy Shaw2012-05-161-1/+25
| | | | | | | | | | | | | | | When a file is specified on a path that includes a drive letter followed by a colon but no slash then it didn't always account for the fact that this refers to the current path on that drive. This fixes the problems in completeBaseName(), baseName() and path(). Tests are also added for these three cases and some others too. Task-number: QTBUG-25353 Change-Id: I47a197c6af066f532442ad269be57597ec61303a Reviewed-by: Irfan Omair <irfan.omair@gmail.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Remove capitalization when specifying include-libraries.kb2012-05-142-2/+2
| | | | | | | | | | | | | MinGW installations on case-sensitive filesystems expect lowercase names of include-libraries and (usually) include files. When crosscompiling on Debian 6 (targeting MS Windows) linking fails because mingw is looking for non-existent include-libraries. Using lowercase names solves this. Change-Id: Id3454f4ed8ba42b6ea93d65d9c0ce567db6712df Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* QUrl: using sectionIsPresent in operator== broke for local files.David Faure2012-05-141-0/+4
| | | | | | | | | QUrl::fromLocalFile("/foo") doesn't set Host, but QUrl("file:///foo") does (to remember that it saw a Host section, even if empty, which is useful for urls like "remote://"). So ignore the Host flag in operator==. Change-Id: I4322b4a75420c4e42766c0d65c1b121f28028a76 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QUrl: a url with a fragment or query, and one without, are different.David Faure2012-05-141-0/+2
| | | | | | | | | Fix operator== and operator< so that a URL with an empty fragment or query, is not treated as equal to a URL without any fragment or query. This restores the Qt4 behavior on this particular issue. Change-Id: Ie989f37353fb13c791b1d558d638d2e8a5b5d1b8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Restore QUrl::setEncodedQuery(QByteArray()) to the Qt4 behavior.David Faure2012-05-131-2/+9
| | | | | | | | | | Null bytearray means no query, and QString::fromLatin1(QByteArray()) doesn't give a null string, but an empty string. Same for setEncodedFragment(QByteArray()). Change-Id: I992e9253e35941d66886456872ea06aa2ae92450 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix a crash when parsing a URL with username and port, but no passwordThiago Macieira2012-05-101-0/+10
| | | | | | | | | | This was crashing because the ':' was found past the end of the username, causing the recoder to run from position 22 to 11, via the long way around the memory. Change-Id: Ic1ae596f34f7db857fb4210294974fb5a6adf691 Reviewed-by: Alexis Menard <alexis.menard@openbossa.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix qDecodeDataUrl for already percentage encoded content.Alexis Menard2012-05-093-0/+98
| | | | | | | | | | | If the url we pass as parameter already have percentage encoded data, we don't want to decode it and call fromPercentEncoding. The test coverage is not complete for qdataurl.cpp file but it is better than previously and it will also protect us from future regressions. Change-Id: I79f709f44bed1b7f274a3de639c7e291fa91a193 Reviewed-by: Thiago Macieira Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QUrl::StripTrailingSlash for the case of no path at all.David Faure2012-05-091-0/+1
| | | | | Change-Id: I1fd0fe4b9b67996732c85c1792415e371e865595 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Slightly improve the query encode/decode test in QUrlThiago Macieira2012-05-041-6/+7
| | | | | | | | Show that nothing is changed either way, regardless of the encoding flags used. Change-Id: I31fba5f87eae777d4b708ab789b32169004bcbcc Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix QUrl::toString(StripTrailingSlash) to not turn file:/// into file:David Faure2012-05-041-10/+18
| | | | | | | | It should only strip one slash (as the name indicates), and not if the path is just "/". Change-Id: I133a81977241de77a49d1d1559143d30e0bd52f8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change remaining uses of {to,from}Ascii to {to,from}Latin1 [QtCore]Thiago Macieira2012-05-042-3/+3
| | | | | | | | | | | This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: I38f97ad379deafebef02c75d611343ca15640c8a Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Merge remote-tracking branch 'origin/api_changes'Lars Knoll2012-05-031-14/+14
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qlogging.cpp src/gui/kernel/qguiapplication.h src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow.h tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp Change-Id: I62a8805577a7940d4d36bed985eb3e7019d22f2e
| * Logging: Change arguments of message handler to avoid conversionsKai Koehne2012-04-201-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new QtMessageHandler that takes QString instead of char *: This avoids converting to local8bit , only to convert it back to utf16 for Windows. The old QMessageHandler is kept for a transition period, but will be removed before Qt 5.0. Also fix qEmergencyOut (that is called in OOM situations) to not rely on the default message handler. Change-Id: Iee0ce5838f97175c98788b847964273dd22d4a37 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Don't use obsolete qVariantValue, qVariantCanConvert, etc.Debao Zhang2012-05-022-10/+10
| | | | | | | | | | | | | | | | | | | | qVariantValue and qVariantCanConvert are Compatibility members, while in Qt4.8 they are marked as Qt 3 Support Members. qVariantFromValue and qVariantSetValue are Obsolete members. Change-Id: Ie8505cad1e0950e40c6f6710fde9f6fb2ac670fd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* | Wrap all Latin 1 strings with QString::fromLatin1 or QLatin1StringsThiago Macieira2012-04-271-23/+23
| | | | | | | | | | Change-Id: I1a1891b9126a2546c1872ec25aba9581cc84bb2f Reviewed-by: Lars Knoll <lars.knoll@nokia.com>