aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-04-06 18:35:49 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:08 -0300
commit6ef7460a47674072b2dd2f8521bea8c84f7153d5 (patch)
treeb7abb2be3d19f92f619f0f6c92b3da130ecc6c6b /tests
parent0cb14ebf352b4174be9e60f47574aee432e35a1d (diff)
Fix bug 721 - "QFile doesn't support map and unmap functions."
Diffstat (limited to 'tests')
-rw-r--r--tests/QtCore/qfile_test.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/QtCore/qfile_test.py b/tests/QtCore/qfile_test.py
index adbdd68b7..898e5746b 100644
--- a/tests/QtCore/qfile_test.py
+++ b/tests/QtCore/qfile_test.py
@@ -27,5 +27,16 @@ class GetCharTest(unittest.TestCase):
self.assert_(not obj.getChar()[0])
obj.close()
+ def testBug721(self):
+ obj = QFile(self.filename)
+ obj.open(QIODevice.ReadOnly)
+ memory = obj.map(0, 1)
+ self.assertEqual(len(memory), 1)
+ self.assertEqual(memory[0], 'a')
+ obj.unmap(memory)
+ # now memory points to wild bytes... :-)
+ # uncommenting this must cause a segfault.
+ # self.assertEqual(memory[0], 'a')
+
if __name__ == '__main__':
unittest.main()