summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-08-31 17:43:45 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2011-08-31 19:18:08 -0300
commit1261f293486caa7df9e6d18c14bb0b141f12e7f5 (patch)
treedd289436e4355497615a84d45a7b5c741955c672 /tests
parenta98933b601732f17cd93f40e91f74bb1229471d6 (diff)
downloadpyside-1261f293486caa7df9e6d18c14bb0b141f12e7f5.tar.gz
pyside-1261f293486caa7df9e6d18c14bb0b141f12e7f5.tar.xz
pyside-1261f293486caa7df9e6d18c14bb0b141f12e7f5.zip
Fix bug 944 - "QIODevice.readData must use qmemcpy instead of qstrncpy"
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/QtCore/CMakeLists.txt1
-rw-r--r--tests/QtCore/bug_994.py20
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index 2438b09..398746d 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -22,6 +22,7 @@ PYSIDE_TEST(bug_931.py)
PYSIDE_TEST(bug_938.py)
PYSIDE_TEST(bug_953.py)
PYSIDE_TEST(bug_987.py)
+PYSIDE_TEST(bug_994.py)
PYSIDE_TEST(blocking_signals_test.py)
PYSIDE_TEST(classinfo_test.py)
PYSIDE_TEST(child_event_test.py)
diff --git a/tests/QtCore/bug_994.py b/tests/QtCore/bug_994.py
new file mode 100644
index 0000000..74e352c
--- /dev/null
+++ b/tests/QtCore/bug_994.py
@@ -0,0 +1,20 @@
+import unittest
+from PySide.QtCore import *
+
+class MyIODevice (QIODevice):
+ def readData(self, amount):
+ return "\0a" * (amount/2)
+
+ def atEnd(self):
+ return False
+
+class TestBug944 (unittest.TestCase):
+
+ def testIt(self):
+ device = MyIODevice()
+ device.open(QIODevice.ReadOnly)
+ s = QTextStream(device)
+ self.assertEqual(s.read(4), "\0a\0a")
+
+if __name__ == "__main__":
+ unittest.main()