diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-10-05 07:43:51 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-10-05 14:59:30 +0200 |
commit | 1a85163e1538e8a8e60c884bb21a5084d6170759 (patch) | |
tree | f06ced3698895d8f59458b039e5e754427fe0b89 /tests/auto/cpptest/q3daxis-value | |
parent | affcc0be3f200372ed709f4041dc5079ed2e117a (diff) |
Port from container::count() and length() to size()
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8:
auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)
makeRule(cxxMemberCallExpr(on(QtContainerClass),
callee(cxxMethodDecl(hasAnyName({"count", "length"),
parameterCountIs(0))))),
changeTo(cat(access(o, cat("size"), "()"))),
cat("use 'size()' instead of 'count()/length()'"))
a.k.a qt-port-to-std-compatible-api with config Scope: 'Container',
with the extended set of container classes recognized.
Change-Id: Ibed02600e225ee63c06d61bcd6187518f650a0a0
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests/auto/cpptest/q3daxis-value')
-rw-r--r-- | tests/auto/cpptest/q3daxis-value/tst_axis.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/cpptest/q3daxis-value/tst_axis.cpp b/tests/auto/cpptest/q3daxis-value/tst_axis.cpp index fe93e1ca..54d36d3d 100644 --- a/tests/auto/cpptest/q3daxis-value/tst_axis.cpp +++ b/tests/auto/cpptest/q3daxis-value/tst_axis.cpp @@ -62,7 +62,7 @@ void tst_axis::initialProperties() // Common (from QAbstract3DAxis) QCOMPARE(m_axis->isAutoAdjustRange(), true); QCOMPARE(m_axis->labelAutoRotation(), 0.0f); - QCOMPARE(m_axis->labels().length(), 6); + QCOMPARE(m_axis->labels().size(), 6); QCOMPARE(m_axis->labels().at(0), QString("0.00")); QCOMPARE(m_axis->labels().at(1), QString("2.00")); QCOMPARE(m_axis->labels().at(2), QString("4.00")); @@ -103,7 +103,7 @@ void tst_axis::initializeProperties() QCOMPARE(m_axis->isAutoAdjustRange(), false); QCOMPARE(m_axis->labelAutoRotation(), 15.0f); - QCOMPARE(m_axis->labels().length(), 3); + QCOMPARE(m_axis->labels().size(), 3); QCOMPARE(m_axis->labels().at(0), QString("5m")); QCOMPARE(m_axis->labels().at(1), QString("15m")); QCOMPARE(m_axis->labels().at(2), QString("25m")); |