From 569cd194d20e61d35768b210b4351f4eeb5c1ef8 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Tue, 2 Aug 2011 09:13:38 +1000 Subject: test: fixed crash of tst_qdialog and removed CONFIG+=insignificant_test This test assumed that C++ exceptions could always be caught by the event loop. This is not the case when the Glib event loop is used. Skip the relevant portion of the test in that case. Change-Id: I6a6325c3590c810a5aba28ec98279581dcfaf55c Reviewed-on: http://codereview.qt.nokia.com/2455 Reviewed-by: Qt Sanity Bot Reviewed-by: Kalle Lehtonen --- tests/auto/qdialog/qdialog.pro | 3 --- tests/auto/qdialog/tst_qdialog.cpp | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/auto/qdialog/qdialog.pro b/tests/auto/qdialog/qdialog.pro index ab7bfd9022..161a6b47f1 100644 --- a/tests/auto/qdialog/qdialog.pro +++ b/tests/auto/qdialog/qdialog.pro @@ -1,5 +1,2 @@ load(qttest_p4) SOURCES += tst_qdialog.cpp - - -CONFIG+=insignificant_test diff --git a/tests/auto/qdialog/tst_qdialog.cpp b/tests/auto/qdialog/tst_qdialog.cpp index 6d9f7988cd..86dde21ba0 100644 --- a/tests/auto/qdialog/tst_qdialog.cpp +++ b/tests/auto/qdialog/tst_qdialog.cpp @@ -467,6 +467,22 @@ void tst_QDialog::throwInExec() #if defined(Q_WS_MAC) || (defined(Q_WS_WINCE) && defined(_ARM_)) QSKIP("Throwing exceptions in exec() is not supported on this platform.", SkipAll); #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))), + SkipAll + ); + } +#endif + int caughtExceptions = 0; try { ExceptionDialog dialog; -- cgit v1.2.3