aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2017-05-26 14:52:45 +0200
committerMitch Curtis <mitch.curtis@qt.io>2017-05-26 13:07:24 +0000
commit5d84ae4cd94c1680900e2f1018b23fd2d484eef3 (patch)
tree69bca13c47dfa8f78d8029a5e2d3ee12169ea96d /tests/auto/controls
parent817372c771910d017735ecdd8d4af03a016e2ba9 (diff)
tst_tooltip: fix test_attached() failing when it's not run first
It currently depends on being the first test that uses attached properties to be run. This patch resets the values to the expected values at the beginning of the test to avoid the failure. Change-Id: I9dea7867e6740cba2e3541bffd1f6648ddf0e47d Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/auto/controls')
-rw-r--r--tests/auto/controls/data/tst_tooltip.qml6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/controls/data/tst_tooltip.qml b/tests/auto/controls/data/tst_tooltip.qml
index 4f1831ce..66fb50c1 100644
--- a/tests/auto/controls/data/tst_tooltip.qml
+++ b/tests/auto/controls/data/tst_tooltip.qml
@@ -121,6 +121,11 @@ TestCase {
var item2 = createTemporaryObject(mouseArea, testCase)
verify(item2)
+ // Reset the properties to the expected default values, in case
+ // we're not the first test that uses attached properties to be run.
+ var sharedTip = ToolTip.toolTip
+ sharedTip[data.property] = data.defaultValue
+
compare(item1.ToolTip[data.property], data.defaultValue)
compare(item2.ToolTip[data.property], data.defaultValue)
@@ -130,7 +135,6 @@ TestCase {
var spy2 = signalSpy.createObject(item2, {target: item2.ToolTip, signalName: data.signalName})
verify(spy2.valid)
- var sharedTip = ToolTip.toolTip
sharedSpy.signalName = data.signalName
verify(sharedSpy.valid)
sharedSpy.clear()