summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-03-25 18:24:35 (GMT)
committerQt Commercial Integration <QtCommercial@digia.com>2012-01-31 10:24:41 (GMT)
commit3038b29a9bfe2ee9fc1b72fa2c0dc0a6bece753b (patch)
treefc027d343695e8a2d896479220241ece9a288c9d /tests
parentcbce03887f8e4025fc65abb49e263bcbad8e3573 (diff)
downloadQt-3038b29a9bfe2ee9fc1b72fa2c0dc0a6bece753b.zip
Qt-3038b29a9bfe2ee9fc1b72fa2c0dc0a6bece753b.tar.gz
Qt-3038b29a9bfe2ee9fc1b72fa2c0dc0a6bece753b.tar.bz2
QtConcurrent: throw exception from destructor
Task-number: QTBUG-18149 Reviewed-by: Morten Sorvig
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qfuture/tst_qfuture.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/qfuture/tst_qfuture.cpp b/tests/auto/qfuture/tst_qfuture.cpp
index d78dc19..2fa329b 100644
--- a/tests/auto/qfuture/tst_qfuture.cpp
+++ b/tests/auto/qfuture/tst_qfuture.cpp
@@ -81,6 +81,7 @@ private slots:
void voidConversions();
#ifndef QT_NO_EXCEPTIONS
void exceptions();
+ void exceptions_QTBUG18149();
#endif
};
@@ -1431,6 +1432,33 @@ void tst_QFuture::exceptions()
}
+
+void tst_QFuture::exceptions_QTBUG18149()
+{
+ class MyClass
+ {
+ public:
+ ~MyClass()
+ {
+ QFuture<void> f = createExceptionFuture();
+ bool caught = false;
+ try {
+ f.waitForFinished();
+ } catch (Exception &) {
+ caught = true;
+ }
+ QVERIFY(caught);
+ }
+ };
+
+ try {
+ MyClass m;
+ throw 0;
+ } catch (int) {}
+
+}
+
+
#endif // QT_NO_EXCEPTIONS
#include "tst_qfuture.moc"