summaryrefslogtreecommitdiffstats
path: root/tests/auto/qfilesystemwatcher
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-03-22 13:14:10 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-03-22 13:16:01 (GMT)
commit6d1baf9979346d6f15da81a535becb4046278962 (patch)
tree634325ee7d0952c49c97f985527de1b312d472c7 /tests/auto/qfilesystemwatcher
parent05639b335af810f8359e87213909e0ec16300635 (diff)
downloadQt-6d1baf9979346d6f15da81a535becb4046278962.zip
Qt-6d1baf9979346d6f15da81a535becb4046278962.tar.gz
Qt-6d1baf9979346d6f15da81a535becb4046278962.tar.bz2
Do not use FSEvents-based filesystemwatcher backend on Mac.
Removing the usage of FSEvents-based backend for now as it has a few bugs that cannot be fixed right away. We will rewise it later and fallback to kqueue-based backend for the moment. Also added a test case that triggers a bug in the FSEvents file system watcher. Reviewed-by: trustme
Diffstat (limited to 'tests/auto/qfilesystemwatcher')
-rw-r--r--tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
index 7138905..a26e34d 100644
--- a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
+++ b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
@@ -79,6 +79,8 @@ private slots:
void nonExistingFile();
+ void removeFileAndUnWatch();
+
void cleanup();
private:
QStringList do_force_engines;
@@ -532,5 +534,28 @@ void tst_QFileSystemWatcher::nonExistingFile()
QVERIFY(true);
}
+void tst_QFileSystemWatcher::removeFileAndUnWatch()
+{
+ static const char * const filename = "foo.txt";
+ QFileSystemWatcher watcher;
+
+ {
+ QFile testFile(filename);
+ testFile.open(QIODevice::WriteOnly);
+ testFile.close();
+ }
+ watcher.addPath(filename);
+
+ QFile::remove(filename);
+ watcher.removePath(filename);
+
+ {
+ QFile testFile(filename);
+ testFile.open(QIODevice::WriteOnly);
+ testFile.close();
+ }
+ watcher.addPath(filename);
+}
+
QTEST_MAIN(tst_QFileSystemWatcher)
#include "tst_qfilesystemwatcher.moc"