aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtCore
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-11-24 15:15:56 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2010-11-24 15:37:48 -0200
commit91030433ced8aa59000de1465635dab528dbb36d (patch)
treed6e46087890d5fa8619ea63827f06a24a16bf4e3 /tests/QtCore
parent47aa7189789b43be6c7fee10affc83966fbbab07 (diff)
Fix bug#496 - "No binary read/write methods in QDataStream"
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Renato Araújo <renato.filho@openbossa.org>
Diffstat (limited to 'tests/QtCore')
-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 b634a7e39..1a75f7935 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()