Fix compiler warnings in tests
Don't mix unsigned and signed types in comparisons. Pick-to: 6.3 Change-Id: Ia4ba9c114177425a21cadc8cafe8179928315a5d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
parent
c0dbc02680
commit
1fe5ea3f83
@ -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!
|
||||
|
@ -709,7 +709,7 @@ void tst_QAbstractButton::buttonPressKeys()
|
||||
const auto buttonPressKeys = QGuiApplicationPrivate::platformTheme()
|
||||
->themeHint(QPlatformTheme::ButtonPressKeys)
|
||||
.value<QList<Qt::Key>>();
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user