aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmllint/tst_qmllint.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-02-11 13:54:10 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-02-11 16:38:06 +0000
commitf0ecad1e99461109e69cd2b0f6271012c20005dd (patch)
tree75d42eec4569f4f3f508a69aa694e93fda1321c7 /tests/auto/qml/qmllint/tst_qmllint.cpp
parentab71cdafca87513a4e214d3af056d8990bc1eddb (diff)
qmllint: Warn about too many or mismatched signal parameters
It's easy to mess this up when you transform your signal handlers into functions. Task-number: QTBUG-89943 Pick-to: 6.1 Change-Id: If35be2f6828a0e19aada19abb41d8135b0c6ab45 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmllint/tst_qmllint.cpp')
-rw-r--r--tests/auto/qml/qmllint/tst_qmllint.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp
index 6e2a41263e..fe6996d6d9 100644
--- a/tests/auto/qml/qmllint/tst_qmllint.cpp
+++ b/tests/auto/qml/qmllint/tst_qmllint.cpp
@@ -288,6 +288,16 @@ void TestQmllint::dirtyQmlCode_data()
<< QStringLiteral("Variable \"argq\" is used before its declaration at 5:9. "
"The declaration is at 6:13.")
<< QString();
+ QTest::newRow("SignalParameterMismatch")
+ << QStringLiteral("namedSignalParameters.qml")
+ << QStringLiteral("Parameter 1 to signal handler for \"onSig\" is called \"argarg\". "
+ "The signal has a parameter of the same name in position 2.")
+ << QStringLiteral("onSig2");
+ QTest::newRow("TooManySignalParameters")
+ << QStringLiteral("tooManySignalParameters.qml")
+ << QStringLiteral("Signal handler for \"onSig\" has more formal parameters "
+ "than the signal it handles.")
+ << QString();
}
void TestQmllint::dirtyQmlCode()