From 120ace2cf9af79157035c266d7fbe27d9a09f76c Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Fri, 18 Mar 2011 17:37:00 -0300 Subject: Add unit test for bug 693 - "Heap corruption or double free reported on program exit" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewer: Renato Araújo Luciano Wolf --- tests/QtGui/CMakeLists.txt | 1 + tests/QtGui/bug_693.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 tests/QtGui/bug_693.py (limited to 'tests') diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt index 68be0de80..615e13143 100644 --- a/tests/QtGui/CMakeLists.txt +++ b/tests/QtGui/CMakeLists.txt @@ -42,6 +42,7 @@ PYSIDE_TEST(bug_668.py) PYSIDE_TEST(bug_674.py) PYSIDE_TEST(bug_675.py) PYSIDE_TEST(bug_696.py) +PYSIDE_TEST(bug_693.py) PYSIDE_TEST(bug_714.py) PYSIDE_TEST(customproxywidget_test.py) PYSIDE_TEST(deepcopy_test.py) diff --git a/tests/QtGui/bug_693.py b/tests/QtGui/bug_693.py new file mode 100644 index 000000000..4bfbe7c7f --- /dev/null +++ b/tests/QtGui/bug_693.py @@ -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() -- cgit v1.2.3