diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-07-21 19:10:46 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-07-22 10:48:18 -0300 |
commit | 3c2505a6254e9446c06dcbc27e5b9d0d8b4316bf (patch) | |
tree | 76db26d5742d6b145a9bcf5324bc50766ceb0abb | |
parent | f1b330231afb8cb8662c62b2b2b6ec1166e71ca0 (diff) | |
download | pyside-3c2505a6254e9446c06dcbc27e5b9d0d8b4316bf.tar.gz pyside-3c2505a6254e9446c06dcbc27e5b9d0d8b4316bf.tar.xz pyside-3c2505a6254e9446c06dcbc27e5b9d0d8b4316bf.zip |
Fix bug 938 - "QTemporaryFile JPEG problem"
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r-- | PySide/QtCore/typesystem_core.xml | 5 | ||||
-rw-r--r-- | tests/QtCore/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/QtCore/bug_938.py | 14 |
3 files changed, 20 insertions, 0 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml index 7c98d42..845dd26 100644 --- a/PySide/QtCore/typesystem_core.xml +++ b/PySide/QtCore/typesystem_core.xml @@ -1986,6 +1986,11 @@ <modify-function signature="readLine(char *,qint64)" remove="all"/> <!-- ### write(str) do the job --> <modify-function signature="write(const char *,qint64)" remove="all"/> + <modify-function signature="write(const char *)"> + <inject-code> + %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%CPPSELF.%FUNCTION_NAME(%1, PyString_GET_SIZE(%PYARG_1))); + </inject-code> + </modify-function> <modify-function signature="getChar(char *)"> <modify-argument index="1"> <remove-argument /> diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt index 9ddb44c..c5147e8 100644 --- a/tests/QtCore/CMakeLists.txt +++ b/tests/QtCore/CMakeLists.txt @@ -19,6 +19,7 @@ PYSIDE_TEST(bug_835.py) PYSIDE_TEST(bug_920.py) PYSIDE_TEST(bug_927.py) PYSIDE_TEST(bug_931.py) +PYSIDE_TEST(bug_938.py) PYSIDE_TEST(blocking_signals_test.py) PYSIDE_TEST(classinfo_test.py) PYSIDE_TEST(child_event_test.py) diff --git a/tests/QtCore/bug_938.py b/tests/QtCore/bug_938.py new file mode 100644 index 0000000..b2ab565 --- /dev/null +++ b/tests/QtCore/bug_938.py @@ -0,0 +1,14 @@ +import unittest +from PySide.QtCore import * + +class TestBug938 (unittest.TestCase): + + def testIt(self): + b = QBuffer() + b.open(QBuffer.WriteOnly) + b.write("\x0023\x005") + b.close() + self.assertEqual(b.buffer().size(), 5) + +if __name__ == '__main__': + unittest.main() |