summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qthread/tst_qthread.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qthread/tst_qthread.cpp b/tests/auto/qthread/tst_qthread.cpp
index c69052e..12709db 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 QTBUG13810_exitAndStart();
@@ -895,6 +896,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)
@@ -929,6 +945,7 @@ void tst_QThread::adoptMultipleThreads()
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(int(recorder.activationCount), numThreads);
+ qDeleteAll(nativeThreads);
}
void tst_QThread::stressTest()