summaryrefslogtreecommitdiffstats
path: root/tests/auto/qfiledialog
diff options
context:
space:
mode:
authorRobert Griebl <rgriebl@trolltech.com>2009-06-10 11:46:23 (GMT)
committerRobert Griebl <rgriebl@trolltech.com>2009-06-10 11:46:23 (GMT)
commit7604f8087f88171ef933d8ae08f501467e647338 (patch)
tree51d071f462ed48d0b25884d9f62b8ba11c5dff13 /tests/auto/qfiledialog
parent8c265860b41214daade7c8a28237c1e07ea71a3c (diff)
downloadQt-7604f8087f88171ef933d8ae08f501467e647338.zip
Qt-7604f8087f88171ef933d8ae08f501467e647338.tar.gz
Qt-7604f8087f88171ef933d8ae08f501467e647338.tar.bz2
Make Qt exception safer.
Squashed commit of the branch haralds-haralds-qt-s60-topics/topic/exceptions, which also contains the full history. Rev-By: Harald Fernengel Rev-By: Ralf Engels
Diffstat (limited to 'tests/auto/qfiledialog')
-rw-r--r--tests/auto/qfiledialog/tst_qfiledialog.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp
index b4fd0c5..5f0776f 100644
--- a/tests/auto/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp
@@ -465,10 +465,11 @@ void tst_QFiledialog::completer()
if (!tmp.exists(tempPath))
QVERIFY(tmp.mkdir("QFileDialogTestDir"));
QList<QTemporaryFile*> files;
+ QT_TRY {
for (int i = 0; i < 10; ++i) {
- QTemporaryFile *file = new QTemporaryFile(tempPath + "/rXXXXXX");
+ QScopedPointer<QTemporaryFile> file(new QTemporaryFile(tempPath + "/rXXXXXX"));
file->open();
- files.append(file);
+ files.append(file.take());
}
// ### flesh this out more
@@ -559,6 +560,10 @@ void tst_QFiledialog::completer()
// ### FIXME: This will fail on Symbian on some tests and some environments until the file engine and QFileSystemModel
// are fixed to properly capitalize paths, so that some folders are not duplicated in QFileSystemModel.
QTRY_COMPARE(cModel->rowCount(), expected);
+ } QT_CATCH(...) {
+ qDeleteAll(files);
+ QT_RETHROW;
+ }
qDeleteAll(files);
}