mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 10:52:49 +00:00
kio: test KDirLister::items()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
3849efb2b0
commit
68e45cdb69
2 changed files with 14 additions and 0 deletions
|
@ -45,4 +45,17 @@ void KDirListerTest::testOpenUrl()
|
||||||
QTest::kWaitForSignal(m_dirLister, SIGNAL(completed()), 5000);
|
QTest::kWaitForSignal(m_dirLister, SIGNAL(completed()), 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void KDirListerTest::testItems()
|
||||||
|
{
|
||||||
|
const QString testfile = QString::fromLatin1("%1/foo.bar").arg(m_tempDir->name());
|
||||||
|
createTestFile(testfile);
|
||||||
|
|
||||||
|
m_dirLister->openUrl(KUrl(m_tempDir->name()));
|
||||||
|
QTest::kWaitForSignal(m_dirLister, SIGNAL(completed()), 5000);
|
||||||
|
const KFileItemList diritems = m_dirLister->items();
|
||||||
|
QVERIFY(!diritems.isEmpty());
|
||||||
|
const KFileItem foobaritem = diritems.findByName("foo.bar");
|
||||||
|
QVERIFY(!foobaritem.isNull());
|
||||||
|
}
|
||||||
|
|
||||||
#include "moc_kdirlistertest.cpp"
|
#include "moc_kdirlistertest.cpp"
|
||||||
|
|
|
@ -30,6 +30,7 @@ private Q_SLOTS:
|
||||||
void cleanupTestCase();
|
void cleanupTestCase();
|
||||||
|
|
||||||
void testOpenUrl();
|
void testOpenUrl();
|
||||||
|
void testItems();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
KTempDir* m_tempDir;
|
KTempDir* m_tempDir;
|
||||||
|
|
Loading…
Add table
Reference in a new issue