From cb9715557c414d5b3c90165cc8fc710fbdcdba77 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 14 Jul 2022 18:01:42 +0200 Subject: [PATCH] tst_QByteArray: fix custom QCOMPARE for QBAs > 2GiB The tst_QByteArray test redefines the QCOMPARE macro to check the LHS to be NUL-terminated. Because the code was never ported from int to qsizetype, it fails for QByteArrays of size > 2GiB. Fix by porting to qsizetype. Pick-to: 6.4 6.3 6.2 Task-number: QTBUG-104985 Change-Id: Ib3951b0efed5f734ae1324ea2d455bb7762fb9c4 Reviewed-by: Sona Kurazyan Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira --- tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp index f3e91151811..676c6c6cbe2 100644 --- a/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp +++ b/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp @@ -150,7 +150,7 @@ QByteArray verifyZeroTermination(const QByteArray &ba) if (!baDataPtr->isMutable()) return ba; - int baSize = ba.size(); + qsizetype baSize = ba.size(); char baTerminator = ba.constData()[baSize]; if ('\0' != baTerminator) return QString::fromUtf8(