Fix bug 721 - "QFile doesn't support map and unmap functions."
This commit is contained in:
parent
40718156a6
commit
3b9481c24c
2 changed files with 27 additions and 5 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue