diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2010-12-02 12:13:07 (GMT) |
---|---|---|
committer | João Abecasis <joao.abecasis@nokia.com> | 2010-12-02 12:13:07 (GMT) |
commit | 655bae506d4d2743ed016c78a767afa2150057a9 (patch) | |
tree | 9ccc2b4a56792616a2c48045faa9bd7081126167 /tests/auto/qfilesystemwatcher | |
parent | 16252a59afa58b0cb4b0ffb02a330dcf002c9750 (diff) | |
parent | f6f8ba94d5f82b8df723a217a3d0ecb50e570cbc (diff) | |
download | Qt-655bae506d4d2743ed016c78a767afa2150057a9.zip Qt-655bae506d4d2743ed016c78a767afa2150057a9.tar.gz Qt-655bae506d4d2743ed016c78a767afa2150057a9.tar.bz2 |
Merge remote branch 'origin/master' into file-engine-refactor
master's version of conflicting def files picked.
Conflicts:
src/s60installs/bwins/QtCoreu.def
src/s60installs/bwins/QtGuiu.def
src/s60installs/bwins/QtNetworku.def
src/s60installs/eabi/QtCoreu.def
src/s60installs/eabi/QtGuiu.def
Diffstat (limited to 'tests/auto/qfilesystemwatcher')
-rw-r--r-- | tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index a26e34d..648b7e9 100644 --- a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -82,6 +82,8 @@ private slots: void removeFileAndUnWatch(); void cleanup(); + + void QTBUG15255_deadlock(); private: QStringList do_force_engines; bool do_force_native; @@ -135,14 +137,11 @@ void tst_QFileSystemWatcher::basicTest() // create watcher, forcing it to use a specific backend QFileSystemWatcher watcher; watcher.setObjectName(QLatin1String("_qt_autotest_force_engine_") + backend); + watcher.removePath(testFile.fileName()); watcher.addPath(testFile.fileName()); QSignalSpy changedSpy(&watcher, SIGNAL(fileChanged(const QString &))); QEventLoop eventLoop; - connect(&watcher, - SIGNAL(fileChanged(const QString &)), - &eventLoop, - SLOT(quit())); QTimer timer; connect(&timer, SIGNAL(timeout()), &eventLoop, SLOT(quit())); @@ -278,10 +277,6 @@ void tst_QFileSystemWatcher::watchDirectory() QSignalSpy changedSpy(&watcher, SIGNAL(directoryChanged(const QString &))); QEventLoop eventLoop; - connect(&watcher, - SIGNAL(directoryChanged(const QString &)), - &eventLoop, - SLOT(quit())); QTimer timer; connect(&timer, SIGNAL(timeout()), &eventLoop, SLOT(quit())); @@ -557,5 +552,23 @@ void tst_QFileSystemWatcher::removeFileAndUnWatch() watcher.addPath(filename); } +class SomeSingleton : public QObject +{ +public: + SomeSingleton() : mFsWatcher(new QFileSystemWatcher(this)) { mFsWatcher->addPath(QLatin1String("/usr/lib"));} + void bla() const {} + QFileSystemWatcher* mFsWatcher; +}; + +Q_GLOBAL_STATIC(SomeSingleton, someSingleton) + +void tst_QFileSystemWatcher::QTBUG15255_deadlock() +{ + someSingleton()->bla(); + //the test must still finish + QTest::qWait(30); +} + + QTEST_MAIN(tst_QFileSystemWatcher) #include "tst_qfilesystemwatcher.moc" |