Fixes bug #489 - PySide.QtGui.QImage with string buffer argument.
http://bugs.pyside.org/show_bug.cgi?id=489 Also added an unit test. Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Renato Araújo <renato.filho@openbossa.org>
This commit is contained in:
parent
9ffb2ef542
commit
bbba1cc470
2 changed files with 24 additions and 2 deletions
|
|
@ -2,8 +2,8 @@
|
|||
'''Test cases for QImage'''
|
||||
|
||||
import unittest
|
||||
from PySide.QtGui import *
|
||||
from helper import *
|
||||
from PySide.QtGui import QImage
|
||||
from helper import UsesQApplication, adjust_filename
|
||||
|
||||
class QImageTest(UsesQApplication):
|
||||
'''Test case for calling setPixel with float as argument'''
|
||||
|
|
@ -27,6 +27,13 @@ class QImageTest(UsesQApplication):
|
|||
self.assertEquals(str(data1), img0.bits()[:img0.bytesPerLine()])
|
||||
self.assertEquals(str(data2), img0.bits()[:img0.bytesPerLine()])
|
||||
|
||||
def testEmptyBuffer(self):
|
||||
img = QImage(buffer(''), 100, 100, QImage.Format_ARGB32)
|
||||
|
||||
def testEmptyStringAsBuffer(self):
|
||||
img = QImage('', 100, 100, QImage.Format_ARGB32)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue