summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/text
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-10-16 10:44:59 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-10-16 13:53:04 +0200
commitd72ff6ffd0e6f04dcd614b020f9abbe129615f8c (patch)
tree3cc9a4900f395cce76bf0dce82263f28b58bf350 /tests/auto/corelib/text
parentc6b3680bcf433bc82219e787b80a2f3430706def (diff)
Fix some compiler warnings from tests
For iterators that return a value, don't use reference in ranged for, and cast numeric literal to correct size type for QCOMPARE. Change-Id: Idfd09dbc2ef3ab1bf025c7859ea6e2e9572bc9a1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/corelib/text')
-rw-r--r--tests/auto/corelib/text/qstringview/tst_qstringview.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/corelib/text/qstringview/tst_qstringview.cpp b/tests/auto/corelib/text/qstringview/tst_qstringview.cpp
index b08d9ce8d9..c2a69c2a98 100644
--- a/tests/auto/corelib/text/qstringview/tst_qstringview.cpp
+++ b/tests/auto/corelib/text/qstringview/tst_qstringview.cpp
@@ -426,9 +426,9 @@ void tst_QStringView::literals() const
}
// these are different results
- QCOMPARE(size_t(QStringView(withnull).size()), 1);
+ QCOMPARE(size_t(QStringView(withnull).size()), size_t(1));
QCOMPARE(size_t(QStringView::fromArray(withnull).size()), sizeof(withnull)/sizeof(withnull[0]));
- QCOMPARE(QStringView(withnull + 0).size(), 1);
+ QCOMPARE(QStringView(withnull + 0).size(), qsizetype(1));
}
void tst_QStringView::fromArray() const