summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qfile
Commit message (Collapse)AuthorAgeFilesLines
* Android: skip tst_QFile::moveToTrash()Assam Boudjelthia2021-01-192-3/+3
| | | | | | | | | | | Android doesn't have a trash bin, so this test is not valid for that platform. Fixes: QTBUG-89398 Change-Id: I119b25682ba18e18466b5687cae369445dc73311 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 0392dce4f0a2093987ab45c48f0748c3dd97e7fc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: exclude tst_QFile::moveToTrash on AndroidAssam Boudjelthia2021-01-121-0/+3
| | | | | | | | | | | | The Android tests were marked insignificant for some days, due to an emulator issue, these tests slipped during that time. Exclude them now to bring Android tests back. Task-number: QTBUG-89398 Change-Id: Ia65a0ae8d7474fd2554dda299a60371dbbc9dddb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit b036ca33475a45298e383aa0d42f072d21e5a9df) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QChar: make construction from integral explicitGiuseppe D'Angelo2020-11-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QChar should not be convertible from any integral type except from char16_t, short and possibly char (since it's a direct superset). David provided the perfect example: if (str == 123) { ~~~ } compiles, with 123 implicitly converted to QChar (str == "123" was meant instead). But similarly one can construct other scenarios where QString(123) gets accidentally used (instead of QString::number(123)), like QString s; s += 123;. Add a macro to revert to the implicit constructors, for backwards compatibility. The breaks are mostly in tests that "abuse" of integers (arithmetic, etc.). Maybe it's time for user-defined literals for QChar/QString, but that is left for another commit. [ChangeLog][Potentially Source-Incompatible Changes][QChar] QChar constructors from integral types are now by default explicit. It is recommended to use explicit conversions, QLatin1Char, QChar::fromUcs4 instead of implicit conversions. The old behavior can be restored by defining the QT_IMPLICIT_QCHAR_CONSTRUCTION macro. Change-Id: I6175f6ab9bcf1956f6f97ab0c9d9d5aaf777296d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-09-233-17/+17
| | | | | | | | | | | Modify special case locations to use the new API as well. Clean up some stale .prev files that are not needed anymore. Clean up some project files that are not used anymore. Task-number: QTBUG-86815 Change-Id: I9947da921f98686023c6bb053dfcc101851276b5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Remove most compiler warnings about missing overridesLars Knoll2020-09-111-29/+29
| | | | | | | | | | | | Remove around 1000 compiler warnings about missing overrides in our auto tests. This significantly reduce the compiler warning noise in our auto tests, so that one can actually better see the real problems inbetween. Change-Id: Id0c04dba43fcaf55d8cd2b5c6697358857c31bf9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Regenerate subdir test projectsAlexandru Croitor2020-07-092-16/+16
| | | | | | | | And generate a few more test projects that were missing. Change-Id: I5df51106549aa5ae09bc3c42360e14b143719547 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Regenerate tests with new qt_ prefixed APIsAlexandru Croitor2020-07-091-1/+1
| | | | | | | | Use pro2cmake with '--api-version 2' to force regenerate projects to use the new prefixed qt_foo APIs. Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Avoid use of Q_UNUSED by eliminating the parameter namesLars Schmertmann2020-07-031-2/+1
| | | | | | | | | This change only happens to files touched by the commit to add missing ; to Q_UNUSED. Task-number: QTBUG-82978 Change-Id: I10e6993a2bb3952cf9a262708b8573550e0dbe63 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove winrtOliver Wolff2020-06-065-40/+18
| | | | | | | | | Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Handle disk full situations by skipping QFile::moveToTrash testVolker Hilsheimer2020-05-071-3/+9
| | | | | | | | | | If any of the temporary directories and files can't be created, skip the test. Otherwise, the cleanup routine would recursively delete "/". Change-Id: I51f908a468be8fd2ebd523ff7ce27a7c78d1b4e2 Fixes: QTBUG-83863 Pick-to: 5.15 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QFile::moveToTrash: work with relative file paths on WindowsVolker Hilsheimer2020-05-071-8/+12
| | | | | | | | | | | | | | | | | | | | The system APIs expect an absolute "display name" of the file path, so make it absolute. The test was overly tolerant in accepting failure, as a QStorageInfo initialized with a file path that doesn't exist is invalid, and thus always different from the QStorageInfo of the home directory. Fix the test to compare only valid QStorageInfo objects, and postpone the check until the file we want to move has been created. [ChangeLog][QtCore][QFile] moveToTrash supports relative file paths on Windows Change-Id: I94c8cd40c60fde469e38f76a98f867f20c6a0b15 Fixes: QTBUG-84015 Pick-to: 5.15 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Port more tests from qtbase/tests/auto/corelib/io/ to CMakeSona Kurazyan2020-05-042-2/+2
| | | | | | Change-Id: I56427e3e1908047a0674c8c80c24eeda80e947c2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove QTextStream dependency from tst_qfileLars Knoll2020-05-011-15/+6
| | | | | | Change-Id: I83cb05da8c094185b50e9cedea2e705ad1c7f948 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Q{File,FileInfo,Dir}: add std::filesystem::path overloadsMårten Nordheim2020-03-243-0/+54
| | | | | | | | | | | | | | | | | | | | Add some overloads where (I thought) it makes sense for QDir and QFile to accept std::filesystem::path objects. Currently my thinking is to not add overloads for static functions where std::filesystem can already do the same job, e.g. create directory or file. Template and enable_if is needed due to both QString and std::filesystem::path being able to be constructed from string literals. The common shared code is currently in QFile because QDir had an implicit include of QFile, made explicit in this patch, and QFileInfo has an include to QFile as well. The QT_HAS_STD_FILESYSTEM macro is visible in user-code which I currently take advantage of in the tests, and users could too. Change-Id: I8d05d3c34c6c17e20972a6a2053862b8891d6c3c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-02-131-0/+140
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/graphicsview/boxes/scene.h src/corelib/Qt5CoreMacros.cmake src/corelib/Qt6CoreMacros.cmake src/network/ssl/qsslsocket.cpp src/network/ssl/qsslsocket.h src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp src/testlib/CMakeLists.txt src/testlib/.prev_CMakeLists.txt tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp Disabled building manual tests with CMake for now, because qmake doesn't do it, and it confuses people. Done-With: Alexandru Croitor <alexandru.croitor@qt.io> Done-With: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: I865ae347bd01f4e59f16d007b66d175a52f1f152
| * On Windows 7, fall back to SHFileOperation to avoid confirmation dialogsVolker Hilsheimer2020-02-071-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moving a file to the trash should preferably done via IFileOperation. However, the implementation on Windows 7 ignores the operation flags that request the shell not to show any confirmation dialogs or other UI elements. SHFileOperation is an old API that doesn't show any UI, but has the limitation that it doesn't report the location of the file in the trash after the move. So an application cannot restore the file, but the user can do so via Explorer. Overall, the better compromise is to not have dialogs at the expense of not being able to report the new path. This allows us to run the unit test on Windows 7 as well. Change-Id: Ib8e651a69e2c6750f668b52d2a70925d156cc8ae Fixes: QTBUG-81927 Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
| * Add QFile::moveToTrash, which moves a file to the trashVolker Hilsheimer2020-02-051-0/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the nature of QFile just operating on a file path, this also works for paths that are actually directories. The test covers files from different locations on which this operation should typically succeed, but tries to handle the case where trashing files will fail because of the file system structure. On Windows 7, running the test will open a confirmation dialog as the implementation of IFileOperation doesn't respect the various flags. This might depend on the specific Windows 7 patch level, and the option to always use SHFileOperation on that platform needs to be evaluated further. [ChangeLog][QtCore][QFile] Introduce QFile::moveToTrash to allow applications to move files to the trash. Change-Id: I45019040c25b30f7db293b6933c63aca2f319514 Fixes: QTBUG-47703 Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
* | Merge remote-tracking branch 'origin/dev' into merge-devLeander Beernaert2020-01-241-2/+2
|\| | | | | | | Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
| * Deprecate constructing QFlags from a pointerAllan Sandfeld Jensen2019-11-201-2/+2
| | | | | | | | | | | | | | | | | | This was used to support QFlags f = 0 initialization, but with 0 used as a pointer literal now considered bad form, it had been changed many places to QFlags f = nullptr, which is meaningless and confusing. Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Post merge fixesLeander Beernaert2019-11-252-2/+0
| | | | | | | | | | Change-Id: I78d3c9687f99c0a32da04257e297e88ef0b02581 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2019-11-191-0/+4
|\| | | | | | | Change-Id: Ifecc2d9db396d783124df8567553ba5f846f30bb
| * QFileSystemEngine: Consistently check for invalid file namesUlf Hermann2019-10-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | stat() and friends expect a null-terminated C string. There is no way to generate anything useful from a string that has null bytes in the middle. It's important to catch this early, as otherwise, for example, a QDir::exists() on such a path can return true, as the path is silently truncated. Extend the checks for empty file names to windows and add checks for null bytes. Change-Id: Ie9794c3a7c4fd57f9a66bdbbab8b45a08b6f9170 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Regenerate tests/auto/corelib/ioAlexandru Croitor2019-11-121-3/+0
| | | | | | | | | | | | | | Change-Id: Ic1d1b5c0deb90800c7219fb8cce4e77e0db145b8 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* | Merge branch 'wip/qt6' into wip/cmakeAlexandru Croitor2019-08-153-14/+31
|\| | | | | | | Change-Id: I50ac36b8803c296998149e98cc61e38687cdd14b
| * unblacklist passing testsDaniel Smith2019-07-081-7/+0
| | | | | | | | | | | | | | | | These tests have not failed on the removed platforms for at least 60 days Task-number: QTBUG-76608 Change-Id: If7a9f4db907124e3cd54e3f4b0ad3e20717d1912 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Regenerate coreliob/io testsAlexandru Croitor2019-08-153-15/+114
| | | | | | | | | | | | | | | | | | | | | | | | With a few special cases to make the tests pass. Biggest one is the qlockfile_test_helper. Also a few tests have some problems and have not been ported yet: qfileselector, qresourceengine, qprocess. Change-Id: I91a5210b13e7a0697774d909449a71f46af0a0ba Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Regenerate CMakeLists for tests/corelib/ioJędrzej Nowacki2019-08-122-0/+70
|/ | | | | | | | | Only qdir, qlockfile, qprocess and qresourceengine were manually disabled, otherwise all other builds fine on linux. Change-Id: I09fd0ffffb778057d6bf9c25cad1fcd73fb7e530 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Migrate Windows system libs to external dependenciesJoerg Bornemann2019-05-081-1/+1
| | | | | | Started-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Change-Id: I211ce3252b836894aeeac1c85eb316d9596bca57 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Prefix QTextStream operators with Qt:: in testsLars Knoll2019-05-031-2/+2
| | | | | Change-Id: I852f016fcb619a9e634deee6efb1fe7930d974c8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Reduce redundancy and duplication in tst_QFile::appendAndReadEdward Welbourne2018-07-301-6/+5
| | | | | | | | | | | | | | Use one QStringLiteral instead of repeating a QLatin1String(), that was passed to a function that has to convert it to unicode; do the conversion at compile-time. Reducing i % 256 is fatuous when i ranges from 1 to 100. A QFile will close() itself on destruction, no need to do it explicitly. Especially when *not* close()ing the *other* QFile that was left open. Change-Id: Idb39312d9c9beaf082b7cead574bc6bb9bb3a775 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Actually truncate when asked toEdward Welbourne2018-07-301-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | On Unix, we wouldn't even *try* to truncate if the file was open for appending. The combination may be an eccentric choice but - at least when it's combined with reading - I can imagine use-cases for it; and we should (at least try to) deliver what we're asked for, even if we can't think why anyone would want it. So actually enable truncation when asked to. Amended some tests to check this works and corrected the QIODevice documentation of mode flags (which misdescribed the special case that implies Truncate). Removed special-case code, to apply truncate when writing but not reading, since it's been made redundant by the pre-processing of mode done in QFSFileEngine::processOpenModeFlags(). [ChangeLog][QtCore][QFile] When opening a file, if Truncate is asked for, or implied by other flags, it shall be attempted, regardless of what other options are selected. We previously did this on Windows; now we do so also on Unix (even when appending). Task-number: QTBUG-13470 Change-Id: I1e08d02cfbae102725fccbbc3aab5c7bf8830687 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix two "unused variable" warningsEdward Welbourne2018-07-251-1/+2
| | | | | Change-Id: Iafced3ffcc24303a1034805b46eb49bd076d1e79 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add qt_test_helper featureOliver Wolff2018-07-254-48/+28
| | | | | | | | | | | To avoid (even more) duplicated code, "qt_test_helper" ensures the policy of putting a test's helper application next to the test's own executable. The helper executable is suffixed with "_helper" to avoid name clashes with its folder. Change-Id: Ic50cb1daa257e7ffc75440c10a3b90fd39424683 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-07-021-3/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/cocoa/qnsview_dragging.mm src/plugins/platforms/ios/qiosinputcontext.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/tools/androiddeployqt/main.cpp Was moved from qttools into qtbase in 5.11. So re-apply 32398e4d here. tests/auto/corelib/global/qlogging/test/test.pro tests/auto/corelib/global/qlogging/tst_qlogging.cpp tests/auto/corelib/io/qfile/tst_qfile.cpp tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp tests/auto/corelib/thread/qthreadstorage/test/test.pro tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp tests/auto/widgets/kernel/qapplication/test/test.pro Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Done-with: Mårten Nordheim <marten.nordheim@qt.io> Done-with: Oliver Wolff <oliver.wolff@qt.io> Change-Id: Id970486c5315a1718c540f00deb2633533e8fc7b
| * Android: Make tst_qfile passMårten Nordheim2018-06-281-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | By disabling the "stdinprocess"-related tests/code... ... but differently. After fixing my earlier mistakes I'm getting segmentation faults when it executes a couple different library calls after the QProcess object has started. Task-number: QTBUG-68596 Change-Id: Id42a1f939c000754a187dee90c4a4cdfec816232 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * Make tests compile for AndroidLiang Qi2018-06-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This only enables compilation, it doesn't fix any test. Qt on Android supports process, but not TEST_HELPER_INSTALLS. See also acdd57cb for winrt. android-ndk-r10e is used to compile, see http://doc-snapshots.qt.io/qt5-5.11/androidgs.html . corelib/io/{qdir,qresourceengine} need to be fixed later. Done-with: Frederik Gladhorn <frederik.gladhorn@qt.io> Done-with: Mårten Nordheim <marten.nordheim@qt.io> Change-Id: I34b924c8ae5d46d6835b8f0a6606450920f4423b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | tst_qfile: Do not build helper application for winrtOliver Wolff2018-06-281-1/+2
| | | | | | | | | | | | | | | | The existence of the helper application confuses Coin which will result in an error. Change-Id: I3edf3f27acbe133b180d41a8ae950991e9a5b5da Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | tst_qfile: Fix execution for WinRTOliver Wolff2018-06-285-12/+37
|/ | | | | | | | | | | | | | | Not putting executables into debug/release subdirectories leads to the WinRT AppxManifest being overwritten by the wrong configuration. When Qt is configured with -release for example, it was possible that the debug manifest (Manifest files are always created next to the target) is written last and thus contains debug VCLibs as a dependency. Additionally the test was changed in that way, that the resulting file system structure (having helper and test application in a "top level" debug and release folder) is the same structure as in tst_qobject. Change-Id: I55078563304959c41e0dd9bb7bb91a6fc51e005a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* tst_QFile: Don't expect Windows HANDLE equality in nativeHandleLeaks()Kari Oikarinen2018-04-231-4/+0
| | | | | | | | | | | That check is flaky on Windows. It doesn't seem to be testing Qt functionality. I also don't see CreateFile2() documentation mentioning any guarantees that opening the same file twice would give the same HANDLE each time. Change-Id: Ica2e60571ae9fc39bf822803a2a9dd6add8323d7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.11Liang Qi2018-02-141-0/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/animation/qvariantanimation.cpp src/corelib/global/qglobal.cpp src/corelib/global/qlogging.cpp src/corelib/io/qprocess_win.cpp src/corelib/json/qjsonarray.cpp src/corelib/tools/qsimd_p.h src/corelib/tools/qtimezoneprivate_p.h src/corelib/xml/qxmlstream_p.h src/gui/kernel/qsimpledrag.cpp src/gui/kernel/qsimpledrag_p.h src/plugins/generic/generic.pro src/plugins/platforms/cocoa/qcocoamenu.mm src/widgets/styles/qmacstyle_mac.mm tests/auto/concurrent/qtconcurrentmap/BLACKLIST tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/widgets/dialogs/qmessagebox/BLACKLIST Change-Id: I508d686cf20f7f8cc6a7119b9bc7c3bbb505c58e
| * Skip tst_QFile::largeUncFileSupportKari Oikarinen2018-02-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | If more than one VM tries to run the test at the same time, it times out. These sharing violations were attempted to be worked around in 1c3dc8cfb, but the workaround just leads to timeout, not success. Task-number: QTQAINFRA-1727 Task-number: QTBUG-66216 Change-Id: If8bfd60dbb6575843680971d45b1c82e5beff534 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
* | Add QIODevice::NewOnly and QIODevice::ExistingOnly OpenMode flagsd3fault2018-01-171-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QFile::open is called with the NewOnly flag, the call will fail if the file already exists. As usual, if the file does not exist, it will be created. Like QTemporaryFile, there is a guarantee from the operating system that you are not accidentally creating a new file on top of an older file. When QFile::open is called with the ExistingOnly flag, the call will fail if the file does not exist. The ExistingOnly flag only provides new functionality when used with the WriteOnly flag. For ReadOnly it provides no change in functionality, as ReadOnly by itself already never creates. Task-number: QTBUG-52244 Change-Id: I8e3206728f245f95172c225bf297023fb078fc6d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-231-27/+90
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/access/qhttp2protocolhandler_p.h src/network/kernel/kernel.pri src/network/ssl/qsslkey_qt.cpp src/plugins/platforms/cocoa/qcocoascreen.mm src/plugins/platforms/windows/accessible/iaccessible2.cpp src/plugins/platforms/windows/accessible/iaccessible2.h src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h src/widgets/widgets/qmenu_p.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/other/qaccessibility/tst_qaccessibility.cpp tests/auto/testlib/selftests/expected_cmptest.lightxml tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/testlib/selftests/expected_cmptest.xml Done-with: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I4217cc7d840cbae3e3dd28574741544469c4c6b9
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-091-5/+20
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qwindow.cpp src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/windows/qwindowssystemtrayicon.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp tests/auto/widgets/kernel/qaction/tst_qaction.cpp Change-Id: Ifa515dc0ece7eb1471b00c1214149629a7e6a233
| | * Fix tst_QFile::openDirectory for systems using builtin test dataOliver Wolff2017-11-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | To obtain "proper" directory behavior, we have to check against the extracted "resources" directory instead of its qrc counterpart. Change-Id: I4996ba74419945f78d356ad953a5b826ff663687 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| | * Fix tst_QFile::handle for systems using builtin test dataOliver Wolff2017-11-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | To obtain the file's handle, we need to obtain it from the extracted test data instead of qrc. Change-Id: I89c5c3f3a7da7e36205a439581a6d83efffdc07c Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * Fix tst_QFile::useQFileInAFileHandler for systems using resources for test dataOliver Wolff2017-11-091-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resource files are extracted to m_dataDir in tst_QFile::initTestCase. Instead of trying to access the file from the resource on systems that use qrc for bundling the test data, we have to use the files that were extracted at the beginning of the test. Change-Id: I35453fbdeb27e317d1342ff1cb7bbea9cebea14d Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * qfile tests: Make sure files are writable before deleting themOliver Wolff2017-11-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some platforms (like UWP) files that are copied during qfile auto tests are not writable by default. The cleanup will fail for these files if the permissions are not set accordingly. Change-Id: Id925dcadfc6b505c87f1f55d5ea05e286b60a5a5 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-301-22/+70
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/windows/qwindowswindow.cpp tests/auto/widgets/kernel/qaction/tst_qaction.cpp Change-Id: Ia017a825ed2ca2d53ac586f4ae48df6f65818d40
| | * tst_QFile::largeUncFileSupport(): Use QTRY_VERIFY() to open the fileFriedemann Kleint2017-10-271-5/+31
| | | | | | | | | | | | | | | | | | | | | | | | Open failures due to sharing violations have been observed in Coin. Change-Id: If7fbe01a454b3c343c0b87f73db50c28eae901c3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>