summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qfile
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Change remaining uses of {to,from}Ascii to {to,from}Latin1 [QtCore]Thiago Macieira2012-05-041-2/+2
| | | | | | | | | | | 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>
* Do not ignore tests/auto/corelib/io/qfile on Mac OS XBradley T. Hughes2012-04-121-2/+0
| | | | | | | This does not fail anymore, remove CONFIG+=insignificant_test Change-Id: I4f98cfad563adfa460910976317c91e852db6872 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Drop file-engine abstraction from public APIJoão Abecasis2012-02-222-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This abstraction imposed serious performance penalties and is being dropped from the public API. In particular, by allowing file names to be arbitrarily hijacked by different file engines, and requiring engines to be instantiated in order to decide, it imposed unnecessary overhead on all file operations. Another flaw in the design with direct impact on performance is how engines have no way to provide (or retain) additional information obtained when querying the filesystem. In many places this has meant repeated operations on the file system, where useful information is immediately discarded to be queried again subsequently. For Qt 4.8 a major refactoring of the code base took place to allow bypassing the file-engine abstraction in select places, with considerable performance gains observed. In Qt 5 it is expected we'll be able to take this further, reaping even more benefits, but the abstraction has to go. [Dropping this now does not preclude that virtual file systems make an appearance in Qt at a later point in Qt 5's lifecycle. Hopefully with a new and improved abstraction.] Forward declarations for QFileExtension(Result) were dropped, as the classes were never used or defined. Tests using "internalized" classes will only fully run on developer builds. QFSFileEngine was removed altogether from exception safety test, as it isn't its intent to test internal API. Change-Id: Ie910e6c2628be202ea9e05366b091d6d529b246b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fixed tst_QFile when redirecting stdin/stdout/stderr to/from files.Rohan McGovern2012-02-161-3/+6
| | | | | | | | | | | openStandardStreamsBufferedStreams would fail if standard streams were redirected to a file (e.g. ./tst_qfile > testlog.txt). openStandardStreamsFileDescriptors already has a workaround, so apply it here too. Change-Id: Iffe9d7864909e489e77c1114e80c4e3bc70a8722 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Fixed qfile unittest rename() failing as rootKurt Korbatits2012-02-091-0/+7
| | | | | | | | | When run as root was able to move file to /etc directory but was expecting a failure. Change-Id: Ic2ac5506253f2a3395ed56e88a856542bf82ad6d Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Fix QFile autotest not to require elevated privilege to passShane Kearns2012-02-071-3/+13
| | | | | | | | | | | | | | | | | | | The open test case tests opening a device path on windows. As this requires privilege elevation, the test fails when running nmake check from a console. As the CI machines appear to run tests with admin privileges, first check opening the device using the windows API. If that succeeds, then opening using QFile should succeed. If that fails, the opening using QFile should fail. (Since Windows vista, members of the "administrators" group do not run at elevated privilege all the time. The user needs to opt in via a UAC prompt or "run as administrator". This is similar to using the sudo command on unix) Ran the test as administrator and normally. Now passes in both cases. Change-Id: Ibd7682eceb61e35d4912fa0392df536f4331f6ed Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Fixed qfile unittest on windowsKurt Korbatits2012-02-022-14/+7
| | | | | | | | | | | - Changed to set working directory based on subprogram stdinprocess's directory location. - Changed QProcess execution of subprograms to use relative paths. Change-Id: Idbccca635f0f61adba9721bcceeceb0a8a961dcf Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-302-2/+2
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-232-2/+2
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Moved largefile unittest to same level as qfile.Kurt Korbatits2012-01-163-544/+0
| | | | | | | | | | - Moved largefile from out of qfile unittest directory to be on same level as qfile. Change-Id: I479b0b33594812759f8a6a7be61f8340f64234e9 Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Changed unittests in corelib to use specific headers instead of super-headers.Kurt Korbatits2012-01-161-1/+2
| | | | | | | | | | | | Modified unittests to use specific class headers instead of using super-headers like QtCore that pull in all the headers for the module. - Decreasing build time. Change-Id: I9c3fd0767be15205893bb406f609c8283a2a3a5a Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-053-3/+3
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Use true and false in preference to TRUE and FALSE in tests.Jason McDonald2012-01-031-12/+12
| | | | | | | | | Use the C++ boolean constants true and false instead of the C macros TRUE and FALSE (which are actually integers), and use QVERIFY instead of QCOMPARE for verifying simple boolean expressions. Change-Id: Ie76dfcab6722df6b93b3fa62b0f3437901482932 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Cleanup corelib autotests.Jason McDonald2011-12-281-2/+3
| | | | | | | | | | | | | When using QSignalSpy, always verify that the signal spy is valid. This will cause the test to give a meaningful failure when spying on a non-existant signal. Without this change, tests that spy on a signal to ensure that it is not emitted (i.e. by comparing the spy count to zero) could pass erroneously if something went wrong when creating the signal spy, as an invalid QSignalSpy will always return a count of zero. Change-Id: I41f4a63d9f0de9190a86de237662dc96be802446 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Reimplement QAbstractFileEngine::open() properlyBradley T. Hughes2011-12-211-1/+1
| | | | | | | | | | | | | | | | | | The virtual function takes a QIODevice::OpenMode argument, not an int. tests/auto/corelib/io/qfile/test/../tst_qfile.cpp:1942: warning: 'MyEngine::open' hides overloaded virtual function [-Woverloaded- virtual] bool open(int ) { return false; } ^ src/corelib/io/qabstractfileengine.h:118: hidden overloaded virtual function 'QAbstractFileEngine::open' declared here virtual bool open(QIODevice::OpenMode openMode); ^ Change-Id: I92338dacb89c05d8c5cfbf8ce094dc519b84d3ba Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Fix qfile unit test failing on shadow build.Kurt Korbatits2011-12-131-3/+3
| | | | | | | Updated three instances were not using QFINDTESTDATA. Change-Id: Ibd0f6734791fc5d98ebeb65ac3bd80aa1c076414 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Promote openStandardStreams sub-tests to top levelJoão Abecasis2011-12-091-10/+2
| | | | | | | | | | | | Commit a72468e820c2922540737c053eef27d033c2e77b split the test into two functions, but kept them combined in a single slot for QTest to invoke. That being the case, we might as well have them as test functions of their own right. Should work nicer with test failures, skips and such. Change-Id: I62c1fc7777c08b3e87a5903632d73dc1e1d97e1a Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* QFile-test: Do not fail when run with redirected stdout/stderr.Friedemann Kleint2011-12-091-5/+11
| | | | | | | Check whether stdout/stderr is sequential. Change-Id: Ia6311e265f0da03dce5b05d78a2058e0c2098bbf Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Remove TESTED_CLASS/TESTED_FILES comments from tests.Jason McDonald2011-12-061-3/+0
| | | | | | | | | These comments were mostly empty or inaccurate. Appropriate naming of tests and appropriate placement of tests within the directory tree provide more reliable indicators of what is being tested. Change-Id: Ib6bf373d9e79917e4ab1417ee5c1264a2c2d7027 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fixed installation of corelib testsRohan McGovern2011-12-013-56/+51
| | | | | | | | | | | | | | | | | In .pro files, removed wince/symbian-specific DEPLOYMENT cases and replaced them with TESTDATA where appropriate. In .cpp files, removed SRCDIR and relative paths to testdata and replaced them with the QFINDTESTDATA macro where appropriate. Modified test helper apps/libs to install themselves under the test they relate to. This change allows corelib tests to be correctly installed, along with their testdata, via `make install'. Change-Id: I5e202e2f3b577af7e39072d5c9fe13e0ca125304 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Cleanup corelib autotestsJason McDonald2011-11-301-3/+1
| | | | | | | | Remove references to the old bug tracker. The data from the old bug tracker is no longer accessible, so these markers are meaningless. Change-Id: Ib9d029d52b70fd0a512b9532d65f03763eabfe57 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Cleanup corelib autotestsJason McDonald2011-11-291-5/+4
| | | | | | | | Don't name test functions using task identifiers from obsolete bug trackers. Change-Id: Iba6ae8ad3b39e365c5510ed5c86749a167572829 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Correct usage of network-settings.h.Jason McDonald2011-11-281-0/+3
| | | | | | | | | Four of the modified files only use functions from network-settings.h on Windows, and the other three files don't use anything from that header. Change-Id: Ifa4b0319d14367735b859e538921fa0eeeccce1a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove obsolete test data from QFile test.Jason McDonald2011-11-181-1/+0
| | | | | | | | | | | The removed data relied on the test's own source file having no write permissions, but that is not a valid assumption -- in a source package the file wouldn't have had write permissions, in Perforce it would have depended on whether the file had been checked-out for editing and in git the file would always have write permission. Change-Id: I3b6100429120137095a210189961c8b97f06e50a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Don't depend on moc to disable test functions.Jason McDonald2011-11-182-41/+42
| | | | | | | | | | | | | | | | | | | | | The moc tool is not aware of all defines (particularly those that are compiler builtins) and does not correctly evaluate others that depend on compiler builtins, such as Q_OS_FOO. This commit reverts parts of the following commits, but is not a complete fix as there were many instances of this problem in the tests prior to those commits: 924d810dbdcd5b5b0fa860922b2487ea9062d002 8aaff6751038b88d17e23be6fcee945771297c5b 338d3f11973412047c2c9cd41cbd0c961d738ef3 a55034062ba2bf73a9f1ed3d9cf31745b38149e3 253497b7446c7d723aa3bdd7152e25d6852f2604 7cfad460c56319ba89c4a3a0bbcb2e54ab1cdbc6 9d2ff58f3642828e494e7e9b2df7dbb8e2cd408f 0cf6baa2d61ebaad2a2a0530c37f27e719b68f4b Change-Id: I947d797fe3ec76139ba1b55561cea569895662c5 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Cleanup corelib autotestsJason McDonald2011-11-112-13/+5
| | | | | | | | | | | | | Tidy the autotest .pro files. Most autotest .pro files should look like this: CONFIG += testcase TARGET = tst_something QT = core testlib SOURCES = tst_something.cpp Change-Id: I877c2194e9fa9dd13478d117895e1e255a948ad7 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Cleanup corelib autotestsJason McDonald2011-11-101-17/+16
| | | | | | | Remove literal tabs. Change-Id: I210a0259773cceb20d35ebc80b889e3ebb88b540 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Cleanup corelib autotestsJason McDonald2011-11-071-22/+1
| | | | | | | Remove redundant empty constructors, destructors and test functions. Change-Id: Idb51368895e67ec3fc0345a9a5d33d77730c051b 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>
* Remove obsolete MSVC workarounds from autotests.Jason McDonald2011-10-272-8/+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>
* corelib: eliminated usage of qttest_p4.prfRohan McGovern2011-10-252-5/+6
| | | | | | | | | 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>
* Remove SkipMode parameter from QSKIP calls.Jason McDonald2011-10-212-7/+7
| | | | | | | | | 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>
* Remove DEPENDS_ON from qtestlib API.Jason McDonald2011-10-191-4/+0
| | | | | | | | | | The DEPENDS_ON macro didn't do anything and has misled many users to think that they can write test functions that depend on other test functions. Task-number: QTBUG-21851 Change-Id: Ibe65b2d5d88bb81b6a0ebbe0b220f7d409a1446c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Avoid using QSKIP in lieu of compile-time checksJason McDonald2011-10-071-3/+4
| | | | | | | | | | | | | | | | QSKIP is intended to be used to skip test functions that are found at run-time to be inapplicable or unsafe. If a test function can be determined to be inapplicable at compile-time, the entire test function should be omitted instead of replacing the body of the test function with a QSKIP, which only serves to slow down test runs and to inflate test run-rates with empty, inapplicable tests. Task-number: QTQAINFRA-278 Change-Id: I95feba3edbfa092c0ef4d85bb8c6877bd6be698e Reviewed-on: http://codereview.qt-project.org/6128 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Avoid using QSKIP in lieu of compile-time checksJason McDonald2011-10-052-43/+41
| | | | | | | | | | | | | | | | QSKIP is intended to be used to skip test functions that are found at run-time to be inapplicable or unsafe. If a test function can be determined to be inapplicable at compile-time, the entire test function should be omitted instead of replacing the body of the test function with a QSKIP, which only serves to slow down test runs and to inflate test run-rates with empty, inapplicable tests. Task-number: QTQAINFRA-278 Change-Id: Ib2025339422749cf216e87ac414a3056250bf8f9 Reviewed-on: http://codereview.qt-project.org/5942 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Tests: Fix compilation on Windows.Friedemann Kleint2011-10-031-7/+7
| | | | | | | | | Replace Q_WS_... by Q_OS_... in corelib tests. Change-Id: I14c41dca1ec490b3c49ba2c24e60def14c6de9da Reviewed-on: http://codereview.qt-project.org/5778 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove Symbian-specific code from tests.Jason McDonald2011-09-293-215/+26
| | | | | | | | | Symbian is not a supported platform for Qt5, so this code is no longer required. Change-Id: I1172e6a42d518490e63e9599bf10579df08259aa Reviewed-on: http://codereview.qt-project.org/5657 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* This test passes fine.Lars Knoll2011-09-201-1/+0
| | | | | | | | Task-number: QTBUG-21402 Change-Id: Ied00dd2302b08d75e44c102f6025123b41657ca6 Reviewed-on: http://codereview.qt-project.org/5001 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Disabled tests for refactor->master integrationJo Asplin2011-09-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | This change disables failing tests to increase the likelihood that 'make check' terminates with a zero exit status. This is done to prevent the CI system from blocking further commits once qtbase#refactor is merged into qtbase#master. Failing tests are marked as insignificant (by putting 'CONFIG += insignificant_test' in the .pro file). Note: This is a temporary measure that needs to be cleaned up once the refactor->master integration is complete. Ideally all disabled tests need to be enabled and passing. All changes will be marked by the string QTBUG-21402 in a comment for easy location. Task-number: QTBUG-21402 Change-Id: Ic4400671671f6d9b75b106a6aa4755b20e74378d Reviewed-on: http://codereview.qt-project.org/4678 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Moving relevant tests to corelib/kernelHolger Ihrig2011-09-011-0/+1
| | | | | | | | | | | | | | | | Added Test for qmetaproperty Marked QSocketNotifier Autotest as insignificant. See QTBUG-21204 Marked qtranslator Autotest as insignificant. See QTBUG-21125 Marked corelib/io/qfile/largefile as insignificant. See QTBUG-21175 Task-number: QTBUG-21066 Change-Id: I2a7f6587845c355091bb07c8dd3d1557d16db0be Reviewed-on: http://codereview.qt.nokia.com/3598 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* Moving relevant tests to corelib/ioHolger Ihrig2011-08-3120-0/+4286
Marked Test for qdiriterator as insignificant. See QTBUG-21160 Marked Test for qresourceengine as insignificant. See QTBUG-21159 Task-number: QTBUG-21066 Change-Id: I72848a651ff3e7aff1d6105dd49124e4ed070a44 Reviewed-on: http://codereview.qt.nokia.com/3577 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>