diff options
author | João Abecasis <joao@abecasis.name> | 2009-05-19 12:02:12 (GMT) |
---|---|---|
committer | João Abecasis <joao@abecasis.name> | 2009-05-22 12:33:41 (GMT) |
commit | 3672deb3b35fc0660c58a8ecc741b989dd0bfc8a (patch) | |
tree | d883123f0c560e8b0f7632c55dbba6a5d2742ca8 /tests/auto | |
parent | 3580f5b4d002cca714d443054f8cdd6aefca3287 (diff) | |
download | Qt-3672deb3b35fc0660c58a8ecc741b989dd0bfc8a.zip Qt-3672deb3b35fc0660c58a8ecc741b989dd0bfc8a.tar.gz Qt-3672deb3b35fc0660c58a8ecc741b989dd0bfc8a.tar.bz2 |
Fix auto test
When copying a resource file to the native file system the (read-only)
permissions also get copied. On Windows platforms, this was preventing a
test file from being deleted.
Reviewed-by: Peter Hartmann
Reviewed-by: Thiago
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qfile/tst_qfile.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/auto/qfile/tst_qfile.cpp b/tests/auto/qfile/tst_qfile.cpp index 7e28d12..9ee4d7c 100644 --- a/tests/auto/qfile/tst_qfile.cpp +++ b/tests/auto/qfile/tst_qfile.cpp @@ -215,7 +215,11 @@ void tst_QFile::cleanup() // This will be executed immediately after each test is run. // for copyFallback() - QFile::remove("file-copy-destination.txt"); + if (QFile::exists("file-copy-destination.txt")) { + QFile::setPermissions("file-copy-destination.txt", + QFile::ReadOwner | QFile::WriteOwner); + QFile::remove("file-copy-destination.txt"); + } // for renameFallback() QFile::remove("file-rename-destination.txt"); @@ -925,6 +929,9 @@ void tst_QFile::copyFallback() QVERIFY(QFile::exists("file-copy-destination.txt")); QVERIFY(!file.isOpen()); + // Need to reset permissions on Windows to be able to delete + QVERIFY(QFile::setPermissions("file-copy-destination.txt", + QFile::ReadOwner | QFile::WriteOwner)); QVERIFY(QFile::remove("file-copy-destination.txt")); // Fallback copy of open file. |