diff options
Diffstat (limited to 'tests/auto/qthread/tst_qthread.cpp')
-rw-r--r-- | tests/auto/qthread/tst_qthread.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qthread/tst_qthread.cpp b/tests/auto/qthread/tst_qthread.cpp index 7386d9d..6ad0678 100644 --- a/tests/auto/qthread/tst_qthread.cpp +++ b/tests/auto/qthread/tst_qthread.cpp @@ -103,6 +103,7 @@ private slots: void adoptedThreadExit(); void adoptedThreadExec(); void adoptedThreadFinished(); + void adoptedThreadExecFinished(); void adoptMultipleThreads(); void adoptMultipleThreadsOverlap(); @@ -913,6 +914,21 @@ void tst_QThread::adoptedThreadFinished() QVERIFY(!QTestEventLoop::instance().timeout()); } +void tst_QThread::adoptedThreadExecFinished() +{ + NativeThreadWrapper nativeThread; + nativeThread.setWaitForStop(); + nativeThread.startAndWait(adoptedThreadExecFunction); + + QObject::connect(nativeThread.qthread, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + + nativeThread.stop(); + nativeThread.join(); + + QTestEventLoop::instance().enterLoop(5); + QVERIFY(!QTestEventLoop::instance().timeout()); +} + void tst_QThread::adoptMultipleThreads() { #if defined(Q_OS_WIN) |