summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2011-08-10 10:06:10 (GMT)
committerSergio Ahumada <sergio.ahumada@nokia.com>2011-08-11 08:02:06 (GMT)
commitc8afa6feb8f87ae733bbb3237b1d2e84ab47b4de (patch)
tree6d880cf8ac00bab4d67a9433b0538dc974fcfa91 /tests
parent16502c81a92cc4a0c4d8753372b568cdc61f0c53 (diff)
downloadQt-c8afa6feb8f87ae733bbb3237b1d2e84ab47b4de.zip
Qt-c8afa6feb8f87ae733bbb3237b1d2e84ab47b4de.tar.gz
Qt-c8afa6feb8f87ae733bbb3237b1d2e84ab47b4de.tar.bz2
tests: fixed crash of tst_qdialog
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: I2ad83386025a98f6c32202700c97e04ef3dff343 Reviewed-by: Kalle Lehtonen Reviewed-by: Sergio Ahumada (cherry picked from commit 569cd194d20e61d35768b210b4351f4eeb5c1ef8)
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qdialog/tst_qdialog.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qdialog/tst_qdialog.cpp b/tests/auto/qdialog/tst_qdialog.cpp
index 6d9f798..86dde21 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;