aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-07-14 13:14:24 +0200
committerMitch Curtis <mitch.curtis@qt.io>2016-07-14 15:13:14 +0000
commit264e67734359726a75ab2ca9853c1cfd606cb1d8 (patch)
treede35bc079e732619ed07bdf45397d9a54e57993e /tests
parentb38395d12d6efc288fb260b10f3f1d2dc039c3b7 (diff)
Improve unxpected signal warning
Give hints as to what could be the cause for the failure. A signal that is missing from the signals property will cause very confusing failure messages. Change-Id: Iefe7db2430b93ccc259a58482443d1116f67c456 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/SignalSequenceSpy.qml7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/auto/controls/data/SignalSequenceSpy.qml b/tests/auto/controls/data/SignalSequenceSpy.qml
index f2729f6f..798b8b9c 100644
--- a/tests/auto/controls/data/SignalSequenceSpy.qml
+++ b/tests/auto/controls/data/SignalSequenceSpy.qml
@@ -42,6 +42,11 @@ import QtQuick 2.5
QtObject {
property QtObject target: null
+ // We could just listen to all signals (try { signal.connect(/*...*/) } catch (e))
+ // if it weren't for the fact the spy is often declared as a property of the control,
+ // which creates a "spyChanged" signal, which leads to an unexpected spyChanged signal
+ // emission. However, we don't know what the property will be called, so the signals
+ // have to be listed explicitly.
property var signals: []
property var expectedSequence: []
property int sequenceIndex: 0
@@ -114,7 +119,7 @@ QtObject {
return
}
}
- console.warn("SignalSequenceSpy: Received unexpected signal." +
+ console.warn("SignalSequenceSpy: Received unexpected signal (is \"" + expectedSignal + "\" listed in the signals array?)" +
__mismatchValuesFormat(signalName, expectedSignal))
sequenceFailure = true
}