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:
parent
2a4ee1675d
commit
7013bd760e
2 changed files with 12 additions and 0 deletions
|
|
@ -1437,6 +1437,12 @@
|
||||||
#endif
|
#endif
|
||||||
</inject-code>
|
</inject-code>
|
||||||
|
|
||||||
|
<modify-function signature="data()const">
|
||||||
|
<inject-code class="target" position="beginning">
|
||||||
|
%PYARG_0 = PyString_FromStringAndSize(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.size());
|
||||||
|
</inject-code>
|
||||||
|
</modify-function>
|
||||||
|
|
||||||
<!-- removed functions -->
|
<!-- removed functions -->
|
||||||
<modify-function signature="begin()" remove="all"/>
|
<modify-function signature="begin()" remove="all"/>
|
||||||
<modify-function signature="begin()const" remove="all"/>
|
<modify-function signature="begin()const" remove="all"/>
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,12 @@ class QByteArrayData(unittest.TestCase):
|
||||||
url = QByteArray("http://web.openbossa.org/")
|
url = QByteArray("http://web.openbossa.org/")
|
||||||
self.assertEqual(url.data(), "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):
|
class QByteArrayOperatorAtSetter(unittest.TestCase):
|
||||||
'''Test case for operator QByteArray[] - __setitem__'''
|
'''Test case for operator QByteArray[] - __setitem__'''
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue