qt5base-lts/tests/auto/corelib/tools
Marc Mutz df9d882d41 Port from container.count()/length() to size()
This is semantic patch using ClangTidyTransformator:

  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'.

<classes> are:

    // sequential:
    "QByteArray",
    "QList",
    "QQueue",
    "QStack",
    "QString",
    "QVarLengthArray",
    "QVector",
    // associative:
    "QHash",
    "QMultiHash",
    "QMap",
    "QMultiMap",
    "QSet",
    // Qt has no QMultiSet

Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-10-04 07:40:08 +02:00
..
collections Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
containerapisymmetry Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qalgorithms Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qarraydata Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qatomicscopedvaluerollback Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qbitarray Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
qcache Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qcommandlineparser Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qcontiguouscache Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qcryptographichash Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
qduplicatetracker Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qeasingcurve Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
qexplicitlyshareddatapointer Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qflatmap Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qfreelist Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qhash Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
qhashfunctions Port tests away from using q{Set}GlobalQHashSeed 2022-08-26 14:15:24 +02:00
qhashseed Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qline Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qlist Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
qmacautoreleasepool Move QMacAutoReleasePool from qglobal.h to qcore_mac_p.h 2022-09-01 13:26:30 +02:00
qmakearray Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qmap Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
qmargins Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qmessageauthenticationcode Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
qoffsetstringarray Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qpair Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qpoint Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qpointf Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qqueue Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qrect Disable bad tests relying on wrong behavior 2022-09-15 12:07:02 +02:00
qringbuffer Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qscopedpointer tst_qscopedpointer: port away from deprecated APIs 2022-08-27 02:07:54 +02:00
qscopedvaluerollback Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qscopeguard Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qset Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
qsharedpointer Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
qsize Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qsizef Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qstl Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qtaggedpointer QTaggedPointer: disable operator= with an empty initializer list 2022-09-29 16:18:55 +02:00
qtimeline Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qvarlengtharray Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
qversionnumber Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
CMakeLists.txt Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00