From d19d94e60a778d4c19f646224e3b269da515c8fb Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Thu, 18 Dec 2014 14:56:46 +0100 Subject: Ported tests away from KRandomSequence, QTest::kWaitForSignal and KTempDir. All tests passed! --- src/tests/kitemlistcontrollertest.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'src/tests/kitemlistcontrollertest.cpp') diff --git a/src/tests/kitemlistcontrollertest.cpp b/src/tests/kitemlistcontrollertest.cpp index 42c0a8ed2..cd4d0a681 100644 --- a/src/tests/kitemlistcontrollertest.cpp +++ b/src/tests/kitemlistcontrollertest.cpp @@ -17,10 +17,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ -#include -#include -#include - #include "kitemviews/kitemlistcontainer.h" #include "kitemviews/kfileitemlistview.h" #include "kitemviews/kfileitemmodel.h" @@ -32,13 +28,10 @@ #include #include +#include #include #include -namespace { - const int DefaultTimeout = 2000; -}; - Q_DECLARE_METATYPE(KFileItemListView::ItemLayout); Q_DECLARE_METATYPE(Qt::Orientation); Q_DECLARE_METATYPE(KItemListController::SelectionBehavior); @@ -104,7 +97,7 @@ void KItemListControllerTest::initTestCase() m_testDir->createFiles(files); m_model->loadDirectory(m_testDir->url()); QSignalSpy spyDirectoryLoadingCompleted(m_model, SIGNAL(directoryLoadingCompleted())); - QVERIFY(spyDirectoryLoadingCompleted.wait(DefaultTimeout)); + QVERIFY(spyDirectoryLoadingCompleted.wait()); m_container->show(); QTest::qWaitForWindowShown(m_container); @@ -567,7 +560,7 @@ void KItemListControllerTest::testMouseClickActivation() if (!KGlobalSettings::singleClick()) { // TODO: Try to find a way to make sure that changing the global setting works. - QSKIP("Failed to change the KGlobalSettings::singleClick() setting!", SkipSingle); + QSKIP("Failed to change the KGlobalSettings::singleClick() setting!"); } m_view->event(&mousePressEvent); @@ -588,7 +581,7 @@ void KItemListControllerTest::testMouseClickActivation() if (KGlobalSettings::singleClick()) { // TODO: Try to find a way to make sure that changing the global setting works. - QSKIP("Failed to change the KGlobalSettings::singleClick() setting!", SkipSingle); + QSKIP("Failed to change the KGlobalSettings::singleClick() setting!"); } m_view->event(&mousePressEvent); @@ -623,7 +616,7 @@ void KItemListControllerTest::testMouseClickActivation() if (!KGlobalSettings::singleClick()) { // TODO: Try to find a way to make sure that changing the global setting works. - QSKIP("Failed to change the KGlobalSettings::singleClick() setting!", SkipSingle); + QSKIP("Failed to change the KGlobalSettings::singleClick() setting!"); } m_view->event(&mousePressEvent); @@ -652,7 +645,7 @@ void KItemListControllerTest::testMouseClickActivation() if (KGlobalSettings::singleClick() != restoreKGlobalSettingsSingleClick) { // TODO: Try to find a way to make sure that changing the global setting works. - QSKIP("Failed to change the KGlobalSettings::singleClick() setting!", SkipSingle); + QSKIP("Failed to change the KGlobalSettings::singleClick() setting!"); } } -- cgit v1.3