summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/dialogs/qfilesystemmodel
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-10-24 12:48:39 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-10-24 12:48:42 +0200
commit840f6a40e6218992b5b9d451ee3c0886a4846c89 (patch)
tree2b808decc7adf5218b810d2de6b45c5a8b4cfc42 /tests/auto/widgets/dialogs/qfilesystemmodel
parent109bf980b37fed405c6c1eb14cb9c83ff897e389 (diff)
parent2e3870fe37d36ccf4bd84eb90e1d5e08ad00c1bc (diff)
Merge remote-tracking branch 'origin/stable' into dev
Diffstat (limited to 'tests/auto/widgets/dialogs/qfilesystemmodel')
-rw-r--r--tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
index e24a1dfc96..816d375b97 100644
--- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
+++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
@@ -115,6 +115,7 @@ private slots:
void sort();
void mkdir();
+ void deleteFile();
void caseSensitivity();
@@ -934,6 +935,25 @@ void tst_QFileSystemModel::mkdir()
QCOMPARE(oldRow, idx.row());
}
+void tst_QFileSystemModel::deleteFile()
+{
+ QString newFilePath = QDir::temp().filePath("NewFileDeleteTest");
+ QFile newFile(newFilePath);
+ if (newFile.exists()) {
+ if (!newFile.remove())
+ qWarning() << "unable to remove" << newFilePath;
+ QTest::qWait(WAITTIME);
+ }
+ if (!newFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ qWarning() << "unable to create" << newFilePath;
+ }
+ newFile.close();
+ QModelIndex idx = model->index(newFilePath);
+ QVERIFY(idx.isValid());
+ QVERIFY(model->remove(idx));
+ QVERIFY(!newFile.exists());
+}
+
void tst_QFileSystemModel::caseSensitivity()
{
QString tmp = flatDirTestPath;