diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-08-02 09:13:38 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-02 07:37:16 +0200 |
commit | 569cd194d20e61d35768b210b4351f4eeb5c1ef8 (patch) | |
tree | bd19f2c03715aa7bdcf078630179dfc96c3ab614 /tests/auto/qdialog | |
parent | 493634a71190679666082687626c05047b5cd463 (diff) |
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 <qt_sanity_bot@ovi.com>
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
Diffstat (limited to 'tests/auto/qdialog')
-rw-r--r-- | tests/auto/qdialog/qdialog.pro | 3 | ||||
-rw-r--r-- | 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; |