summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormread <qt-info@nokia.com>2011-01-20 15:44:02 (GMT)
committerJoão Abecasis <joao.abecasis@nokia.com>2011-02-10 12:26:48 (GMT)
commit4a7d16cf81c0d66f18b228359dbad983d5057ea9 (patch)
treee91edf54f341c2edff10a4e6f67adfd8d4155df8
parent6cd0dfcecd3efff882d04bb8c6358c706383a3af (diff)
downloadQt-4a7d16cf81c0d66f18b228359dbad983d5057ea9.zip
Qt-4a7d16cf81c0d66f18b228359dbad983d5057ea9.tar.gz
Qt-4a7d16cf81c0d66f18b228359dbad983d5057ea9.tar.bz2
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
-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 cf0406c..53781c9 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()