summaryrefslogtreecommitdiffstats
path: root/tests/QtCore/qdatastream_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/QtCore/qdatastream_test.py')
-rw-r--r--tests/QtCore/qdatastream_test.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/QtCore/qdatastream_test.py b/tests/QtCore/qdatastream_test.py
index b634a7e..1a75f79 100644
--- a/tests/QtCore/qdatastream_test.py
+++ b/tests/QtCore/qdatastream_test.py
@@ -308,6 +308,18 @@ class QDataStreamShiftBitArray(unittest.TestCase):
self._check_bitarray(data)
+class QDataStreamShiftBitArray(unittest.TestCase):
+ def testRawData(self):
+ data = QDataStream()
+ self.assertEqual(data.readRawData(4), '\x00\x00\x00\x00')
+
+ ba = QByteArray()
+ data = QDataStream(ba, QIODevice.WriteOnly)
+ data.writeRawData('ABC')
+ self.assertEqual(ba, 'ABC')
+
+ data = QDataStream(ba)
+ self.assertEqual(data.readRawData(4), 'ABC\x00')
if __name__ == '__main__':
unittest.main()