diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-12-28 16:52:24 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-29 01:39:04 +0100 |
commit | b4557829f47fd293fcf7fc73d705a7b11e3fb49b (patch) | |
tree | 207c4a5234c43c7163aa128bcc6f0895f7054ac5 /tests/auto | |
parent | 7dffcf8a74de16c977ddff930dd17973d2abdf9d (diff) | |
download | qtbase-b4557829f47fd293fcf7fc73d705a7b11e3fb49b.tar.gz |
Don't allow QThreadPool test to hang on failure.
Use QTRY_VERIFY() to fail after a reasonable timeout rather than putting
the test into an infinite loop.
Change-Id: Ie0917556e15999a94cc0587f3f4c11c0d743a228
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/concurrent/qthreadpool/tst_qthreadpool.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/auto/corelib/concurrent/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/concurrent/qthreadpool/tst_qthreadpool.cpp index ff26d5d2c3..ab67160450 100644 --- a/tests/auto/corelib/concurrent/qthreadpool/tst_qthreadpool.cpp +++ b/tests/auto/corelib/concurrent/qthreadpool/tst_qthreadpool.cpp @@ -205,9 +205,7 @@ void tst_QThreadPool::runTask() QThreadPool manager; ran = false; manager.start(new TestTask()); - // Hang if task is not runned. - while (ran == false) - QTest::qSleep(100); // no busy loop - this doesn't work with FIFO schedulers + QTRY_VERIFY(ran); } /* @@ -217,8 +215,7 @@ void tst_QThreadPool::singleton() { ran = false; QThreadPool::globalInstance()->start(new TestTask()); - while (ran == false) - QTest::qSleep(100); // no busy loop - this doesn't work with FIFO schedulers + QTRY_VERIFY(ran); } int *value = 0; |