--- a/tests/auto/qbytearray/tst_qbytearray.cpp Fri Feb 19 23:40:16 2010 +0200
+++ b/tests/auto/qbytearray/tst_qbytearray.cpp Fri Mar 12 15:46:37 2010 +0200
@@ -76,6 +76,7 @@
void qCompress();
void qUncompress_data();
void qUncompress();
+ void qCompressionZeroTermination();
#endif
void constByteArray();
void leftJustified();
@@ -261,6 +262,14 @@
}
QCOMPARE(res, out);
}
+
+void tst_QByteArray::qCompressionZeroTermination()
+{
+ QString s = "Hello, I'm a string.";
+ QByteArray ba = ::qUncompress(::qCompress(s.toLocal8Bit()));
+ QVERIFY((int) *(ba.data() + ba.size()) == 0);
+}
+
#endif
void tst_QByteArray::constByteArray()