diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-04-01 09:20:05 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:54:06 -0300 |
commit | 2e1ed4a88122b10bffa35043ff1373e8ec476dcd (patch) | |
tree | 75b3da3889ca70bdd4d63c452188f20ce4855a37 /tests | |
parent | cfe00ac969eea7d937a6fa0a0a5752dc70b96963 (diff) |
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>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/QtGui/qimage_test.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/QtGui/qimage_test.py b/tests/QtGui/qimage_test.py index e9af2d71d..b1a302676 100644 --- a/tests/QtGui/qimage_test.py +++ b/tests/QtGui/qimage_test.py @@ -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() |