diff options
author | Paulo Alcantara <pcacjr@gmail.com> | 2011-11-29 17:20:00 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:56:17 -0300 |
commit | 4985f114a30d5ce0de2a5402d3f2be3d97a93dc4 (patch) | |
tree | 7118bd3adbb82cf4d9e12b30c531b0ef60a345a5 /tests | |
parent | 791f70629cd7ce7bad0a864ff59129822f4c66d7 (diff) |
Fix BUG #1069 - "QtCore.QDataStream silently fails on writing Python string"
Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
Reviewer: Willer Moreira <willer.moreira@openbossa.org>
Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/QtCore/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/QtCore/bug_1069.py | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt index ca737063c..388d38c07 100644 --- a/tests/QtCore/CMakeLists.txt +++ b/tests/QtCore/CMakeLists.txt @@ -25,6 +25,7 @@ PYSIDE_TEST(bug_987.py) PYSIDE_TEST(bug_994.py) PYSIDE_TEST(bug_1019.py) PYSIDE_TEST(bug_1031.py) +PYSIDE_TEST(bug_1069.py) PYSIDE_TEST(blocking_signals_test.py) PYSIDE_TEST(classinfo_test.py) PYSIDE_TEST(child_event_test.py) diff --git a/tests/QtCore/bug_1069.py b/tests/QtCore/bug_1069.py new file mode 100644 index 000000000..7033e1873 --- /dev/null +++ b/tests/QtCore/bug_1069.py @@ -0,0 +1,22 @@ +''' unit test for BUG #1069 ''' + +from PySide import QtCore +import unittest + +class QDataStreamOpOverloadTestCase(unittest.TestCase): + def setUp(self): + self.ba = QtCore.QByteArray() + self.stream = QtCore.QDataStream(self.ba, QtCore.QIODevice.WriteOnly) + + def testIt(self): + self.stream << "hello" + ok = False + for c in self.ba: + if c != b'\x00': + ok = True + break + + self.assertEqual(ok, True) + +if __name__ == "__main__": + unittest.main() |