Created unit test for bug #927.
Reviewer: Lauro Moura <lauro.neto@openbossa.org>
Hugo Parente <hugo.lima@openbossa.org>
This commit is contained in:
parent
eaae6e4dcf
commit
d18945fcf4
2 changed files with 25 additions and 0 deletions
|
|
@ -16,6 +16,7 @@ PYSIDE_TEST(bug_820.py)
|
||||||
PYSIDE_TEST(bug_826.py)
|
PYSIDE_TEST(bug_826.py)
|
||||||
PYSIDE_TEST(bug_829.py)
|
PYSIDE_TEST(bug_829.py)
|
||||||
PYSIDE_TEST(bug_835.py)
|
PYSIDE_TEST(bug_835.py)
|
||||||
|
PYSIDE_TEST(bug_927.py)
|
||||||
PYSIDE_TEST(blocking_signals_test.py)
|
PYSIDE_TEST(blocking_signals_test.py)
|
||||||
PYSIDE_TEST(classinfo_test.py)
|
PYSIDE_TEST(classinfo_test.py)
|
||||||
PYSIDE_TEST(child_event_test.py)
|
PYSIDE_TEST(child_event_test.py)
|
||||||
|
|
|
||||||
24
tests/QtCore/bug_927.py
Normal file
24
tests/QtCore/bug_927.py
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
import time
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
from PySide.QtCore import QTime, QRunnable, QThreadPool
|
||||||
|
|
||||||
|
class Task(QRunnable):
|
||||||
|
def run(self):
|
||||||
|
t = QTime()
|
||||||
|
t.start()
|
||||||
|
time.sleep(2) # Sleep 2 seconds
|
||||||
|
|
||||||
|
|
||||||
|
class QThreadPoolTest(unittest.TestCase):
|
||||||
|
'''This used to cause a segfault due the ownership control on globalInstance function '''
|
||||||
|
def testSlowJobs(self):
|
||||||
|
for i in range(3):
|
||||||
|
task = Task()
|
||||||
|
QThreadPool.globalInstance().start(task)
|
||||||
|
time.sleep(1) # Sleep 1 second
|
||||||
|
|
||||||
|
QThreadPool.globalInstance().waitForDone()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue