summaryrefslogtreecommitdiffstats
path: root/tests/auto/qfilesystemmodel
diff options
context:
space:
mode:
authormread <qt-info@nokia.com>2011-01-20 15:44:02 +0000
committerJoão Abecasis <joao.abecasis@nokia.com>2011-02-10 13:26:48 +0100
commit4a7d16cf81c0d66f18b228359dbad983d5057ea9 (patch)
treee91edf54f341c2edff10a4e6f67adfd8d4155df8 /tests/auto/qfilesystemmodel
parent6cd0dfcecd3efff882d04bb8c6358c706383a3af (diff)
Fixed qfilesystemmodel autotest
The qfilesystemmodel autotest was failing on Symbian devices where there were bad drives. These do not appear in the file system model root list, but do appear in QDir::drives, giving different results. The test now filters the bad drives out of the drives list before comparing the counts. Task-number: QTBUG-15015 Reviewed-by: Shane Kearns
Diffstat (limited to 'tests/auto/qfilesystemmodel')
-rw-r--r--tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
index cf0406cdc8..53781c9f0f 100644
--- a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
+++ b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
@@ -980,8 +980,12 @@ void tst_QFileSystemModel::drives()
model.setRootPath(path);
model.fetchMore(QModelIndex());
QFileInfoList drives = QDir::drives();
+ int driveCount = 0;
+ foreach(const QFileInfo& driveRoot, drives)
+ if (driveRoot.exists())
+ driveCount++;
QTest::qWait(5000);
- QTRY_COMPARE(model.rowCount(), drives.count());
+ QTRY_COMPARE(model.rowCount(), driveCount);
}
void tst_QFileSystemModel::dirsBeforeFiles()