Fix bug#455 - "QByteArray.data() cuts data to first '\x00' char"

Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
          Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
Hugo Parente Lima 2010-11-11 14:04:06 -02:00
commit 7013bd760e
2 changed files with 12 additions and 0 deletions

View file

@ -42,6 +42,12 @@ class QByteArrayData(unittest.TestCase):
url = QByteArray("http://web.openbossa.org/")
self.assertEqual(url.data(), "http://web.openbossa.org/")
def testDataWithZeros(self):
s1 = "123\000321"
ba = QByteArray(s1)
s2 = ba.data()
self.assertEqual(s1, s2)
class QByteArrayOperatorAtSetter(unittest.TestCase):
'''Test case for operator QByteArray[] - __setitem__'''