summaryrefslogtreecommitdiff
path: root/tests/auto/nfccommons
Commit message (Collapse)AuthorAgeFilesLines
* Port from container::count() and length() to size() - V4Marc Mutz2022-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); a.k.a qt-port-to-std-compatible-api V4 with config Scope: 'Container'. Change-Id: I58e1b41b91c34d2e860dbb5847b3752edbfc6fc9 Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-061-2/+2
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I9ace956ba9ee596ddf820623957f2d476036c5ed Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port from container::count() and length() to size()Marc Mutz2022-10-065-30/+30
| | | | | | | | | | | | | | | | | | 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: If19e46acd9ceccaa8af43bf02c5ba30f52163108 Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi>
* Use SPDX license identifiersLucie Gérard2022-06-1012-456/+24
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: Ifc22d8ae24532e9a1093ca613ed6590a1992bc39 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QtNfc: Get rid of NearFieldTarget classIevgenii Meshcheriakov2022-05-161-1/+1
| | | | | | | | | | Use QNearFieldTarget class directly after making QNearFieldManagerPrivateImpl a friend. Task-number: QTBUG-103357 Change-Id: I3488c7c23e3a050f3f74cbd3edd39e39bf851ea8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Remove qtconnectivity compiler warnings on macOSJuha Vuolle2021-12-061-8/+0
| | | | | | | | | | - blockByteToAddress is commented out since 2011 => remove - put dumpServiceInfoAttributes behind similar "#if 0" as its usage Pick-to: 6.2 Change-Id: I3d7fb2da45d52c5430c947bca279f2f806b28140 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QNearFieldManager: extend testsIvan Solovev2021-06-114-12/+61
| | | | | | | | | | | | Extend the implementation of the manager emulator, and provide tests to cover the implementation. This patch also fixes the tst_qnearfieldtagtype* to prevent the crashes when the matching target is not found. Task-number: QTBUG-94037 Pick-to: 6.2 Change-Id: I32e5ed747a85d996e4f0f6f66b3321ddebfbdb26 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QtNFC: refactor directory structureIvan Solovev2021-05-2712-0/+3061
A lot of test-related files were actually located in the src directory. This patch moves them to tests/auto/nfccommons and adjusts the build files accordingly. Task-number: QTBUG-93854 Change-Id: I05641d849f4f07cd39d12ea136b4e7453d6aa883 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>