diff options
author | Chris Adams <christopher.adams@nokia.com> | 2012-06-21 16:02:38 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-21 08:36:51 +0200 |
commit | 73e0e7cd53d2ce457d2cab02895eb253902c555a (patch) | |
tree | fe019056c5b86dc733f1b44c0f9daadccc6ef012 /tests/auto/qml/qqmllanguage | |
parent | 09b605ddcc33575316211156ff5979aa92e7e1fd (diff) |
Disallow signal-handler-specification for non-signal methods
Previously, the code which checked whether a signal handler
specification was valid was incorrect, in that it only checked that a
method of the appropriate name existed (rather than specifically a
signal method).
This commit ensures that the appropriate code is updated to check the
method for signal-ness.
Task-number: QTBUG-26223
Change-Id: I306f6622aaa710d86c01d5bbc5146eecce7cf2c3
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'tests/auto/qml/qqmllanguage')
-rw-r--r-- | tests/auto/qml/qqmllanguage/data/missingSignal.2.errors.txt | 1 | ||||
-rw-r--r-- | tests/auto/qml/qqmllanguage/data/missingSignal.2.qml | 11 | ||||
-rw-r--r-- | tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/missingSignal.2.errors.txt b/tests/auto/qml/qqmllanguage/data/missingSignal.2.errors.txt new file mode 100644 index 0000000000..33bf3070d7 --- /dev/null +++ b/tests/auto/qml/qqmllanguage/data/missingSignal.2.errors.txt @@ -0,0 +1 @@ +8:5:Cannot assign to non-existent property "onDynamicMethod" diff --git a/tests/auto/qml/qqmllanguage/data/missingSignal.2.qml b/tests/auto/qml/qqmllanguage/data/missingSignal.2.qml new file mode 100644 index 0000000000..b4297ce67d --- /dev/null +++ b/tests/auto/qml/qqmllanguage/data/missingSignal.2.qml @@ -0,0 +1,11 @@ +import Test 1.0 +MyQmlObject { + function dynamicMethod() { + basicSlot(); + } + + // invalid: signal handler definition given for non-signal method. + onDynamicMethod: { + basicSlot(); + } +} diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index e32489635b..9205f2d730 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -337,6 +337,7 @@ void tst_qqmllanguage::errors_data() QTest::newRow("missingObject") << "missingObject.qml" << "missingObject.errors.txt" << false; QTest::newRow("failingComponent") << "failingComponentTest.qml" << "failingComponent.errors.txt" << false; QTest::newRow("missingSignal") << "missingSignal.qml" << "missingSignal.errors.txt" << false; + QTest::newRow("missingSignal2") << "missingSignal.2.qml" << "missingSignal.2.errors.txt" << false; QTest::newRow("finalOverride") << "finalOverride.qml" << "finalOverride.errors.txt" << false; QTest::newRow("customParserIdNotAllowed") << "customParserIdNotAllowed.qml" << "customParserIdNotAllowed.errors.txt" << false; |