Skip to content

Commit

Permalink
Fix compiler warnings in tests
Browse files Browse the repository at this point in the history
Don't mix unsigned and signed types in comparisons.

Pick-to: 6.3
Change-Id: Ia4ba9c114177425a21cadc8cafe8179928315a5d
Reviewed-by: Lars Knoll <[email protected]>
  • Loading branch information
vohi committed Mar 24, 2022
1 parent c0dbc02 commit 1fe5ea3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/auto/corelib/tools/qhash/tst_qhash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1fe5ea3

Please sign in to comment.