aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtCore/bug_1069.py
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@gmail.com>2011-11-29 17:20:00 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:56:17 -0300
commit4985f114a30d5ce0de2a5402d3f2be3d97a93dc4 (patch)
tree7118bd3adbb82cf4d9e12b30c531b0ef60a345a5 /tests/QtCore/bug_1069.py
parent791f70629cd7ce7bad0a864ff59129822f4c66d7 (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/QtCore/bug_1069.py')
-rw-r--r--tests/QtCore/bug_1069.py22
1 files changed, 22 insertions, 0 deletions
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()