diff options
| author | Emmanuel Pescosta <[email protected]> | 2014-12-18 14:56:46 +0100 |
|---|---|---|
| committer | Emmanuel Pescosta <[email protected]> | 2014-12-18 14:56:46 +0100 |
| commit | d19d94e60a778d4c19f646224e3b269da515c8fb (patch) | |
| tree | c634267e074b59bfce8e9f4c9ea90bb85c56089b /src/tests/kitemlistkeyboardsearchmanagertest.cpp | |
| parent | 95220eebae1be024b84b069ce9ae4be35c9e6a5f (diff) | |
Ported tests away from KRandomSequence, QTest::kWaitForSignal and KTempDir.
All tests passed!
Diffstat (limited to 'src/tests/kitemlistkeyboardsearchmanagertest.cpp')
| -rw-r--r-- | src/tests/kitemlistkeyboardsearchmanagertest.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/tests/kitemlistkeyboardsearchmanagertest.cpp b/src/tests/kitemlistkeyboardsearchmanagertest.cpp index 373f4f301..41475660d 100644 --- a/src/tests/kitemlistkeyboardsearchmanagertest.cpp +++ b/src/tests/kitemlistkeyboardsearchmanagertest.cpp @@ -17,10 +17,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ -#include <qtest.h> -#include <QSignalSpy> #include "kitemviews/private/kitemlistkeyboardsearchmanager.h" +#include <QTest> +#include <QSignalSpy> + class KItemListKeyboardSearchManagerTest : public QObject { Q_OBJECT @@ -45,7 +46,7 @@ void KItemListKeyboardSearchManagerTest::init() void KItemListKeyboardSearchManagerTest::testBasicKeyboardSearch() { - QSignalSpy spy(&m_keyboardSearchManager, SIGNAL(changeCurrentItem(QString,bool))); + QSignalSpy spy(&m_keyboardSearchManager, &KItemListKeyboardSearchManager::changeCurrentItem); m_keyboardSearchManager.addKeys("f"); QCOMPARE(spy.count(), 1); @@ -70,7 +71,7 @@ void KItemListKeyboardSearchManagerTest::testAbortedKeyboardSearch() // to save time when running this test. m_keyboardSearchManager.setTimeout(100); - QSignalSpy spy(&m_keyboardSearchManager, SIGNAL(changeCurrentItem(QString,bool))); + QSignalSpy spy(&m_keyboardSearchManager, &KItemListKeyboardSearchManager::changeCurrentItem); m_keyboardSearchManager.addKeys("f"); QCOMPARE(spy.count(), 1); @@ -101,7 +102,7 @@ void KItemListKeyboardSearchManagerTest::testRepeatedKeyPress() // 1. the string contains the repeated key only once, and // 2. the bool searchFromNextItem is true. - QSignalSpy spy(&m_keyboardSearchManager, SIGNAL(changeCurrentItem(QString,bool))); + QSignalSpy spy(&m_keyboardSearchManager, &KItemListKeyboardSearchManager::changeCurrentItem); m_keyboardSearchManager.addKeys("p"); QCOMPARE(spy.count(), 1); @@ -128,7 +129,7 @@ void KItemListKeyboardSearchManagerTest::testPressShift() // string. Make sure that this does not reset the current search. See // https://bugs.kde.org/show_bug.cgi?id=321286 - QSignalSpy spy(&m_keyboardSearchManager, SIGNAL(changeCurrentItem(QString,bool))); + QSignalSpy spy(&m_keyboardSearchManager, &KItemListKeyboardSearchManager::changeCurrentItem); // Simulate that the user enters "a_b". m_keyboardSearchManager.addKeys("a"); |
