aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtCore
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-03-11 17:42:21 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:03 -0300
commit945f9bffd9e1b2dd797110c0a1738a3f273bc21f (patch)
treebe18f719c4df3585a76ef23e56b68967831a3ba1 /tests/QtCore
parente2121ae09afcc73fffb1af408dca4ce33988dcda (diff)
Fix bug 718 - "PySide/PyQt4 QByteArray incompatibilities: setNum method"
Fix bug 719 - "PySide/PyQt4 QByteArray incompatibilities: appendByte method"
Diffstat (limited to 'tests/QtCore')
-rw-r--r--tests/QtCore/qbytearray_test.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/QtCore/qbytearray_test.py b/tests/QtCore/qbytearray_test.py
index fa838c19f..4a600ba31 100644
--- a/tests/QtCore/qbytearray_test.py
+++ b/tests/QtCore/qbytearray_test.py
@@ -28,6 +28,25 @@ class QByteArrayTestToNumber(unittest.TestCase):
self.assertEqual((ctypes.c_double(37.109).value, True),
obj.toDouble())
+ def testSetNum(self):
+ b = QByteArray()
+ b.setNum(-124124L)
+ self.assertEqual(b, "-124124")
+ b = QByteArray()
+ b.setNum(-124124)
+ self.assertEqual(b, "-124124")
+ b = QByteArray()
+ b.setNum(-0.5)
+ self.assertEqual(b, "-0.5")
+
+ def testAppend(self):
+ b = QByteArray()
+ b.append("A")
+ self.assertEqual(b.size(), 1)
+ b.append("AB")
+ self.assertEqual(b.size(), 3)
+
+
class QByteArraySplit(unittest.TestCase):
'''Test case for QByteArray.split'''