diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp index 9ed1ce67aa..fac4ac7007 100644 --- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp +++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp @@ -595,7 +595,7 @@ void tst_QHash::erase_edge_case() for (qsizetype i = 0; i < numBuckets * 4 && index < 2; ++i) { const size_t hash = qHash(i, QHashSeed::globalSeed()); const size_t bucketForHash = QHashPrivate::GrowthPolicy::bucketForHash(numBuckets, hash); - if (bucketForHash == numBuckets - 1) + if (qsizetype(bucketForHash) == numBuckets - 1) keys[index++] = i; } QCOMPARE(index, 2); // Sanity check. If this fails then the test needs an update! diff --git a/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp b/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp index 937a77ca2c..a24cb25eb4 100644 --- a/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp +++ b/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp @@ -709,7 +709,7 @@ void tst_QAbstractButton::buttonPressKeys() const auto buttonPressKeys = QGuiApplicationPrivate::platformTheme() ->themeHint(QPlatformTheme::ButtonPressKeys) .value>(); - for (int i = 0; i < buttonPressKeys.length(); ++i) { + for (uint i = 0; i < buttonPressKeys.length(); ++i) { QTest::keyClick(testWidget, buttonPressKeys[i]); QCOMPARE(click_count, i + 1); }