diff options
Diffstat (limited to 'tests/auto/qobjectrace/tst_qobjectrace.cpp')
-rw-r--r-- | tests/auto/qobjectrace/tst_qobjectrace.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/tests/auto/qobjectrace/tst_qobjectrace.cpp b/tests/auto/qobjectrace/tst_qobjectrace.cpp index 98c7a30..b3052e0 100644 --- a/tests/auto/qobjectrace/tst_qobjectrace.cpp +++ b/tests/auto/qobjectrace/tst_qobjectrace.cpp @@ -44,7 +44,10 @@ #include <QtTest/QtTest> -enum { OneMinute = 60 * 1000, TwoMinutes = OneMinute * 2 }; +enum { OneMinute = 60 * 1000, + TwoMinutes = OneMinute * 2, + TenMinutes = OneMinute * 10, + TwentyFiveMinutes = OneMinute * 25 }; class tst_QObjectRace: public QObject { @@ -136,6 +139,11 @@ private slots: void tst_QObjectRace::moveToThreadRace() { +#if defined(Q_OS_SYMBIAN) + // ### FIXME: task 257411 - remove xfail once this is fixed + QEXPECT_FAIL("", "Symbian event dispatcher can't handle this kind of race, see task: 257411", Abort); + QVERIFY(false); +#endif RaceObject *object = new RaceObject; enum { ThreadCount = 10 }; @@ -210,8 +218,24 @@ public: } }; +#if defined(Q_OS_SYMBIAN) +// Symbian needs "a bit" more time +# define EXTRA_THREAD_WAIT TenMinutes +# define MAIN_THREAD_WAIT TwentyFiveMinutes +#else +# define EXTRA_THREAD_WAIT 3000 +# define MAIN_THREAD_WAIT TwoMinutes +#endif + void tst_QObjectRace::destroyRace() { +#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) + // ### FIXME: task 257411 - remove xfail once this is fixed. + // Oddly enough, this seems to work properly in HW, if given enough time and memory. + QEXPECT_FAIL("", "Symbian event dispatcher can't handle this kind of race on emulator, see task: 257411", Abort); + QVERIFY(false); +#endif + enum { ThreadCount = 10, ObjectCountPerThread = 733, ObjectCount = ThreadCount * ObjectCountPerThread }; @@ -244,10 +268,10 @@ void tst_QObjectRace::destroyRace() for (int i = 0; i < ThreadCount; ++i) threads[i]->start(); - QVERIFY(threads[0]->wait(TwoMinutes)); + QVERIFY(threads[0]->wait(MAIN_THREAD_WAIT)); // the other threads should finish pretty quickly now for (int i = 1; i < ThreadCount; ++i) - QVERIFY(threads[i]->wait(3000)); + QVERIFY(threads[i]->wait(EXTRA_THREAD_WAIT)); for (int i = 0; i < ThreadCount; ++i) delete threads[i]; |