mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-21 09:20:13 +00:00
Port test to qt5
This commit is contained in:
parent
01e4f60a09
commit
938a83b8b1
|
@ -17,7 +17,7 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qtest_kde.h>
|
||||
#include <qtest.h>
|
||||
|
||||
#include "search/dolphinsearchbox.h"
|
||||
#include <qtestkeyboard.h>
|
||||
|
@ -65,6 +65,6 @@ void DolphinSearchBoxTest::testTextClearing()
|
|||
QVERIFY(m_searchBox->text().isEmpty());
|
||||
}
|
||||
|
||||
QTEST_KDEMAIN(DolphinSearchBoxTest, GUI)
|
||||
QTEST_MAIN(DolphinSearchBoxTest)
|
||||
|
||||
#include "dolphinsearchboxtest.moc"
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qtest_kde.h>
|
||||
|
||||
#include <qtest.h>
|
||||
#include <QSignalSpy>
|
||||
#include "kitemviews/kfileitemlistview.h"
|
||||
#include "kitemviews/kfileitemmodel.h"
|
||||
#include "kitemviews/private/kfileitemmodeldirlister.h"
|
||||
|
@ -96,22 +96,25 @@ void KFileItemListViewTest::testGroupedItemChanges()
|
|||
m_testDir->createFiles(QStringList() << "1" << "3" << "5");
|
||||
|
||||
m_model->loadDirectory(m_testDir->url());
|
||||
QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(itemsInserted(KItemRangeList)), DefaultTimeout));
|
||||
QSignalSpy psy(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QVERIFY(psy.wait(DefaultTimeout));
|
||||
QCOMPARE(m_model->count(), 3);
|
||||
|
||||
m_testDir->createFiles(QStringList() << "2" << "4");
|
||||
m_model->m_dirLister->updateDirectory(m_testDir->url());
|
||||
QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(itemsInserted(KItemRangeList)), DefaultTimeout));
|
||||
QSignalSpy psyItemsInserted(m_model, SIGNAL(itemsInserted(KItemRangeList)));
|
||||
QVERIFY(psyItemsInserted.wait(DefaultTimeout));
|
||||
QCOMPARE(m_model->count(), 5);
|
||||
|
||||
m_testDir->removeFile("1");
|
||||
m_testDir->removeFile("3");
|
||||
m_testDir->removeFile("5");
|
||||
m_model->m_dirLister->updateDirectory(m_testDir->url());
|
||||
QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(itemsRemoved(KItemRangeList)), DefaultTimeout));
|
||||
QSignalSpy psyItemsRemoved(m_model, SIGNAL(itemsRemoved(KItemRangeList)));
|
||||
QVERIFY(psyItemsRemoved.wait(DefaultTimeout));
|
||||
QCOMPARE(m_model->count(), 2);
|
||||
}
|
||||
|
||||
QTEST_KDEMAIN(KFileItemListViewTest, GUI)
|
||||
QTEST_MAIN(KFileItemListViewTest)
|
||||
|
||||
#include "kfileitemlistviewtest.moc"
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qtest_kde.h>
|
||||
|
||||
#include <qtest.h>
|
||||
#include <QSignalSpy>
|
||||
#include "kitemviews/kfileitemmodel.h"
|
||||
#include "kitemviews/private/kfileitemmodelsortalgorithm.h"
|
||||
|
||||
|
@ -329,6 +329,6 @@ KFileItemList KFileItemModelBenchmark::createFileItemList(const QStringList& fil
|
|||
return result;
|
||||
}
|
||||
|
||||
QTEST_KDEMAIN(KFileItemModelBenchmark, NoGUI)
|
||||
QTEST_MAIN(KFileItemModelBenchmark)
|
||||
|
||||
#include "kfileitemmodelbenchmark.moc"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qtest_kde.h>
|
||||
#include <qtest.h>
|
||||
#include <qtestmouse.h>
|
||||
#include <qtestkeyboard.h>
|
||||
|
||||
|
@ -33,6 +33,7 @@
|
|||
#include <KGlobalSettings>
|
||||
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QSignalSpy>
|
||||
|
||||
namespace {
|
||||
const int DefaultTimeout = 2000;
|
||||
|
@ -102,7 +103,8 @@ void KItemListControllerTest::initTestCase()
|
|||
|
||||
m_testDir->createFiles(files);
|
||||
m_model->loadDirectory(m_testDir->url());
|
||||
QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(directoryLoadingCompleted()), DefaultTimeout));
|
||||
QSignalSpy spyDirectoryLoadingCompleted(m_model, SIGNAL(directoryLoadingCompleted()));
|
||||
QVERIFY(spyDirectoryLoadingCompleted.wait(DefaultTimeout));
|
||||
|
||||
m_container->show();
|
||||
QTest::qWaitForWindowShown(m_container);
|
||||
|
@ -670,6 +672,6 @@ void KItemListControllerTest::adjustGeometryForColumnCount(int count)
|
|||
}
|
||||
}
|
||||
|
||||
QTEST_KDEMAIN(KItemListControllerTest, GUI)
|
||||
QTEST_MAIN(KItemListControllerTest)
|
||||
|
||||
#include "kitemlistcontrollertest.moc"
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qtest_kde.h>
|
||||
|
||||
#include <qtest.h>
|
||||
#include <QSignalSpy>
|
||||
#include "kitemviews/private/kitemlistkeyboardsearchmanager.h"
|
||||
|
||||
class KItemListKeyboardSearchManagerTest : public QObject
|
||||
|
@ -147,6 +147,6 @@ void KItemListKeyboardSearchManagerTest::testPressShift()
|
|||
QCOMPARE(spy.takeFirst(), QList<QVariant>() << "a_b" << false);
|
||||
}
|
||||
|
||||
QTEST_KDEMAIN(KItemListKeyboardSearchManagerTest, NoGUI)
|
||||
QTEST_MAIN(KItemListKeyboardSearchManagerTest)
|
||||
|
||||
#include "kitemlistkeyboardsearchmanagertest.moc"
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qtest_kde.h>
|
||||
|
||||
#include <qtest.h>
|
||||
#include <QSignalSpy>
|
||||
#include "kitemviews/kitemmodelbase.h"
|
||||
#include "kitemviews/kitemlistselectionmanager.h"
|
||||
|
||||
|
@ -571,6 +571,6 @@ void KItemListSelectionManagerTest::verifySelectionChange(QSignalSpy& spy,
|
|||
}
|
||||
}
|
||||
|
||||
QTEST_KDEMAIN(KItemListSelectionManagerTest, NoGUI)
|
||||
QTEST_MAIN(KItemListSelectionManagerTest)
|
||||
|
||||
#include "kitemlistselectionmanagertest.moc"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qtest_kde.h>
|
||||
#include <qtest.h>
|
||||
|
||||
#include "kitemviews/kitemrange.h"
|
||||
|
||||
|
@ -70,6 +70,6 @@ void KItemRangeTest::testFromSortedContainer()
|
|||
QCOMPARE(expected, result);
|
||||
}
|
||||
|
||||
QTEST_KDEMAIN(KItemRangeTest, NoGUI)
|
||||
QTEST_MAIN(KItemRangeTest)
|
||||
|
||||
#include "kitemrangetest.moc"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qtest_kde.h>
|
||||
#include <qtest.h>
|
||||
|
||||
#include "kitemviews/kitemset.h"
|
||||
|
||||
|
@ -607,6 +607,6 @@ void KItemSetTest::testSymmetricDifference()
|
|||
}
|
||||
|
||||
|
||||
QTEST_KDEMAIN(KItemSetTest, NoGUI)
|
||||
QTEST_MAIN(KItemSetTest)
|
||||
|
||||
#include "kitemsettest.moc"
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qtest_kde.h>
|
||||
#include <qtest.h>
|
||||
|
||||
#include "kitemviews/kstandarditem.h"
|
||||
#include "kitemviews/kstandarditemmodel.h"
|
||||
|
@ -112,6 +112,6 @@ bool KStandardItemModelTest::isModelConsistent() const
|
|||
return true;
|
||||
}
|
||||
|
||||
QTEST_KDEMAIN(KStandardItemModelTest, NoGUI)
|
||||
QTEST_MAIN(KStandardItemModelTest)
|
||||
|
||||
#include "kstandarditemmodeltest.moc"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qtest_kde.h>
|
||||
#include <qtest.h>
|
||||
|
||||
#include "dolphin_generalsettings.h"
|
||||
#include "views/viewproperties.h"
|
||||
|
@ -96,6 +96,6 @@ void ViewPropertiesTest::testAutoSave()
|
|||
QVERIFY(QFile::exists(dotDirectoryFile));
|
||||
}
|
||||
|
||||
QTEST_KDEMAIN(ViewPropertiesTest, NoGUI)
|
||||
QTEST_MAIN(ViewPropertiesTest)
|
||||
|
||||
#include "viewpropertiestest.moc"
|
||||
|
|
Loading…
Reference in a new issue