diff options
-rw-r--r-- | tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp b/tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp index 3e876cb848..0b3eb90819 100644 --- a/tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp +++ b/tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp @@ -1404,34 +1404,34 @@ void tst_QFuture::exceptions() } } - -void tst_QFuture::exceptions_QTBUG18149() +class MyClass { - class MyClass +public: + ~MyClass() { - public: - ~MyClass() - { - QFuture<void> f = createExceptionFuture(); - bool caught = false; - try { - f.waitForFinished(); - } catch (Exception &) { - caught = true; - } - QVERIFY(caught); + QFuture<void> f = createExceptionFuture(); + try { + f.waitForFinished(); + } catch (Exception &) { + caught = true; } - }; + } + static bool caught; +}; +bool MyClass::caught = false; + +void tst_QFuture::exceptions_QTBUG18149() +{ try { MyClass m; Q_UNUSED(m); throw 0; } catch (int) {} + QVERIFY(MyClass::caught); } - #endif // QT_NO_EXCEPTIONS QTEST_MAIN(tst_QFuture) |