diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-08-02 12:05:21 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-18 08:05:38 +0200 |
commit | 06657ea84bdee3293fa9110653100121fedf7e5f (patch) | |
tree | 6b0d772ec406ef4c9ab2668a81f237370cc4b453 /tests | |
parent | 66fbd24849cf89782b4679e6376fd5429370d05a (diff) |
test: fixed tst_qeventloop and removed CONFIG+=insignificant_test
Throwing C++ exceptions through the event loop doesn't work if the Glib
event loop is used, so conditionally skip that part of the test.
Change-Id: Ic27ebf4eb75bd1cf7c7e35f371f29bcfc0e1844a
Reviewed-on: http://codereview.qt.nokia.com/2471
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qeventloop/qeventloop.pro | 2 | ||||
-rw-r--r-- | tests/auto/qeventloop/tst_qeventloop.cpp | 25 |
2 files changed, 23 insertions, 4 deletions
diff --git a/tests/auto/qeventloop/qeventloop.pro b/tests/auto/qeventloop/qeventloop.pro index 153cdbafe7..e3c170a33b 100644 --- a/tests/auto/qeventloop/qeventloop.pro +++ b/tests/auto/qeventloop/qeventloop.pro @@ -6,5 +6,3 @@ QT += network win32:!wince*:LIBS += -luser32 symbian:TARGET.CAPABILITY += NetworkServices - -CONFIG+=insignificant_test diff --git a/tests/auto/qeventloop/tst_qeventloop.cpp b/tests/auto/qeventloop/tst_qeventloop.cpp index 828366ba49..a702908549 100644 --- a/tests/auto/qeventloop/tst_qeventloop.cpp +++ b/tests/auto/qeventloop/tst_qeventloop.cpp @@ -203,6 +203,7 @@ private slots: void symbianNestedActiveSchedulerLoop(); void processEvents(); void exec(); + void throwInExec(); void reexec(); void exit(); void execAfterExit(); @@ -445,14 +446,35 @@ void tst_QEventLoop::exec() QCOMPARE(returnCode, 0); QCOMPARE(executor.returnCode, -1); } +} -#if !defined(QT_NO_EXCEPTIONS) && !defined(Q_OS_WINCE_WM) && !defined(Q_OS_SYMBIAN) && !defined(NO_EVENTLOOP_EXCEPTIONS) +void tst_QEventLoop::throwInExec() +{ +#if defined(QT_NO_EXCEPTIONS) || defined(NO_EVENTLOOP_EXCEPTIONS) + QSKIP("Exceptions are disabled", SkipAll); +#elif defined(Q_OS_WINCE_WM) || defined(Q_OS_SYMBIAN) // Windows Mobile cannot handle cross library exceptions // qobject.cpp will try to rethrow the exception after handling // which causes gwes.exe to crash // Symbian doesn't propagate exceptions from eventloop, but converts them to // CActiveScheduler errors instead -> this test will hang. + QSKIP("This platform doesn't support propagating exceptions through the event loop", SkipAll); +#elif 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 + { // QEventLoop::exec() is exception safe QEventLoop eventLoop; @@ -474,7 +496,6 @@ void tst_QEventLoop::exec() } QCOMPARE(caughtExceptions, 2); } -#endif } void tst_QEventLoop::reexec() |