Add unit test for bug 693 - "Heap corruption or double free reported on program exit"
Reviewer: Renato Araújo <renato.filho@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
9fd4705cf6
commit
120ace2cf9
2 changed files with 32 additions and 0 deletions
|
|
@ -42,6 +42,7 @@ PYSIDE_TEST(bug_668.py)
|
||||||
PYSIDE_TEST(bug_674.py)
|
PYSIDE_TEST(bug_674.py)
|
||||||
PYSIDE_TEST(bug_675.py)
|
PYSIDE_TEST(bug_675.py)
|
||||||
PYSIDE_TEST(bug_696.py)
|
PYSIDE_TEST(bug_696.py)
|
||||||
|
PYSIDE_TEST(bug_693.py)
|
||||||
PYSIDE_TEST(bug_714.py)
|
PYSIDE_TEST(bug_714.py)
|
||||||
PYSIDE_TEST(customproxywidget_test.py)
|
PYSIDE_TEST(customproxywidget_test.py)
|
||||||
PYSIDE_TEST(deepcopy_test.py)
|
PYSIDE_TEST(deepcopy_test.py)
|
||||||
|
|
|
||||||
31
tests/QtGui/bug_693.py
Normal file
31
tests/QtGui/bug_693.py
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
from PySide.QtCore import *
|
||||||
|
from PySide.QtGui import *
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
class MyModel (QAbstractListModel):
|
||||||
|
|
||||||
|
stupidLine = QLine(0, 0, 10, 10)
|
||||||
|
|
||||||
|
def rowCount(self, parent):
|
||||||
|
return 1
|
||||||
|
|
||||||
|
def data(self, index, role):
|
||||||
|
return self.stupidLine
|
||||||
|
|
||||||
|
class TestBug693(unittest.TestCase):
|
||||||
|
def testIt(self):
|
||||||
|
app = QApplication([])
|
||||||
|
model = MyModel()
|
||||||
|
view = QListView()
|
||||||
|
view.setModel(model)
|
||||||
|
view.show()
|
||||||
|
|
||||||
|
# This must NOT throw the exception:
|
||||||
|
# RuntimeError: Internal C++ object (PySide.QtCore.QLine) already deleted.
|
||||||
|
MyModel.stupidLine.isNull()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue