From 5d84ae4cd94c1680900e2f1018b23fd2d484eef3 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 26 May 2017 14:52:45 +0200 Subject: 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 --- tests/auto/controls/data/tst_tooltip.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/auto/controls') 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() -- cgit v1.2.3