diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-22 23:32:20 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-22 23:32:20 (GMT) |
commit | 789e2e08d8969aaebae82f45d48f3d550c8c1d64 (patch) | |
tree | 00484d3c35202541de5abe62a3672b7951bf2713 /tests | |
parent | b1c412cefa51f0eea79dbf279f2a23414ccecc3d (diff) | |
parent | 37f4e51127081f393743b5023f61ec48674cf7a2 (diff) | |
download | Qt-789e2e08d8969aaebae82f45d48f3d550c8c1d64.zip Qt-789e2e08d8969aaebae82f45d48f3d550c8c1d64.tar.gz Qt-789e2e08d8969aaebae82f45d48f3d550c8c1d64.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
tst_qthread: fix compilation
Round origin of text in OpenVG engine
QThread::exec(): Fix possibility to enter several time the event loop
QMessageBox: change the documentation to reflect that it is application modal
Compile on OpenBSD
Doc: Q_PROPERTY, implements the setter/getter in the example
Dynamically register the event number.
Fix wrong error assumption when converting "0.0" to double
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qthread/tst_qthread.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/auto/qthread/tst_qthread.cpp b/tests/auto/qthread/tst_qthread.cpp index 843749a..b0efb5a 100644 --- a/tests/auto/qthread/tst_qthread.cpp +++ b/tests/auto/qthread/tst_qthread.cpp @@ -106,6 +106,7 @@ private slots: void adoptMultipleThreads(); void QTBUG13810_exitAndStart(); + void QTBUG15378_exitAndExec(); void stressTest(); }; @@ -976,5 +977,45 @@ void tst_QThread::QTBUG13810_exitAndStart() } +void tst_QThread::QTBUG15378_exitAndExec() +{ + class Thread : public QThread { + public: + QSemaphore sem1; + QSemaphore sem2; + volatile int value; + void run() { + sem1.acquire(); + value = exec(); //First entrence + sem2.release(); + value = exec(); // Second loop + } + }; + Thread thread; + thread.value = 0; + thread.start(); + thread.exit(556); + thread.sem1.release(); //should exit the first loop + thread.sem2.acquire(); + int v = thread.value; + QCOMPARE(v, 556); + + //test that the thread is running by executing queued connected signal there + Syncronizer sync1; + sync1.moveToThread(&thread); + Syncronizer sync2; + sync2.moveToThread(&thread); + connect(&sync2, SIGNAL(propChanged(int)), &sync1, SLOT(setProp(int)), Qt::QueuedConnection); + connect(&sync1, SIGNAL(propChanged(int)), &thread, SLOT(quit()), Qt::QueuedConnection); + QMetaObject::invokeMethod(&sync2, "setProp", Qt::QueuedConnection , Q_ARG(int, 89)); + QTest::qWait(50); + while(!thread.wait(10)) + QTest::qWait(10); + QCOMPARE(sync2.m_prop, 89); + QCOMPARE(sync1.m_prop, 89); +} + + + QTEST_MAIN(tst_QThread) #include "tst_qthread.moc" |