From abffc7407130fe791c83673c6648e23f73e2c9e8 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Wed, 21 Apr 2010 12:02:26 +0200 Subject: 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 --- tests/auto/qdialog/tst_qdialog.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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() -- cgit v0.12