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>
This commit is contained in:
Friedemann Kleint 2012-07-18 15:58:28 +02:00 committed by Qt by Nokia
parent 91512af3d5
commit dcf12533b7

View File

@ -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()
{