diff options
author | Keith Gardner <kreios4004@gmail.com> | 2014-04-22 21:31:47 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-08 04:22:54 +0200 |
commit | 43f52f93b558cb1c095d445c41c8be3e84ca81c3 (patch) | |
tree | 174459d806369e4bd7854e62b50a750233d318de /tests/auto/corelib/io/qfilesystemwatcher | |
parent | fe70367fe06984d1ac84cc276ca3fd3edc4193c7 (diff) |
Updated corelib's unit tests to use QSignalSpy's functor constructor
The intent is to provide compile time validation of signals and to help
detect signal overloading in the future.
Change-Id: I9d5d46ed4b70c5d0cd407deb5928b1e76d37e007
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'tests/auto/corelib/io/qfilesystemwatcher')
-rw-r--r-- | tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index a58c7dfb4b..271739068a 100644 --- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -138,7 +138,7 @@ void tst_QFileSystemWatcher::basicTest() watcher.setObjectName(QLatin1String("_qt_autotest_force_engine_") + backend); QVERIFY(watcher.addPath(testFile.fileName())); - QSignalSpy changedSpy(&watcher, SIGNAL(fileChanged(QString))); + QSignalSpy changedSpy(&watcher, &QFileSystemWatcher::fileChanged); QVERIFY(changedSpy.isValid()); QEventLoop eventLoop; QTimer timer; @@ -276,7 +276,7 @@ void tst_QFileSystemWatcher::watchDirectory() watcher.setObjectName(QLatin1String("_qt_autotest_force_engine_") + backend); QVERIFY(watcher.addPath(testDir.absolutePath())); - QSignalSpy changedSpy(&watcher, SIGNAL(directoryChanged(QString))); + QSignalSpy changedSpy(&watcher, &QFileSystemWatcher::directoryChanged); QVERIFY(changedSpy.isValid()); QEventLoop eventLoop; QTimer timer; @@ -436,8 +436,8 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory() QVERIFY(watcher.addPath(testDir.absolutePath())); QVERIFY(watcher.addPath(testFileName)); - QSignalSpy fileChangedSpy(&watcher, SIGNAL(fileChanged(QString))); - QSignalSpy dirChangedSpy(&watcher, SIGNAL(directoryChanged(QString))); + QSignalSpy fileChangedSpy(&watcher, &QFileSystemWatcher::fileChanged); + QSignalSpy dirChangedSpy(&watcher, &QFileSystemWatcher::directoryChanged); QVERIFY(fileChangedSpy.isValid()); QVERIFY(dirChangedSpy.isValid()); QEventLoop eventLoop; @@ -596,7 +596,7 @@ void tst_QFileSystemWatcher::QTBUG2331() QVERIFY(watcher.addPath(temporaryDirectory.path())); // watch signal - QSignalSpy changedSpy(&watcher, SIGNAL(directoryChanged(QString))); + QSignalSpy changedSpy(&watcher, &QFileSystemWatcher::directoryChanged); QVERIFY(changedSpy.isValid()); // remove directory, we should get one change signal, and we should no longer @@ -675,7 +675,7 @@ void tst_QFileSystemWatcher::signalsEmittedAfterFileMoved() connect(&watcher, SIGNAL(fileChanged(QString)), &signalReceiver, SLOT(fileChanged(QString))); // watch signals - QSignalSpy changedSpy(&watcher, SIGNAL(fileChanged(QString))); + QSignalSpy changedSpy(&watcher, &QFileSystemWatcher::fileChanged); QVERIFY(changedSpy.isValid()); // move files to second directory |