diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-07-06 12:38:31 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-07-07 07:02:45 +0000 |
commit | e1d7f7dfbc0191f585fde8695d315e3ffb98ccc5 (patch) | |
tree | 5bba7abf1240bb358f6c2116d9960f9478d4df26 /tests/auto | |
parent | 7beb2bc02bff9fa591eb60b978ed97d0601bedfd (diff) |
QFileSystemWatcher/Windows: Recreate handle for files
QWindowsFileSystemWatcherEngine uses one change notification
per directory to watch directories or files within that
directory. Adding files and their directories in a sequence
caused the value in QWindowsFileSystemWatcherEngineThread::HandleForDirHash
to be overwritten.
Relax the check for the flags (watcher attributes) to use >= and recreate
the change notification of a directory should its flags be insufficient.
This triggers when a file is added after its directory since files
require more attributes.
Task-number: QTBUG-61792
Change-Id: I371a72f1934fa82c53aaf84beb907825031f1c81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index 0ee7599b2c..154c7ec5bf 100644 --- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -568,6 +568,10 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory() QCOMPARE(fileChangedSpy.count(), 0); QCOMPARE(dirChangedSpy.count(), 1); + // QTBUG-61792, removal should succeed (bug on Windows which uses one change + // notification per directory). + QVERIFY(watcher.removePath(testDir.absolutePath())); + QVERIFY(temporaryDir.rmdir(testDirName)); } |