From 3b51b8c31df493ea2c9946c49fc2fc39690ed6a1 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 28 Oct 2021 11:29:43 +0200 Subject: Fix signed/unsigned comparison warnings in tst_QArrayData QArrayDataPointer<>::size is now a qsizetype, not the uint it used to be. Pick-to: 6.2 Change-Id: I09d7e5a50401b46a12f29f93b2b39d646b771cfc Reviewed-by: Lars Knoll Reviewed-by: Thiago Macieira Reviewed-by: Andrei Golubev --- tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp index 81c75fffbc..6d51039d02 100644 --- a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp +++ b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -1797,7 +1797,7 @@ void tst_QArrayData::literals() { { QArrayDataPointer d = Q_ARRAY_LITERAL(char, "ABCDEFGHIJ"); - QCOMPARE(d.size, 10u + 1u); + QCOMPARE(d.size, 10 + 1); for (int i = 0; i < 10; ++i) QCOMPARE(d.data()[i], char('A' + i)); } @@ -1820,7 +1820,7 @@ void tst_QArrayData::literals() { // wchar_t is not necessarily 2-bytes QArrayDataPointer d = Q_ARRAY_LITERAL(wchar_t, L"ABCDEFGHIJ"); - QCOMPARE(d.size, 10u + 1u); + QCOMPARE(d.size, 10 + 1); for (int i = 0; i < 10; ++i) QCOMPARE(d.data()[i], wchar_t('A' + i)); } @@ -1861,7 +1861,7 @@ void tst_QArrayData::variadicLiterals() { QArrayDataPointer d = Q_ARRAY_LITERAL(int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9); - QCOMPARE(d.size, 10u); + QCOMPARE(d.size, 10); for (int i = 0; i < 10; ++i) QCOMPARE(d.data()[i], i); } @@ -1869,7 +1869,7 @@ void tst_QArrayData::variadicLiterals() { QArrayDataPointer d = Q_ARRAY_LITERAL(char, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'); - QCOMPARE(d.size, 10u); + QCOMPARE(d.size, 10); for (int i = 0; i < 10; ++i) QCOMPARE(d.data()[i], char('A' + i)); } @@ -1877,7 +1877,7 @@ void tst_QArrayData::variadicLiterals() { QArrayDataPointer d = Q_ARRAY_LITERAL(const char *, "A", "B", "C", "D", "E", "F", "G", "H", "I", "J"); - QCOMPARE(d.size, 10u); + QCOMPARE(d.size, 10); for (int i = 0; i < 10; ++i) { QCOMPARE(d.data()[i][0], char('A' + i)); QCOMPARE(d.data()[i][1], '\0'); -- cgit v1.2.3