summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-07-18 15:58:28 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-19 12:58:12 +0200
commitdcf12533b73235e1096a3f9f9d5fcf6c42622341 (patch)
tree11243eff21f10ab0994150cabcb17bb7a4a34b9f /tests
parent91512af3d51955a9ce4bc4cd864f28bd837de172 (diff)
Remove the test tst_qdialog::throwInExec().
QtWidgets and QtGui are currently compiled without exceptions, which causes a crash with gcc 4.6.3. Change-Id: I8f872f3bec6266444adf08d51a6678150c5fae8e Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp54
1 files changed, 0 insertions, 54 deletions
diff --git a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
index 574041cd44..c23ccc8618 100644
--- a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
+++ b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
@@ -76,7 +76,6 @@ private slots:
void toolDialogPosition();
void deleteMainDefault();
void deleteInExec();
- void throwInExec();
void showSizeGrip();
void setVisible();
void reject();
@@ -423,59 +422,6 @@ void tst_QDialog::deleteInExec()
QCOMPARE(dialog->exec(), int(QDialog::Rejected));
}
-#ifndef QT_NO_EXCEPTIONS
-class QDialogTestException : public std::exception { };
-
-class ExceptionDialog : public QDialog
-{
- Q_OBJECT
-public:
- ExceptionDialog() : QDialog(0) { }
-public slots:
- void throwException()
- {
- QDialogTestException e;
- throw e;
- }
-};
-
-void tst_QDialog::throwInExec()
-{
-#if defined(Q_OS_MAC) || (defined(Q_OS_WINCE) && defined(_ARM_))
- QSKIP("Throwing exceptions in exec() is not supported on this platform.");
-#endif
-#if defined(Q_OS_LINUX)
- // C++ exceptions can't be passed through glib callbacks. Skip the test if
- // we're using the glib event loop.
- QByteArray dispatcher = QAbstractEventDispatcher::instance()->metaObject()->className();
- if (dispatcher.contains("Glib")) {
- QSKIP(
- qPrintable(QString(
- "Throwing exceptions in exec() won't work if %1 event dispatcher is used.\n"
- "Try running with QT_NO_GLIB=1 in environment."
- ).arg(QString::fromLatin1(dispatcher)))
- );
- }
-#endif
-
- int caughtExceptions = 0;
- try {
- ExceptionDialog dialog;
- QMetaObject::invokeMethod(&dialog, "throwException", Qt::QueuedConnection);
- QMetaObject::invokeMethod(&dialog, "reject", Qt::QueuedConnection);
- (void) dialog.exec();
- } catch(...) {
- ++caughtExceptions;
- }
- QCOMPARE(caughtExceptions, 1);
-}
-#else
-void tst_QDialog::throwInExec()
-{
- QSKIP("Exceptions are disabled");
-}
-#endif //QT_NO_EXCEPTIONS
-
// From Task 124269
void tst_QDialog::showSizeGrip()
{