summaryrefslogtreecommitdiff
path: root/src/plugins/clangtools
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2019-11-21 14:19:19 +0100
committerNikolai Kosjar <nikolai.kosjar@qt.io>2019-11-21 14:17:21 +0000
commitb6ed781c2838b6733c85950f5e06d099b7c68eb6 (patch)
treef98dea86aae1fb83abd4bc4b37182602b9ea2cc8 /src/plugins/clangtools
parenta646d0af261cadbfd5d97c3a188e6b5facf86f25 (diff)
downloadqt-creator-b6ed781c2838b6733c85950f5e06d099b7c68eb6.tar.gz
ClangTools: Simplify clazy test
...in order to not run into parse errors in qstring.h involving * C++17 * >= Qt 5.14 * stdlibc++ of gcc 5.3/5.4 Change-Id: I8c06f90a88a4dd18503a81b68433604eb3bc9556 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/clangtools')
-rw-r--r--src/plugins/clangtools/clangtoolsunittests.cpp2
-rw-r--r--src/plugins/clangtools/unit-tests/clangtidy_clazy/clazy_example.cpp20
2 files changed, 7 insertions, 15 deletions
diff --git a/src/plugins/clangtools/clangtoolsunittests.cpp b/src/plugins/clangtools/clangtoolsunittests.cpp
index 609d666ed5..cd20781c17 100644
--- a/src/plugins/clangtools/clangtoolsunittests.cpp
+++ b/src/plugins/clangtools/clangtoolsunittests.cpp
@@ -159,7 +159,7 @@ void ClangToolsUnitTests::testProject_data()
// Test that tidy and clazy diagnostics are emitted for the same project.
addTestRow("clangtidy_clazy/clangtidy_clazy.pro",
1 /*tidy*/ + 1 /*clazy*/,
- configFor("misc-unconventional-assign-operator", "base-class-event"));
+ configFor("misc-unconventional-assign-operator", "qgetenv"));
}
void ClangToolsUnitTests::addTestRow(const QByteArray &relativeFilePath,
diff --git a/src/plugins/clangtools/unit-tests/clangtidy_clazy/clazy_example.cpp b/src/plugins/clangtools/unit-tests/clangtidy_clazy/clazy_example.cpp
index 5cd980d24c..c692e5e697 100644
--- a/src/plugins/clangtools/unit-tests/clangtidy_clazy/clazy_example.cpp
+++ b/src/plugins/clangtools/unit-tests/clangtidy_clazy/clazy_example.cpp
@@ -23,19 +23,11 @@
**
****************************************************************************/
-#include <QCoreApplication>
+#include <QByteArray>
+#include <QtGlobal>
-// -Wclazy-ctor-missing-parent-argument
-class TestObject : public QObject
+void test()
{
- Q_OBJECT
-
-public:
- TestObject();
-
- bool event(QEvent *) override
- {
- // -Wclazy-base-class-event
- return false;
- }
-};
+ // -Wclazy-qgetenv
+ qgetenv("Foo").isEmpty();
+}