diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2010-04-21 10:02:26 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2010-04-21 10:33:38 (GMT) |
commit | abffc7407130fe791c83673c6648e23f73e2c9e8 (patch) | |
tree | 79d0b82ab53b17eeba77c1c576b5da13e3c5f838 /tests/auto/qdialog | |
parent | 4de2d16377e820f37325a3f4e219af778042122f (diff) | |
download | Qt-abffc7407130fe791c83673c6648e23f73e2c9e8.zip Qt-abffc7407130fe791c83673c6648e23f73e2c9e8.tar.gz Qt-abffc7407130fe791c83673c6648e23f73e2c9e8.tar.bz2 |
Make tst_qdialog::throwInExec work with symbian exception policy
On Symbian, exceptions are absorbed by the event loop. This behaviour
is inside the user library where we can't modify it.
Only std::exception or leaves are supported, other exceptions will cause
an assert fail in the symbian code. So the test is changed to throw a
std::exception derived class
Reviewed-by: mread
Diffstat (limited to 'tests/auto/qdialog')
-rw-r--r-- | tests/auto/qdialog/tst_qdialog.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/qdialog/tst_qdialog.cpp b/tests/auto/qdialog/tst_qdialog.cpp index 86f87b8..8b6aee6 100644 --- a/tests/auto/qdialog/tst_qdialog.cpp +++ b/tests/auto/qdialog/tst_qdialog.cpp @@ -447,7 +447,7 @@ void tst_QDialog::deleteInExec() } #ifndef QT_NO_EXCEPTIONS -class QDialogTestException { }; +class QDialogTestException : public std::exception { }; class ExceptionDialog : public QDialog { @@ -471,11 +471,17 @@ void tst_QDialog::throwInExec() try { ExceptionDialog dialog; QMetaObject::invokeMethod(&dialog, "throwException", Qt::QueuedConnection); + QMetaObject::invokeMethod(&dialog, "reject", Qt::QueuedConnection); (void) dialog.exec(); } catch(...) { ++caughtExceptions; } +#ifdef Q_OS_SYMBIAN + //on symbian, the event loop absorbs exceptions + QCOMPARE(caughtExceptions, 0); +#else QCOMPARE(caughtExceptions, 1); +#endif } #else void tst_QDialog::throwInExec() |